How do I find the eviction rate of keys in redis?

834 Views Asked by At

My redis cluster is configured with maxmem. The eviction policy is allkeys-lru. I want to know how long the keys are lasting on average before they are evicted. Every time a key is evicted, doesn't redis capture how long it lived for?

I was looking at INFO in redis-cli and I see these keyspace metrics:

# Keyspace
db5:keys=13502644,expires=0,avg_ttl=0

However, it seems that "avg_ttl" only corresponds to keys that expire; not keys that are evicted.
The only other relevant thing I can find are total counts:

expired_keys:0
evicted_keys:17026842

Neither of these help me answer the question: How long do keys normally last before they are evicted?

0

There are 0 best solutions below