背景
策略
volatile-lru(least recently used)
volatile-lfu(least frequently used)
volatile-ttl
volatile-random
allkeys-lru
allkeys-lfu
allkeys-random
noeviction
config配置的时候下划线_的key需要用中横线-
127.0.0.1:6379> config set maxmemory_policy volatile-lru
(error) ERR Unsupported CONFIG parameter: maxmemory_policy
127.0.0.1:6379> config set maxmemory-policy volatile-lru
OK
原文:https://www.cnblogs.com/Gen2021/p/15076972.html