BOOK DEEP READ · SRE · CHAPTER 22

Addressing Cascading Failures: failure breeds, so fixing the cause won't bring the system back

Site Reliability Engineering · Ch 22 · Mike Ulrich · Google · 2016

中文 →

What is this chapter about?

You've seen the headlines: some app "goes down" and stays down for hours. The strange part is that the published cause is always absurdly small — one line of config changed, a few extra machines added, a feature nobody uses switched on. Chapter 22 of Google's SRE book is about exactly that: how one small failure drags an entire system under, layer by layer.

An analogy first

Think about a blackout. On a hot afternoon a power line overloads and trips — but the current it was carrying doesn't vanish, it shifts onto the neighbouring lines. Those were already near capacity, so the extra share makes them trip too, and the current moves on to the next batch. Within minutes a whole city goes dark.

Here's the counterintuitive part: repairing the line that tripped first does not make the city light up again. Every air conditioner, fridge and lift in town is now stopped, and they would all restart at once the moment you close the switch — a surge far larger than normal, which trips the line straight back. The power industry has a whole procedure for this, called a black start: light one small area, let it settle, then light the next.

Why this is hard

Software collapses follow the same script. One server can't cope and dies; its work is automatically shared out among its peers; the peers were already busy, so the extra share makes them slower; being slow makes users hammer refresh, so the request count goes up, not down; the automated health checker notices a few machines aren't answering, declares them broken and kills them — leaving fewer machines, each busier than before.

See it? The result of every step becomes the cause of the next one. A failure isn't being pushed along by something outside; it grows on its own. That is the one thing worth remembering from this chapter.

What actually makes it grow

Three little engines push it along:

So what do you do?

In peacetime: stamp every piece of work with "after this moment it no longer matters" and throw away anything past it; never let the queue grow long; separate what matters from what doesn't, and drop the latter first when things get busy. In an incident: don't reach for more machines first (new ones need warming up and may well make things worse). The most effective move is usually the one nobody wants to make — cut the traffic off entirely, let the system catch its breath, then let it back in a small slice at a time. Exactly like restoring power to a city.

And the cost is real: cutting traffic means deliberately creating a stretch where nobody can use the thing at all, and plenty of teams can't bring themselves to press that button — which is how a thirty-minute outage becomes a thirty-hour one.

One thing to remember

A failure by itself isn't the scary part. The scary part is that failure breeds. Once the loop is turning, fixing the original cause achieves nothing — you have to stop it by hand, and then relight the system one district at a time, the way you'd restore power to a city.

Want the mechanisms, the numbers and the diagrams? → Switch to the deep read