pm2 module keeps restarting
I have pm2 managing some nodejs services that I start with the command:
pm2 start /home/myuser/.node-environments/ecosystem.config.js
this works well, a subsecutive pm2 ls command shows
When I come back after some days however, an additional process has started that hogs my server's cpu because it keeps restarting
It is not clear where this process comes from, it might have to do with a server restart. Anyway, I can simply stop and delete the process (that always has id 0). Stopping the process does not affect my running applications.
Can someone explain my what happens here, what could be the cause and how I can fix it.
I have no idea, but a bug in your code cause a server crash, which then triggers a restart over and over ?
But in that case, I would expect an attempted restart on the application itself. But as you can see in the output, pm2 lists 0 restarts on any of the running applications.
I noticed that I needed autorestart: false, when I was thinking same thing.