Skip to content

Instantly share code, notes, and snippets.

@anushshukla
Last active February 22, 2022 03:37
Show Gist options
  • Select an option

  • Save anushshukla/d17bfba9da8f858e03d353d3e0c54d05 to your computer and use it in GitHub Desktop.

Select an option

Save anushshukla/d17bfba9da8f858e03d353d3e0c54d05 to your computer and use it in GitHub Desktop.
Process managers

What is a process manager? 💻

Basically, a process itself to manage the application processes like cluster, restart / reload the process without downtime, smart restart etc.

Why do we need process managers?

A process managers helps us to scale the application and make the application available which prevents downtime of the application.

What are important features of a process managers?

Application logging

Printing the logs to the terminal and writing the logs to a file in a configurable directory with rotation.

Multiprocessing

Same as master-slave concept, the process manager should be able to start the process in cluster mode for.

ALB

With the help of multiprocessing, the process manager should able to act as a reverse proxy to distribute traffic uniformly across the processes.

Application reload without downtime

The process manager must re-route the traffic the new process with the update code when the application code needs to updated after a release post deployment of the latest build while killing the old processes after it has processed all the request and gracefully shutdown to avoid data packets loss.

System Monitoring

Monitoring 3 critical health metrics which is measuring the usage i.e. consumption percent of how much is utilised and how much is available of cpu, memory (RAM) and disk space so that alerts and automation can be put in place for cleanup or auto-scaling the application.

Restary policy

When the application process stops / exits due to run time code defect in a given scenario then a good process manager is able to facilitate auto-restart of the application in case if the application is not fault tolerant and follows fail fast principle.

Which is the recommended process manager for a Nodejs application?

Why is the recommended process manager better than others?

Other than fulfuling the primary features, it has an independent and light weight orchestration tools like swarm or the most preferred Kubernestes for clustering.

Docker containers requires less computing H/W compared to other process managers and relatively, it is very simply and easy to start the process without much hassale as the OS dependencies are taken care of by the container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment