Back to results for “Monitoring”
Redis › Expiration & Eviction

How do you monitor how many keys are currently being evicted from Redis due to memory pressure, and why is this an important metric to track?

Intermediate

Answer

You check the evicted_keys statistic available through the INFO command, and a consistently rising number of evictions can indicate your Redis instance does not have enough memory for your workload, which is important to monitor since unexpected evictions of data your application still needs can lead to increased load on your backing database or degraded user experience.
redis-cli info stats | grep evicted_keys
Real-world example A team notices a steadily increasing eviction count in their monitoring dashboard, prompting them to either increase their Redis instance's available memory or investigate why so much data is being stored that does not truly need to remain cached.

Common follow-ups: What is a healthy or expected eviction rate for a typical caching workload?;How do you set up an alert for when evictions start increasing unexpectedly?