Redis 提供 6 種數據淘汰策略(即,內存淘汰策略)
- volatile-lru:從已設置過期時間的數據集(server.db[i].expires)中挑選最近最少使用 的數據淘汰
- volatile-ttl:從已設置過期時間的數據集(server.db[i].expires)中挑選將要過期的數 據淘汰
- volatile-random:從已設置過期時間的數據集(server.db[i].expires)中任意選擇數據 淘汰
- allkeys-lru:從數據集(server.db[i].dict)中挑選最近最少使用的數據淘汰
- allkeys-random:從數據集(server.db[i].dict)中任意選擇數據淘汰
- no-enviction(驅逐):禁止驅逐數據