pm2 restart和pm2 reload有什么区别 [英] What is the difference between pm2 restart and pm2 reload

查看:4202
本文介绍了pm2 restart和pm2 reload有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在服务器上运行了一个nodejs应用.

I have a nodejs app running on server.

我什么时候应该使用 pm2 restart ,什么时候应该使用 pm2 reload ?

When should I use pm2 restart,and when should pm2 reload be used?

此处引用了 pm2文档,但无法弄清楚两者在用例上的差异.

Referred to the pm2 documention here,but couldn't figure out the difference in use case of the two.

推荐答案

差异记录在

reload与杀死并重新启动进程的restart相反,reload实现了0秒的停机时间重新加载.

As opposed to restart, which kills and restarts the process, reload achieves a 0-second-downtime reload.

后者是指(在此处):

通过重新加载,pm2一步一步地重新启动所有进程,始终保持至少一个进程在运行.

With reload, pm2 restarts all processes one by one, always keeping at least one process running.

它还指出:

如果重新加载系统尚未设法重新加载您的应用程序,则超时将回退为经典的重新启动.

If the reload system hasn’t managed to reload your application, a timeout will fallback to a classic restart.

这篇关于pm2 restart和pm2 reload有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆