Kudu: NodeJs deployments with NPM slow

Created on 22 Jul 2016  路  9Comments  路  Source: projectkudu/kudu

We have two sites in azure that utilize node. One of them is OSS which you can find at https://github.com/ritterim/star-orgs. Our azure app services sites are rim-star-orgs and eb-quoteengine-qa are the two sites on azure.

Deployment Times

  • Star Orgs : ~160 seconds
  • Quote Engine : 378 seconds (over 6 minutes!)

Our current deployment runs npm install and gulp on azure. I understand it is most likely IO bound due to being written on the slow disk.

Is this performance expected behavior? Even after a call to npm install with the node_modules folder hydrated, it still takes a long time to deploy as you can probably see in the app services azure UI.

Thank you for your help.

@kendaleiv @comfroels @jrusbatch

Most helpful comment

Experiencing this right now. Taking ~45 minutes to deploy a simple React app.

All 9 comments

@khalidabuhakmeh I took a quick look at site "eb-quoteengine-q", seems like the majority of the time (~5 minutes) is spending on KuduSync for copying files, and seems like your repository have quite a mount of files "20742 files".

I will try to do some bench on my machine to see in general how long does it take to copy that amount of files.

And does your project really require all 20742 files? Would there be a chance your repo has some non-used files?

From deployment f049393d89983ee04e2c2ff9145b4033e6094731:

    2016-07-21T17:36:43.1221316Z,Omitting next output lines...,,0
    2016-07-21T17:37:03.7262014Z,Processed 1006 files...,,0
    2016-07-21T17:37:23.7327714Z,Processed 2482 files...,,0
    2016-07-21T17:37:43.7330765Z,Processed 3940 files...,,0
    2016-07-21T17:38:03.7386083Z,Processed 5485 files...,,0
    2016-07-21T17:38:23.8800551Z,Processed 7085 files...,,0
    2016-07-21T17:38:43.8839515Z,Processed 8467 files...,,0
    2016-07-21T17:39:03.8845949Z,Processed 9828 files...,,0
    2016-07-21T17:39:23.9059631Z,Processed 11371 files...,,0
    2016-07-21T17:39:43.9081679Z,Processed 12600 files...,,0
    2016-07-21T17:40:03.9098378Z,Processed 13959 files...,,0
    2016-07-21T17:40:23.9108179Z,Processed 15139 files...,,0
    2016-07-21T17:40:43.9161550Z,Processed 16375 files...,,0
    2016-07-21T17:41:03.9283262Z,Processed 17970 files...,,0
    2016-07-21T17:41:23.9332671Z,Processed 19246 files...,,0
    2016-07-21T17:41:43.9448335Z,Processed 20742 files...,,0

Those files are coming from the node_modules folder and are just part of our dependencies. We are calling --production which trims it down a bit, but just a _feature_ of nodejs.

@khalidabuhakmeh Seems like those files have to be there, so one solution is to do in-place deployment as describe here https://github.com/projectkudu/kudu/wiki/Deploying-inplace-and-without-repository, which should be able to safe you ~5 minutes deployment time from what we can see.

One thing you need to pay attention when doing in-place deployment is, your repo should contains all the files that ready to run. e.g include web.config, otherwise when there is a new deployment, web.config will be revert/delete and re-create/modified by git.

Is it possible that someday, without the expense of setting up an app service environment, there might be a premium sites offering that is built on top of premium storage?

When I do cloud development with our large Node project using an F-series VM and premium storage, it's zippy fast... and then our Kudu deployments are just slow in comparison. Hoping for a future improvement!

All i'm trying to deploy is an azure function with three dependent libraries and Ive been waiting for 3 hours now for npm install

Experiencing this right now. Taking ~45 minutes to deploy a simple React app.

can you try with npm5? you can do this by changing node version in appsetting:
image

I'm closing this issue. If you have a build system, please use the ZIP deployment strategy.

https://docs.microsoft.com/en-us/azure/app-service/app-service-deploy-zip

@khalidabuhakmeh We can't use zip deployment if the website needs to write to the deployment folder (for example to cache images of different sizes).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chillyistkult picture chillyistkult  路  8Comments

jcorioland picture jcorioland  路  8Comments

vikguptaMS picture vikguptaMS  路  6Comments

Benjiiim picture Benjiiim  路  7Comments

suwatch picture suwatch  路  6Comments