Anatomy of Graceful Shutdown: Part 6 - nginx's Master-Worker Coordination

nginx is one of the most widely deployed web servers and reverse proxies in the world, handling millions of requests per second across countless production environments. Its reputation for reliability comes not just from its performance characteristics, but from how gracefully it handles operations like configuration reloads and shutdowns. When you run nginx -s quit or send a SIGQUIT signal to nginx, you’re triggering a sophisticated coordination dance between the master process and its worker processes. Unlike simpler web servers that might just close all connections immediately, nginx implements a multi-phase graceful shutdown that ensures existing requests complete while preventing new ones from being accepted. ...

January 7, 2025 · 9 min · 1897 words · Andrei Sviridov