Can the pm2 node module restarts the app after crash automatically

流过昼夜 提交于 2019-12-03 09:32:57

Yes, it does this by default and there is even a watch option to restart on changes.

Also, check new excellent option

--exp-backoff-restart-delay=100 (msec, not sec!)

pm2 will restart crashed app after 100 msec, then step-by-step increase restart-delay to 15 secunds

This may help:

# Generate Startup Script
$ pm2 startup

# Freeze your process list across server restart
$ pm2 save

# Remove Startup Script
$ pm2 unstartup

More details here

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!