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.

  • volatile-lru

    The system only evicts data that has Time To Live (TTL) configured based on the Least Recently Used (LRU) algorithm.

  • volatile-ttl

    The system only evicts data that has TTL configured, and evicts the data 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 only evicts 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.