AlgoViz

The AWS outage of December 2021

medium 26 min

On 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

AWS in one RegionCustomersMain servicesmain networkNetwork devicesroom to spareInternal clientscalmInternal DNSshared pathMonitoringinternal network
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

needson 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

    critical

    Every failure adds load to the place that is already full.

    Wrong
    while True:    try: return send()    except Busy: pass
    Right
    sleep(random.uniform(0, min(60, 2 ** attempt)))
  • Retrying in every layer

    major

    Three layers with three tries turn one request into 27.

    Wrong
    gateway.tries = 3service.tries = 3driver.tries = 3
    Right
    gateway.tries = 1service.tries = 3     # one place decidesdriver.tries = 1
  • Surviving by launching

    critical

    The launch API may be what is broken.

    Wrong
    on_zone_loss: launch(new_servers)
    Right
    servers_per_zone = ceil(peak / ((zones - 1) * per_server))
  • Monitoring behind the problem

    major

    You lose the picture at the moment you need it.

    Wrong
    send(metrics, via=shared_network)
    Right
    send(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.