Find hot keys (--hotkeys, OBJECT FREQ)
RedisPerformanceCommand
# Requires an LFU-based policy; note the current policy:
CONFIG GET maxmemory-policy
CONFIG SET maxmemory-policy allkeys-lfu
# Hottest keys by access frequency:
redis-cli -h redis1 -p 6379 --hotkeys -i 0.01
# LFU counter of a single key:
OBJECT FREQ urun:populer:liste
# Revert to the previous policy when the analysis is done:
CONFIG SET maxmemory-policy noevictionWhat it does
Lists the most frequently accessed keys using LFU counters; shows the access frequency counter of a single key.
When to use it
When one node's CPU approaches 100%, a slot/node in a cluster receives far more traffic than the others, or network bandwidth is saturated by a single key.
Caution
--hotkeys only works when maxmemory-policy is *-lfu. Changing the policy also changes eviction behavior: if maxmemory is set and the previous policy was volatile-* or noeviction, allkeys-lfu can also evict keys without a TTL. Keep the analysis short and revert the policy. LFU counters are logarithmic and decay over time; they are not absolute access counts.