redis淘汰策略

发布时间 2024-01-02 22:33:25作者: 曹伟666

lru是Least Recently Used的缩写,也就是「最近很少使用」

LFU:Least Frequently Used的缩写,也就是最近使用频次最少

# volatile-lru -> Evict using approximated LRU among the keys with an expire set.
# allkeys-lru -> Evict any key using approximated LRU.
# volatile-lfu -> Evict using approximated LFU among the keys with an expire set.
# allkeys-lfu -> Evict any key using approximated LFU.
# volatile-random -> Remove a random key among the ones with an expire set.
# allkeys-random -> Remove a random key, any key.
# volatile-ttl -> 淘汰过期时间最短的数据
# noeviction -> 不淘汰任何数据,直接抛出异常