{
  "id": "eviction-policy",
  "title": "Eviction policy",
  "url": "https://redis.io/docs/latest/operate/rs/7.8/databases/memory-performance/eviction-policy/",
  "summary": "The eviction policy determines what happens when a database reaches its memory limit.",
  "content": "\nThe eviction policy determines what happens when a database reaches its memory limit.  \n\nTo make room for new data, older data is _evicted_ (removed) according to the selected policy.\n\nTo prevent this from happening, make sure your database is large enough to hold all desired keys.  \n\n| **Eviction\u0026nbsp;Policy** | **Description** |\n|------------|-----------------|\n|  noeviction | New values aren't saved when memory limit is reached\u003cbr/\u003e\u003cbr/\u003eWhen a database uses replication, this applies to the primary database |\n|  allkeys-lru | Keeps most recently used keys; removes least recently used (LRU) keys |\n|  allkeys-lfu | Keeps frequently used keys; removes least frequently used (LFU) keys |\n|  allkeys-random | Randomly removes keys |\n|  volatile-lru | Removes least recently used keys with `expire` field set to true |\n|  volatile-lfu | Removes least frequently used keys with `expire` field set to true |\n|  volatile-random | Randomly removes keys with `expire` field set to true |\n|  volatile-ttl | Removes keys with `expire` field set to true and the shortest remaining time-to-live (TTL) value |\n\n## Eviction policy defaults\n\n`volatile-lru` is the default eviction policy for most databases.\n\nThe default policy for [Active-Active databases]() is _noeviction_ policy.\n\n## Active-Active database eviction\n\nThe eviction policy mechanism for Active-Active databases kicks in earlier than for standalone databases because it requires propagation to all participating clusters. \nThe eviction policy starts to evict keys when one of the Active-Active instances reaches 80% of its memory limit. If memory usage continues to rise while the keys are being evicted, the rate of eviction will increase to prevent reaching the Out-of-Memory state.\nAs with standalone Redis Enterprise databases, Active-Active eviction is calculated per shard.\nTo prevent over eviction, internal heuristics might prevent keys from being evicted when the shard reaches the 80% memory limit.  In such cases, keys will get evicted only when shard memory reaches 100%.\n\nIn case of network issues between Active-Active instances, memory can be freed only when all instances are in sync. If there is no communication between participating clusters, it can result in eviction of all keys and the instance reaching an Out-of-Memory state.\n\n\nData eviction policies are not supported for Active-Active databases with Auto Tiering .\n\n\n## Avoid data eviction\n\nTo avoid data eviction, make sure your database is large enough to hold required values.  \n\nFor larger databases, consider using [Auto Tiering ]().\n\nAuto Tiering stores actively-used data (also known as _hot data_) in RAM and the remaining data in flash memory (SSD).\nThis lets you retain more data while ensuring the fastest access to the most critical data.\n",
  "tags": ["docs","operate","rs","kubernetes"],
  "last_updated": "2026-04-01T08:10:08-05:00"
}

