Redis Key 过期策略

redis 官方提供的 conf

https://raw.github.com/antirez/redis/2.2/redis.conf

中6中过期策略的具体方式。
redis 中的默认的过期策略是volatile-lru 。设置方式   

config set maxmemory-policy volatile-lru



maxmemory-policy 六种方式

    1. volatile-lru:只对设置了过期时间的key进行LRU(默认值) 
    2. allkeys-lru : 删除lru算法的key   
    3. volatile-random:随机删除即将过期key   
    4. allkeys-random:随机删除   
    5. volatile-ttl : 删除即将过期的   
    6. noeviction : 永不过期,返回错误 
原文地址:https://www.cnblogs.com/rainy-shurun/p/5145779.html