Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
684 views
in Technique[技术] by (71.8m points)

node.js - What is the difference between pm2 restart and pm2 reload

I have a nodejs app running on server.

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The difference is documented here:

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

The latter means (found here):

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

It also states that:

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...