PM2 — Series Round-Up

It has been a long journey to this last planned post of the PM2 series. We want to wrap up the series and hope you’ve learned a lot throughout the weeks. Every new article covered a separate topic and should help you to improve your application process management on server side. You shouldn’t worry about applications launches after system reboots anymore.

This round-up shortly summarizes all posts and touching each topic again is a good way to recap what you’ve learned. This series will still be available for free within the future and you can surely bookmark this page to come back if you need to look up a detail on PM2.

PM2 Series Overview

The PM2 Series

Each post in this series belongs to a specific topic. Let’s review the posts by category.

Setup & Utility Update

Before diving right into the details, you need to walk through the installation process. We provide a comprehensive utility overview and show you how to install PM2 using NPM. It’s important to know the update procedure for a utility used on your server. We’ve got you covered and show you how to seamlessly update the PM2. Everybody is looking for productivity hacks and PM2 offers a command line auto-completion feature which needs explicit activation on your system. We show you how to set up auto-completion on machine.

Process Management

Of course we show you the core and actual responsibility of PM2: process management. Besides the fundamental knowledge on how to start, restart, stop, delete long running processes of your applications, we guide you through the setup of how to restart the applications on system reboots. Nobody should worry about system outages and the issues that applications won’t start automatically on server restart. Nonetheless, PM2 allows you to show detailed information about managed processes like process id and name, log file locations, version control metadata, and many more. If you need to pass Node V8 arguments while starting your app, don’t worry, we’ve got you covered :)

Zero-Downtime Restarts & Advanced Application Config

Application downtimes are very critical and you’re losing your nerves in deployment situations. Forcing a downtime while updating the apps will hold you back from pushing new features to production. That’s where PM2’s cluster mode comes in and takes all the hassle to free your mind from updating your apps. The cluster mode will start at least two worker processes of your app to be able to always respond to requests in case one worker is restarting due to the upgrade.

You can also use a JSON declaration file besides PM2’s command line utility to define your apps behavior during startup. The declaration file is convenient for complex setups with multiple environment variables and more comprehensive configurations.

Resource Monitoring & Log Handling

It’s very important to find the application output and error logs in case of application failures. The integrated log management of PM2 will help you to use either real-time logs for running applications or particular log files to find the issue. Additionally, you can monitor the current memory and CPU utilization for each application process. If you’re running an application in cluster mode, you’ll see the utilization of all worker processes.

Module System

PM2 allows further customization of the built-in functionality through a module system. Modules are processes running besides your actual applications and can have any imaginable functionality. There are existing modules adding the features of showing metrics for common databases or monitoring docker containers with PM2.

Closing Words

At first, we want to shout out to Keymetrics for the great process manager, which gives us the freedom to run and deploy applications with joy.

We hope you’ve learned a lot throughout this series and find the selected topics beneficial for your application deployments. There are a lot features we didn’t specifically touched and we hope you’ll find more interesting functionality while using the utility. Please let us know if there is something important missing or you’d like to read another article about a topic we didn’t cover yet!

Enjoy PM2 and let us know if the utility helps you to run your applications :)

Explore the Library

Find interesting tutorials and solutions for your problems.