core
core copied to clipboard
How to run multiple instances?
I want to use load balancing, but don't know how to run multiple instance per source.
- You can use inbuilt node.js cluster module and it will load balance for you.
- Or simply run 2 instances of codebase on different ports.
PORT=4444 node server.js
PORT=5555 node server.js
PM2 also works well for this:
pm2 start server.js -i <number-of-workers>
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.