In my local node server , it fails on any uncaught exception and has to be manually restarted. So local was run using either forever or pm2. But my development server is AWS Elastic Beanstalk with Node.Js environment .Though it logs uncaught exceptions and throws it , it never terminates.Even if it terminates , it starts automatically. So is there a need for PM2 or Forever to keep node.js running for ever in AWS Elastic Beanstalk environment.
My 2 cents:
There are many advantages for PM2 over EBS:
with PM2 you can control and manage many applications (processes) with different platforms (JS, Ruby, ...). Where in EBS you can deploy only one application at a time to an EBS.
PM2 gives you direct control over all running process, where you can reload/restart/stop one process and keep other intact.
EBS can fix only few problems for you, like restart on crash, or limit memory leaks. But PM2 gives you control over many other problems (graceful reload, 0 latency reload, ...) Now, I might be a little bit wrong about the full functionalities of EBS, and it might be providing more
Here is a tutorial on how to use PM2 in EBS:
http://pm2.keymetrics.io/docs/tutorials/use-pm2-with-aws-elastic-beanstalk/
Hope it helps!
© 2022 - 2024 — McMap. All rights reserved.
.ebextensions/web.config
file Advanced Environment Customization – Miracidium/health
route and EB replaces/restarts your instance when it detects that the health is failing. This takes care of situations when you crash/freeze your whole OS on the instance, for example when you run out of system memory. – Sycamore