Why Nginx Shows “worker process is shutting down” and How to Fix It
The article explains how a new WebSocket domain caused Nginx worker processes to repeatedly shut down, leading to timeout alerts, and provides step‑by‑step investigation methods and a configuration fix using the worker_shutdown_timeout directive.
Problem: In production, the website API monitoring reported many timeout alerts because a large number of Nginx worker processes were repeatedly shutting down.
Investigation steps:
Check for abnormal attacks (public SLB bandwidth usage, Nginx logs).
Inspect server and service status (CPU usage, ps -ef|grep nginx).
Observe many “worker process is shutting down” entries.
Root Cause Analysis
The new domain introduced a WebSocket long‑connection. When Nginx performed a hot reload, the existing long‑connections were not terminated, causing the reload to wait indefinitely and saturating system load.
Solution
In nginx.conf add worker_shutdown_timeout 10; to limit the shutdown wait time.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
