This topic describes the eviction policies of ApsaraDB for Redis.
By default, an ApsaraDB for Redis instance evicts data by using the volatile-lru policy. To modify the eviction policy for an instance, log on to the ApsaraDB for Redis console, click the instance ID on the Instances page to go to the Instance Information page, and then click System Parameters in the left-side navigation pane. For more information, see Modify parameters of an instance.
-
volatile-lru
The system evicts only data that has time to live (TTL) configured based on the least recently used (LRU) algorithm.
-
volatile-ttl
The system evicts only data that has TTL configured, and the data is evicted in ascending order of TTL.
-
allkeys-lru
The system evicts data based on the LRU algorithm.
-
volatile-random
The system only randomly evicts data that has TTL configured.
-
allkeys-random
The system randomly evicts data.
-
noeviction
No data is evicted, and an error message is returned if new data is written when the memory is full (except DEL and some other commands).
-
volatile-lfu
The system evicts only the least frequently used keys that have TTL configured based on the Least Frequently Used (LFU) algorithm. -
allkeys-lfu
The system evicts the least frequently used keys based on the LFU algorithm.