Running PM2 & Node.js in Production Environments

Nick Parsons
HackerNoon.com

--

https://getstream.io/try-the-api

At Stream, we build a lot of showcase and example applications to show off the awesome features that our service has to offer. For nearly all of our applications, we host them on an instance — usually DigitalOcean or AWS EC2.

While maintaining your codebase and keeping it relevant is difficult, we’ve found that the most challenging aspect when it comes to maintaining an application is keeping it alive and running. Additionally, with Node.js being the core language for most of our backend APIs, scaling a single threaded process can be hard to do; that’s where PM2 comes in and why we enjoy using it so much.

There are many process managers out there, most notably Forever, StrongLoop’s Process Manager, and good ol’ SystemD. And then there is PM2, with over 60 million downloads and 25k GitHub stars (and rising!). We like PM2 because, simply put, it’s easy to use and makes managing a production environment seamless.

What is PM2?

PM2 is a battle tested, production ready runtime and process manager for Node.js applications. It comes with a built-in load balancer, as well, which makes scaling applications even easier…

--

--