core icon indicating copy to clipboard operation
core copied to clipboard

How to run multiple instances?

Open tavsta opened this issue 8 years ago • 3 comments

I want to use load balancing, but don't know how to run multiple instance per source.

tavsta avatar Apr 22 '18 05:04 tavsta

  1. You can use inbuilt node.js cluster module and it will load balance for you.
  2. Or simply run 2 instances of codebase on different ports.
PORT=4444 node server.js
PORT=5555 node server.js

thetutlage avatar Apr 22 '18 08:04 thetutlage

PM2 also works well for this:

pm2 start server.js -i <number-of-workers>

webdevian avatar Apr 23 '18 08:04 webdevian

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.

lock[bot] avatar Mar 11 '20 06:03 lock[bot]