RedisInsight Memory Analysis

I’ve been using Redis Insight for quite a while now, as it’s a great tool to check our Redis and Elasticache clusters, and debug possible misuses. What I wanted to know is what criteria is used to classify a key as “Already Expired” when doing a memory analyse from a backup. Does the function check the TTL in the key against the actual time the memory analysis is run? What about the elapsed time between the memory analysis is started until it finishes?
From Redis Documentation, EXPIRE command uses a unix timestamp so my understanding is that if I’m analysing a file from two hours ago, and all the keys have a TTL set of 5s, if no key is altered between the start of the backup and the time of the memory analysis, all keys will be considered “Already Expired”. Is this right?

Hi @wpirraglia,

You are right. Memory analysis works by taking a snapshot of the db and analysis the data in it. So while taking the snapshot there were few keys in the data but are expired.

The snapshot data does contain both key and its TTL value. And if the TTL value itself is -2, its already expired.

Thanks @gnanesh for the clarification! I’ve been debugging our cluster usage using a backup, but will need to play around with the datetime to have a better picture of what’s going on.