At a glance
Redis evicts keys when it runs out of room: onceused_memoryhitsmaxmemory, the configured eviction policy (typicallyallkeys-lruorvolatile-lru) starts deleting keys to make space for new writes. A trickle of evictions is normal on a cache. A storm, more than 1000 evicted keys per minute sustained, means Redis is shedding data faster than your application expects, and the symptoms downstream are cache misses, recomputation, and database load. For a platform or SRE team this card is the early-warning siren that an instance is memory-bound and the cache hit rate is about to collapse.
Calculation
Redis exposes a monotonic counterevicted_keys in the # Stats section of INFO. The card samples it on each poll and derives a per-minute rate from consecutive samples:
maxmemory_policy from INFO memory so the on-call engineer immediately knows which policy is doing the evicting (allkeys-lru, allkeys-lfu, volatile-lru, volatile-ttl, allkeys-random, volatile-random).
Because the counter resets to zero on restart, a delta computed across a restart boundary would be negative; the card detects the reset (current < previous) and skips that interval rather than reporting a nonsensical rate.
Worked example
A platform team runs a 4 GB Redis primary as a read-through cache for product detail and pricing, withmaxmemory 4gb and maxmemory-policy allkeys-lru. Normal eviction rate sits around 50 to 120 keys/min as cold keys age out. Snapshot taken on 22 May 26 from 19:40 to 19:55 BST during an evening traffic ramp plus a marketing email send.
At 19:50 a marketing email drove a surge of traffic to pages whose product keys had aged out, so the cache filled to its 4 GB cap and
allkeys-lru began evicting aggressively to admit the new working set. The eviction rate crossed 1000/min and stayed there.
- The working set has outgrown the cache. At the cap with sustained eviction, Redis is constantly throwing out keys that are about to be requested again. This is a thrashing pattern: evict a key, get a miss seconds later, refetch from the database, re-cache it, evict something else. The hit rate falling from 97% to 88% is the visible cost.
- The database is absorbing the misses. Every percentage point of hit-rate loss on a busy cache can mean thousands of extra queries per minute hitting the primary database. A storm here often shows up as elevated DB CPU and slow queries minutes later.
- The fix is capacity or TTL, not a Redis restart. Restarting would only clear the counter and reset the symptom. The durable fixes are: raise
maxmemory(or scale the node/shard), shorten TTLs on low-value keys so they expire before they have to be evicted, or move large rarely-read values out of the cache.
- Eviction is not the disease, it is the fever. The storm tells you memory pressure has hit the cap; the cure is more room or a smaller working set, not silencing the alert.
- Read evictions with hit rate, always. Evictions only hurt when they cause misses. Pair this card with Keyspace Hit Rate %: a storm with a stable hit rate means you are evicting genuinely cold keys (fine); a storm with a falling hit rate means thrashing (act now).
- Distinguish evicted from expired. A high
expired_keysrate is healthy TTL housekeeping; a highevicted_keysrate is memory pressure. They look similar on a key-count chart but mean opposite things.
Sibling cards to read alongside this one
Reconciling against the source
Where to look in Redis itself:Why our number may legitimately differ from a raw counter read:INFO statsreports the cumulativeevicted_keyscounter. Sample it twice a minute apart and divide to get the rate:redis-cli INFO stats | grep evicted_keys.INFO memoryconfirmsmaxmemory,used_memory, and the activemaxmemory_policyso you know the cap and the eviction strategy.redis-cli --bigkeysscans for the largest keys, the usual culprits behind sudden memory pressure.MEMORY STATSandMEMORY USAGE <key>break down where the memory is going at the data-structure level.
Managed-service note: AWS ElastiCache surfaces an
Evictions CloudWatch metric per node; Azure Cache for Redis exposes Evicted Keys in Azure Monitor; Redis Cloud shows evictions in its metrics panel. Reconcile our per-minute rate against those: CloudWatch’s Evictions is typically a per-minute sum already, so it should align closely with our headline for the same node. If they diverge, check that you are comparing the same shard and the same minute boundary.
Known limitations / FAQs
My eviction rate is high but my hit rate is fine. Should I worry? Less so. A high eviction rate with a stable, high hit rate means Redis is correctly evicting genuinely cold keys to admit a hot working set, the cache is doing its job. The dangerous pattern is a high eviction rate alongside a falling hit rate, which signals thrashing: you are evicting keys you are about to need again. Always read this card next to Keyspace Hit Rate %. What is the difference between evicted and expired keys? Expired keys are removed because their TTL elapsed, this is intentional, healthy housekeeping. Evicted keys are removed under memory pressure because Redis hitmaxmemory, regardless of whether they still had time to live. A storm of expirations is normal; a storm of evictions means you are out of room. They are reported as separate counters and on separate cards.
I set maxmemory-policy noeviction. Why does this card stay quiet during memory pressure?
With noeviction, Redis does not evict at all, it refuses write commands with an OOM command not allowed error once at the cap. So evicted_keys stays flat and this card stays silent even though the instance is in trouble. For noeviction setups, monitor Memory Used vs Maxmemory % and the error cards instead; a quiet eviction card is not the same as a healthy instance.
A bulk import spiked evictions for thirty seconds but no alert fired. Why?
By design. The card requires the rate to stay above 1000/min across a rolling 5-minute window, so a short burst from a one-off bulk load or cache warm-up is filtered out. This prevents routine maintenance from paging the on-call. A genuine storm sustains the rate; a bulk job tails off.
Will raising maxmemory stop the storm permanently?
It stops it until the working set grows to fill the new ceiling. Raising maxmemory buys headroom and is the right immediate mitigation, but if the working set keeps growing you will be back at the cap. The durable fixes are shorter TTLs on low-value keys, moving large blobs out of the cache, and right-sizing the node or adding shards. Treat a capacity bump as breathing room, not a cure.
Does an eviction storm cause data loss?
For a pure cache, no, evicted keys can be refetched from the source of truth (slowly, hence the database load). But if you store anything in Redis that is not backed elsewhere (sessions, rate-limit counters, queues) under an allkeys-* policy, those can be evicted and genuinely lost. Use volatile-* policies and set TTLs only on disposable keys, so non-disposable data is never an eviction candidate.
On a cluster, the per-shard rates look uneven. Is that a problem?
Often, yes, it points to a hot shard. If one shard evicts heavily while others are calm, your key distribution is skewed (a few hot key prefixes hashing to the same slots, or a large key on one shard). Use Cluster Slots Assigned (of 16384) and redis-cli --bigkeys per node to find the imbalance. The card reports the worst shard so the hot one surfaces first.