Working with PM2 manager

My project doesn’t seem working with pm2 or am I doing something wrong?

It kept spawning until the CPU gets overloaded.

logs :

[PM2] Spawning PM2 daemon with pm2_home=/app/.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting /app/server.js in fork_mode (1 instance)
[PM2] Done.

Hi @klerikdust I believe some other folks have used PM2 on Glitch, but I’m not sure where I saw that. I suspect to be of much other help we’d need to be able to look at the project itself if you’re willing to share the project name.

Yes, @cori I saw a similar problem in Pm2 not working?.
But the solution doesn’t really help me to fix which part should I look for :frowning:

Anyway, I’ve sent the project link through dm.

I was able to take a quick look at your project and I don’t see any errors in your logs. Have you altered things to avoid the error, or otherwise resolved it, or did it just go away? Or did I just pick an inopportune time to look?

Yes, I’ve solved the problem yesterday.
The solution was adding –no-daemon --max-memory-restart to the options.
And make sure the app is listening to the port.

2 Likes

I am using PM2 and configuring things using ecosystem.config.js. How should I add that --no-daemon to my config file?

I looked up into pm2 docs and it seems the option is not available through standalone config file. You can try adding –no-daemon to your script in package.json instead.

1 Like