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.
The system evicts only data that has time to live (TTL) configured based on the least recently used (LRU) algorithm.
The system evicts only data that has TTL configured, and the data is evicted in ascending order of TTL.
The system evicts data based on the LRU algorithm.
The system only randomly evicts data that has TTL configured.
The system randomly evicts data.
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-lfuThe system evicts only the least frequently used keys that have TTL configured based on the Least Frequently Used (LFU) algorithm.
allkeys-lfuThe system evicts the least frequently used keys based on the LFU algorithm.