tezvyn:

PM2: Zero-Downtime Reloads in Cluster Mode

Source: pm2.ioadvanced

PM2's `reload` command updates a clustered Node.js app without downtime by restarting processes one by one. Use this for live deployments. The footgun is using it on a stateful app, which will cause data loss unless state is externalized.

PM2's `reload` command enables zero-downtime deployments for clustered Node.js apps by restarting processes sequentially, ensuring one is always serving traffic. Unlike `restart` which causes an outage, `reload` is ideal for updating live services. The biggest footgun is using this on a stateful app; in-memory sessions or connections will be lost. Your application must be stateless and implement a graceful shutdown to avoid dropping requests during the handover.

Read the original → pm2.io

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

PM2: Zero-Downtime Reloads in Cluster Mode · Tezvyn