Cascading failure & overload
Retry storms, thundering herds, connection-pool exhaustion, GC death spirals. Defenses: jittered exponential backoff, retry budgets, circuit breakers, load shedding.
The mental model
A cascading failure is a traffic jam that eats the whole highway. One lane closes for a stalled car — a small, local problem. Cars pile up. Frustrated drivers cut into the next lane, which now slows and backs up too. The backup reaches an interchange and spreads onto three more highways. Twenty minutes later a metro area is gridlocked, and here's the cruel part: the stalled car has long since been towed, and the jam is still growing. The original cause is gone; the traffic is now jamming itself.
That is the signature of a cascading failure and the reason it terrifies SREs: the system's own response to the failure becomes the failure. A replica gets slow, so its load shifts to the others, so they get slow, so their load shifts, so they all fall over — a positive feedback loop where each failure causes the next. Restarting the original culprit doesn't help, because the culprit is no longer the problem; the loop is self-sustaining. You often have to reduce load below normal — throttle everything, drain queues, shed traffic — to break the cycle, then slowly let it back.
The mechanisms all share this feedback shape, and the discipline is recognising them by name and building the dampers before the jam:
- Retry storms — a blip makes requests fail, every client retries, retries multiply load 3–5×, which makes more requests fail, which triggers more retries.
- Thundering herd — a cache expires or a service restarts and thousands of clients hit the cold backend simultaneously.
- Connection-pool / thread-pool exhaustion — a slow dependency holds every connection open; new requests can't get one and fail, even though nothing is "down."
- GC death spiral — memory pressure triggers frequent garbage collection, GC pauses slow requests, slow requests queue up and use more memory, which triggers more GC.
The defenses are the dampers: jittered exponential backoff, retry budgets, circuit breakers, load shedding, and adaptive concurrency limits. An SRE who can name the mechanism and its damper in the same breath is an SRE who has been paged by one at 3am.
- Deep dive
- Internal architecture
- Real-world use cases
- Best practices
- Common mistakes
- Performance
- Security
- Production troubleshooting
- Advantages & disadvantages
- Alternatives
- Interview expectations
- Interview questions
- Facts to remember
- Cheat sheet
- Quick revision