This topic describes the eviction policy of ApsaraDB for Redis.
By default, an ApsaraDB for Redis instance evicts data by using the volatile-lru policy. To modify the eviction policy, log on to the ApsaraDB for Redis console, click the specific instance ID on the Instances page to go to the Instance Information page, and then click System Parameters in the left-side navigation pane.
The system only evicts data that has Time To Live (TTL) configured based on the Least Recently Used (LRU) algorithm.
The system only evicts data that has TTL configured, and evicts the data 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 only evicts 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.