Skip to content
All concepts

Concept

Cache stampede

A cache stampede happens when a popular cached value expires and every request that arrives during the rebuild misses the cache. All of them run the same expensive query at once, which slows the rebuild and lets even more requests pile in. The usual fix is to let one request rebuild the value while the others wait or take a slightly stale copy.

Watch the hot key expire: every request misses together and the database fills up. A live step from the lesson Cache stampede (Redis / caching). Timings and counts are illustrative.

Where you'll see it

Sources: Scaling Memcache at Facebook (NSDI '13) ↗ · Facebook outage, 2010 ↗ · Report a problem

The definition is in our own words; the sources are those of the lesson Cache stampede.