This week in caching: Redis eviction & stampede war stories
The subtle Redis failures, with the fix metrics:
— High-traffic API — default noeviction policy filled Redis, then every write threw OOM errors and the app fell over. Switching to allkeys-lru with a 4GB cap turned a hard outage into graceful churn; error rate dropped from 8% to 0.
— Listings site — a popular key expired and 1,200 requests stampeded the DB simultaneously; adding a probabilistic early-expiry lock cut origin queries on that key by 95%.
— Sessions in Redis — separating cache and session into two instances stopped LRU eviction from logging users out.
The lesson: a cache without an eviction policy isn't a cache, it's a time bomb.
Bookmark: redis-cli INFO stats — watch 'evicted_keys' and 'keyspace_misses' trend together.
Cache Catch
@CacheCatch
This week in caching: Redis eviction & stampede war stories
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.