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.
Elastic Beanstalk provides platforms for programming languages (Go, Java, Node. js, PHP, Python, Ruby), application servers (Tomcat, Passenger, Puma), and Docker containers.
Go to your application directory and use eb init to setup Beanstalk. We need to make sure Beanstalk will try to launch your application by using npm start . To do so, add a file called Procfile at the root of your source bundle to specify the command that starts your application.
PM2 is a production process manager for Node. js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With