-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starting Pm2 in auto cluster mode #38
Comments
You need to set the nodeProcessCountPerApplication to 0 in iisnode.yml in your root. |
I am not using the windows azure web app. I use the nodejs container which does not use IIS. |
Hmm, theres probably somewhere where you can relay config flags to PM2, but I am not familiar with it. Perhaps you can configure this in the process.json file? http://pm2.keymetrics.io/docs/usage/application-declaration/#process-file |
It appears that if you set your startup file to process.json, it will start PM2 in cluster. You can then set the number of instances in process.json. {
"name": "worker",
"script": "./server.js",
"instances": 4,
"merge_logs": true,
"log_date_format": "YYYY-MM-DD HH:mm Z",
"watch": true,
"watch_options": {
"followSymlinks": true,
"usePolling": true,
"interval": 5
}
} Logs here https://gist.github.com/techno246/fbe2de3b3521464b549d3498e2b0ac03 (same one I posted in issue #47 ) |
Hello,
I am using the v8.9.4 node image. I am trying to figure out how to get pm2 to start in built-in cluster mode. If I scale up my app service plan I can actually have more CPU. I want to get pm2 to spin up more clusters. this command
pm2 start app.js -i max
auto detects the number of CPUs and spins up right number of node instances.This should in theory be transparent to the web app. I tried to spin up the cluster manually by running that command straight in console, and they spin up alright. Also use up CPU much better.
How can I use the current container to start my application using pm2 in cluster mode?
Thanks!
The text was updated successfully, but these errors were encountered: