Pass flags to NodeJS's Chrome V8 engine in Azure Web Apps

末鹿安然 提交于 2019-11-30 15:59:08

You can do this either in iisnode.yml or in web.config. If you are deploying via git, you likely don't have those in your repo. You can get the default generated web.config by using Kudu Console and finding it under d:\home\site\wwwroot. By default, there is no iisnode.yml at all.

Using iisnode.yml

Just put the following line in the iisnode.yml:

nodeProcessCommandLine: node.exe --nouse-idle-notification --expose-gc --max-old-space-size=1024

Or if you use a full path to a version of Node, you'll need to quote it, e.g.

nodeProcessCommandLine: "D:\Program Files (x86)\nodejs\5.7.1\node.exe" --nouse-idle-notification --expose-gc --max-old-space-size=1024

Using web.config

Toward the end of the file, you'll see a commented out <iisnode> tag. Replace it by something like this:

<iisnode nodeProcessCommandLine="node.exe --nouse-idle-notification --expose-gc --max-old-space-size=1024"/>

Notes

  • iisnode.yml takes precedence over web.config
  • I lowered your max-old-space-size value as that was blowing up when I tried, but that's orthogonal.

Then with either file, you can commit them in your repo so it just works on deployment.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!