【问题标题】:what's pm2 auto restart strategy?什么是 pm2 自动重启策略?
【发布时间】:2021-09-17 14:07:50
【问题描述】:

什么是pm2自动重启策略?

我尝试用pm2启动Next.js应用,React渲染错误,pm2可以看到Error log,但是不会重启。

我尝试使用 Pm2 启动一个简单的 Koa 应用程序。在处理网络请求的时候,我触发了一个JS错误,Pm2可以看到Error log,但是Pm2没有重启。

【问题讨论】:

  • autorestart 是默认开启的,但是如果它在不到 1 秒内崩溃(或者你可以设置 min_uptime)那么它就不会重新启动

标签: javascript node.js pm2


【解决方案1】:
Restart app at a specified CRON time
Restart app when files have changed
Restart when app reach a memory threshold
Delay a start and automatic restart
Disable auto restart (app are always restarted with PM2) when crashing or exiting by default)
Restart application automatically at a specific exponential increasing time

参考链接:https://pm2.keymetrics.io/docs/usage/restart-strategies/

希望这个链接对你有帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-19
    • 1970-01-01
    • 1970-01-01
    • 2020-01-17
    • 2011-12-19
    • 2021-11-05
    相关资源
    最近更新 更多