Thundering Herd After a Cache Cluster Restart
Restarting an ElastiCache cluster during low-traffic hours triggered a database overload at 3 AM when all cache misses hit simultaneously.
Overview
A routine Redis node-type change in the 3 AM window left the whole fleet with an empty cache, and the database went down under the misses for 22 minutes.
What happened
The plan was to rotate the ElastiCache Redis cluster to a new node type during the low-traffic window. The maintenance itself finished in 11 minutes. The trouble started when the application reconnected, and from there it took five minutes to go from a clean change to a database out of connections.
- 3 AM: the node-type rotation starts and runs for 11 minutes.
- 3:14 AM: the application reconnects to the new cluster, and the cache hit ratio drops from 94% to 0%.
- Within 90 s: the RDS primary is running 47x its normal query rate.
- 3:17 AM: API p99 latency reaches 8 s.
- 3:19 AM: RDS hits max_connections.
Key concepts
- Thundering herd
- Cache warming
- Request coalescing
- Probabilistic early expiry
Interview questions
- How do you safely replace an ElastiCache cluster without a thundering herd?
Sign up free to read the full topic
More War Stories topics
- Node.js Memory Leak That Required Daily Restarts
- Public S3 Bucket Exposed Customer PII for 8 Months
- Silent Data Corruption from an Off-By-One Migration
- Single-Region Dependency That Caused a Global Outage
- The Cascade That Took Down Three Services
- Third-Party API Outage That Was Mistaken for Own Code
- TLS Certificate Expiry That Took Down an Internal API
Start free on Cariara · Coding problems · System design studio