The AWS outage of December 2021
medium 26 minOn 7 December 2021 an automated scaling activity in US-EAST-1 triggered a surge of connections that overwhelmed the devices between two AWS networks.
See it run
Follow the surge, the loop and the repair, compare three clients, and rebuild the narrow place.
Operations
A normal day
Two networks, and the devices where they meet.
Step 1 of 4
Customers use services
- Load on the devices (example)
- 40%
Most services and all customer applications run in the main network.
Step 1: Customers use services
- Who is affected
- Nobody
- Way out
- Not needed
- Devices
- several, in separate places
Mark the place where many paths become one. That is where shared load meets.
In the real world
The same the aws outage of december 2021 doing real jobs. Pick one and step through it.
A team checks its plan for steps that need a control plane.
Step 1 of 4
The plan
| needs | on the day | |
|---|---|---|
| Detect | ||
| Add servers | ||
| Switch DNS | ||
| Tell people |
Four steps for losing a zone.
Step 1: The plan
Common mistakes
The bugs interviewers watch for, with the fix beside each.
Retrying at once
criticalEvery failure adds load to the place that is already full.
Wrongwhile True: try: return send() except Busy: passRightsleep(random.uniform(0, min(60, 2 ** attempt)))Retrying in every layer
majorThree layers with three tries turn one request into 27.
Wronggateway.tries = 3service.tries = 3driver.tries = 3Rightgateway.tries = 1service.tries = 3 # one place decidesdriver.tries = 1Surviving by launching
criticalThe launch API may be what is broken.
Wrongon_zone_loss: launch(new_servers)Rightservers_per_zone = ceil(peak / ((zones - 1) * per_server))Monitoring behind the problem
majorYou lose the picture at the moment you need it.
Wrongsend(metrics, via=shared_network)Rightsend(metrics, via=shared_network)send(vital_signs, via=second_path)
Interview tips
How to explain it
- A scaling activity triggered a connection surge.
- Devices between two networks were overwhelmed and retries kept them so.
- Control planes failed, data planes worked.
Memory trick
- A footpath jam: the rush is short, the turning back lasts.
- The map is at the far end.
Design it in
- Backoff, jitter and a budget.
- Limits and lanes at narrow places.
- Enough running to lose a zone.
Say carefully
- The service being scaled was in the main network.
- Lambda, S3 and DynamoDB were not generally down.
- The network took 6 h 52 min; services took longer.