Anatomy of Graceful Shutdown: Part 3

[Disclaimer] I struggled a lot with writing this article, as K8S itself is way too big to grasp quickly and I had to make a lot of compromises on the structure and details for it all to make some sense. The article may feel dragged in some places, jumping from topic to topic yet I had to complete it, so sorry not sorry. GenAI has been used to generate the diagrams from the Kubernetes, Container-D and RunC codebase. ...

June 6, 2025 · 12 min · 2480 words · Andrei Sviridov

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

Anatomy of Graceful Shutdown: Part 2

Part 2: Docker Containers and graceful shutdown Part 1: Signals and Linux Part 2: Containers and signals [you’re here] Part 3: Graceful shutdown of K8S pods Part 4: Celery Graceful Shutdown Part 5: Prometheus Graceful Shutdown Part 6: Other frameworks and libraries [WIP] Intro The previous chapter was difficult, and I assumed things would get easier along the way. Little did I know. Instead of discussing the actual graceful shutdown topic, this post will focus more on the overview of the modern state of containers application. ...

March 9, 2024 · 14 min · 2895 words · Andrei Sviridov

Anatomy of Graceful Shutdown: Part 1

Part 1: Signals and Linux Part 1: Signals and Linux [you’re here] Part 2: Containers and signals Part 3: Graceful shutdown of K8S pods Part 4: Celery Graceful Shutdown Part 5: Prometheus Graceful Shutdown Part 6: Other frameworks and libraries [WIP] Intro There’s been quite a lot of issues surrounding application shutdowns in my line of work. Connections not being correctly closed, incoming requests being processed when they shouldn’t have been, various quirks around how new deployments affect customers during busy hours. I’ve decided to familiarize myself more with the topic and that’s quite a lot going on there. ...

March 3, 2024 · 25 min · 5230 words · Andrei Sviridov