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

后端 未结 3 1546
长发绾君心
长发绾君心 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条回答
  •  遇见更好的自我
    2021-02-06 08:47

    I was using PM2 for quite a while, but their pricing is expensive for my needs as I'm having my own analytics environment and I don't require support, so I decided to experiment alternatives. For my case, just forever made the trick, very simple one actually:

    forever -m 5 app.js
    

    Another useful example is

    forever start app.js -p 8080
    

提交回复
热议问题