pm2
Defnition: A process manager. With a built-in load balancer. Keep applications alive forever(works as a daemon), reloads them without downtime, helps you to manage application logging, monitoring, and clustering.
mode
fork mode: a basic process spawning.
cluster mode: pm2 start index.js -i max
use cluster api behind the scene. Only works with node application. 注意这时需要用分布式缓存哦
with containers
- 网上也有讨论,一般情况下,如果使用 docker,按道理是无需再使用 pm2 的
- 关于在 docker 中的最佳实践,参考 BretFisher/node-docker-good-defaults: sample node app for Docker examples