The night the cache fell over

Northwind · Incident review

A postmortem of the 2:14am Redis outage

Timeline

All times local, night of the incident

The request path

Where a read goes — and where it went that night

Client Load balancer API Redis read Postgres on miss

p99 latency during the outage

API read endpoints, milliseconds

The fix

One thing that night, three things since

That night

  • Shed cache-miss reads at the API with a feature flag
  • Let the replica warm, then ramp traffic back

Since then

  • Single-flight fills: one DB query per missing key
  • Circuit breaker in front of Postgres
  • Memory headroom alert at 75% of maxmemory

What 2:14am taught us

  1. A cache is a dependency. Size what's behind it for the day it's empty.
  2. Failover isn't recovery. A cold replica is up, not ready: ours took 31 minutes to warm.
  3. Alert on headroom, not on death. Memory told us hours before it killed us.