The AWS Kinesis outage of 2020
medium 26 minOn 25 November 2020 a small capacity addition to Amazon Kinesis in US-EAST-1 pushed every front-end server over an operating system thread limit.
See it run
See the mesh grow, replay the event, follow it into other services and rebuild it in cells.
Operations
A write, normally
Why the shard-map decides everything.
Step 1 of 4
Put a record
A producer calls the front end, which checks identity and rate.
Step 1: Put a record
- Who is affected
- Nobody
- Way out
- Not needed
- Front end stores
- no records
Name the small part that everything passes through. Here it is a cached table.
In the real world
The same the aws kinesis outage of 2020 doing real jobs. Pick one and step through it.
The same trap in a smaller system: every app server opens 20 database connections, the database allows 500. Example numbers.
Step 1 of 4
10 servers
| connections | limit 500 | |
|---|---|---|
| 10 servers | 200 | 40% |
| 20 servers | ||
| 26 servers |
200 connections. Fine.
Step 1: 10 servers
Common mistakes
The bugs interviewers watch for, with the fix beside each.
Testing only what you added
criticalThe cost of a new server can land on the old ones.
Wrongcheck(new_servers)Rightcheck(all_servers, after=learning_delay)Waiting on an optional buffer
criticalThe request stops for data nobody needs right now.
Wrongbuffer.put(event) # blocksRighttry: buffer.put_nowait(event)except Full: dropped.add(1)Alarms only on errors
majorA limit is silent until it is crossed, and then everything fails.
Wrongalarm(error_rate > 0.01)Rightalarm(threads / thread_limit > 0.5)Restarting everything at once
majorCold servers are slow, look unhealthy and are removed again.
Wrongfor s in fleet: start(s)Rightfor group in batches(fleet, safe_size): start(group) wait_until(map_complete, group)
Interview tips
How to explain it
- Trigger: a small addition. Cause: a thread per neighbour and a fixed limit.
- All servers failed together.
- Seventeen hours, twelve of them a careful restart.
Memory trick
- Ribbons between dancers: hands hold four.
- Two small circles instead of one big ring.
Design it in
- Cells with a tested size.
- Alarms on use against each limit.
- Bounded buffers that drop.
Say carefully
- AWS did not publish the fleet size or the limit.
- The report does not call the addition the root cause.
- Optional uses are still dependencies.