0

Currently, I'm working on a live node.js server that has an async queue running with tons of data.

Will I lose all queued data if I run pm2 reload?

I can't test to see what will happen since it's a live server.

Looking forward to hearing about your experience!

Victor
  • 3
  • 1

1 Answers1

0

answer: I believe you will lose data due to the object storing the data being lost on the process restarting.

From async's queue documentation , a queue is an object that then is pushed onto memory and so if that respective node process is restarted the memory associated with it would be restarted as well.

pm2 reload is essentially a restart, but with gracefulness in keeping at least a process up to prevent zero down time.

From a question on the nuances of pm2 restart vs pm2 reload SO link,

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

Manny
  • 369
  • 2
  • 7
  • Thanks very much, @Manny. Though I'm unhappy to know that I'll lose data after pm2 reload... :( – Victor Oct 11 '21 at 06:29