PM2 is a production-grade process manager for Node.js that internally uses the cluster module to spawn and manage multiple worker processes. It abstracts the complexity of manual clustering with built-in load balancing, auto-restart, monitoring, log management, and zero-downtime reloads.
PM2 is the most widely used tool for running Node.js applications in production. When you use cluster mode in PM2 (pm2 start app.js -i max), PM2 internally leverages the Node.js cluster module to fork multiple workers — one per CPU core. It adds enterprise-grade features on top that the raw cluster module does not provide out of the box.
Auto-restart on crash — PM2 automatically restarts dead workers without any custom code
Zero-downtime reload — pm2 reload restarts workers one-by-one, avoiding downtime
Memory threshold restart — automatically restarts workers exceeding a configured memory limit
Log aggregation — unified log management across all worker processes
Startup scripts — pm2 startup generates OS init scripts so the cluster survives reboots
Built-in metrics — CPU and memory dashboard with pm2 monit
Ecosystem file — declarative configuration for complex multi-app production deployments