pm2比例选项有什么用?

时间:2018-05-09 18:18:14

标签: node.js pm2

实际上我无法理解pm2 scale [app-name] 10的用法,但我知道pm2 start app.js -i 4用于在群集模式下启动应用实例。

另外一个问题如果我将群集数量设置为 -1 会发生什么意味着

pm2 start app.js -i -1

1 个答案:

答案 0 :(得分:1)

PM2可以创建新流程或删除当前正在运行的流程,具体取决于您为文档Parsing succeeded Statement: 'a' Statement: 'b' Statement: 'c' Statement: 'd' 提供的scale选项pm2 scale N的编号。

N is a consistent number which the cluster will scale up or down - 为当前正在运行的进程添加3个新进程。

pm2 scale app +3 - 从当前正在运行的进程中删除3个进程。

关于pm2 scale app 3中的-1,这意味着PM2将创建一些等于pm2 start app.js -i -1的新流程。

相关问题