NodeJS on multiple processors (PM2, Cluster, Recluster, Naught)

后端 未结 3 1543
长发绾君心
长发绾君心 2021-02-06 07:49

I am investigating options for running node in a multi-core environment.

I\'m trying to determine the best approach and so far I\'ve seen these options

  • Use
3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-06 08:26

    We use Supervisor to manage our Node.JS process's, to start them upon boot, and to act as a watchdog in case the process's crash.

    We use Nginx as a reverse-proxy to load balance traffic between the process's that listen to different ports

    this way each process is isolated from the other.

    for example: Nginx listens on port 80 and forwards traffic to ports 8000-8003

提交回复
热议问题