So I am running a service in node which has a node js cluster usage meaning I am running the service with node js clusters... now I want to use pm2 and I use the pm2 cluster mode. I wonder if it's a good thing to use both of them at the same time or should I use only one of them for better performance and stuff like that... Any help would be appreciated
To take the complexity out of your architecture I would recommend to use PM2. It lets you efficiently manage multiple processes. It has many features including:
As the processes are separated, now can start/stop/restart them with your pm2.config.js, i.e
pm2 start pm2.config.js // start all processes
pm2 stop app // stop app processes
pm2 restart smsWorker // restart smsWorker