Pm2: Difference between update and restart?

Created on 2 Aug 2017  路  1Comment  路  Source: Unitech/pm2

Hi there,

Not sure if the issue has already been opened, yet I wasn't able to find it.

I am wondering what is the difference between a pm2 update and pm2 restart commands? Sometimes, our PM2 based application fails to restart when using a simple restart command. Relaunching it manually with update seems to fix the issue.

Here is our restart command:

cd ${shell pwd}/../.. && pm2 startOrRestart current/config/pm2/myApp-preproduction.json
pm2 dump

The cd part is here to exit our releases/XXX folder. Otherwise, we have other reload issues due to Capistrano like deployments.

Any insights on it? Should we always use update? Any drawbacks? :)

Question

Most helpful comment

pm2 update will restart the whole daemon, that means saving all processes configuration, restarting the daemon then starting all processes from the state saved.
If you have problem with restart, you can still pm2 delete the app you want and then restarting them.

>All comments

pm2 update will restart the whole daemon, that means saving all processes configuration, restarting the daemon then starting all processes from the state saved.
If you have problem with restart, you can still pm2 delete the app you want and then restarting them.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexpts picture alexpts  路  3Comments

mario-mui picture mario-mui  路  3Comments

rangercyh picture rangercyh  路  4Comments

waygee picture waygee  路  4Comments

shaunwarman picture shaunwarman  路  3Comments