Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find the last access time of a redis key?

Tags:

redis

In redis, two of the eviction policies, allkeys-lru and volatile-lru, evict keys based on access time. So, this information must exist somewhere. Is it possible for me to query the access time of a key? Or, better yet, page through a sorted list of keys based on access time?

like image 846
John Bachir Avatar asked Oct 17 '25 08:10

John Bachir


1 Answers

Look at Object IDLETIME it gives time for which the object was idle

as guided by @Itamar Haber the way they disable some command is by using redis.conf

# It is also possible to completely kill a command by renaming it into
# an empty string:
#
rename-command FLUSHDB ""
rename-command FLUSHALL ""
rename-command DEBUG ""

As you are using Redis as a service on Heroku you have to have admin rights to do this Hope this helps!

like image 180
Amit_Hora Avatar answered Oct 21 '25 11:10

Amit_Hora



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!