简体   繁体   中英

Using supervisord instead of pm2 to manage nodejs process

We currently use pm2 to keep our nodejs process alive, we don't use the cluster mode (and the related load balance feature).

Our php team uses supervisord to manage their php process alive, as laravel suggests . Now we are investigating the possibility of using supervisord to manage our nodejs process too. We mainly need 2 things from a process manager , keep a process alive and log the event when it crushes and restarts.

In term of keeping a process alive I do find pm2 & supervisord share some similarity. But pm2 have more restart policies , eg pm2 has a CRON time which supervisord doesn't have (correct me if I am wrong). Without cron time feature we will have to just resort to cronjob, so it is a nice to have feature but not a must.

supervisord has process groups and priority order , which through my experience with node, I don't find many use cases.

So to us it seems doable, but we don't have enough experience with supervisord and we are afraid we may miss something here, especially the big one like you should not do that in the first place! Have anyone done this before ?

BTW, my question is kind of the opposite of Running a python script in virtual environment with node.js pm2

when you use pm2 or supervisord, the crash message would hidden by pm2 or supervisord. so, the key point is, when the worker crash, you should has ability to know it. such as to hack the pm2 program, when worker crash, send message to the monitor system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM