Deployment is *very* slow (nodeJS with publish profile)
See original GitHub issueI’m using a workflow file adapted from “build and deploy a Node.js Web app to Azure using publish profile”.
(side remark) : I had issues with symbolic links too (see https://github.com/Azure/webapps-deploy/issues/54#issuecomment-694259266)
Upon analysis, it seems that the whole copy of the node_modules
folders to the webroot of the webapp takes ages (10-12 minutes for the Azure Webapp deploy step !) It’s very inefficient to process and send many little files over network.
=> Shouldn’t the final npm install
(and npm run build
– I’m using typescript) commands be executed on the target machine instead of a github action container ?
IMHO, the workflow should be like this for the “nodeJS with publish profile” scenario :
- the github action should only send source files to the targeted runtime machine
npm install
,npm run build
andnpm start
should be done on the targeted runtime machine- It’s up to the developer to ensure that is app is building correctly before calling
azure/webapps-deploy
Related questions :
- Also how this Github action is related to Kudu ?
- Does it use Kudu behind the scenes ? How ? (bare copy ? zip deploy ?)
- If yes, are Kudu capabilities useable ? I.E.
.deployment
file, deployment hooks, etc.
references : https://github.com/projectkudu/kudu/wiki/Customizing-deployments and https://github.com/projectkudu/kudu/wiki/Deployment-hooks
Issue Analytics
- State:
- Created 3 years ago
- Reactions:34
- Comments:72 (7 by maintainers)
Top Results From Across the Web
How to substantially slow down your Node.js server
We ran the load tests for both staging deployments concurrently in order to simulate identical running conditions, because the data sources that ...
Read more >This is why your Node.js application is slow
The simple problem with it is that it is capable of slowing down your application greatly when not correctly used. Whenever a promise...
Read more >Very slow deploy for simple node js app on free tier - Render
I noticed that deploys for the free tier are extremely slow. It could take between 30 seconds to 1 minutes on the Heroku...
Read more >Very slow Kudu deployments on Azure Websites
I suspect that with mention of nodejs, there are a bunch of npm packages being ... Look at your publish profile if you...
Read more >Profile slow code in Node.js - IBM Developer
While profiling, your application may take a slight performance hit, so keep ... true let profile try { await post('Profiler.enable') await ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The workflow described above runs in ~10 minutes, out of which the deploy part is the longest.
On my second attempt, I configured the workflow to deploy and run from ZIP, which is much faster - total time ~3 minutes (~1:45s build, ~30s deploy)
Step 1, in Azure configure the app to run from package, and disable the Oryx build (Github actions builds everything anyway)
Step 2, use this Github workflow that creates a zip after build (including node_modules)
An added benefit to this method is that you can download the Action artifacts later if you need to reproduce the environment exactly for debugging, as the Github job artifact named
node-app
here is exactly what is running on the server. There is no chance that the server would download a newer npm version or anything like that.Plus it might reduce cold starts
Closing the issue as the question has been addressed and for performance we already have npm install in the sample workflow which optimises the time