Redis淘汰策略

redis基于内存结构进行数据缓存,当内存消耗完时,需要进行数据释放,淘汰策略即使数据释放策略

# 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 -> Remove the key with the nearest expire time (minor TTL)
# noeviction -> Don't evict anything, just return an error on write operations.

image

原文地址:https://www.cnblogs.com/whyblogs/p/15074296.html