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.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
Why Nginx Shows “worker process is shutting down” and How to Fix It

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.

ConfigurationWebSocketTimeoutworker process
Practical DevOps Architecture
Written by

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.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.