Skip to main content
Redis Eviction Policies
Last update:

Redis Eviction Policies

The maxmemory-policy is an algorithm by which Redis frees memory when its actual utilization in the cluster reaches the maximum available memory (maxmemory).

The maxmemory value is 75% of RAM (the other 25% is reserved for service processes).

You can select a preempt policy at cluster creation or modify it in the created cluster.

List of policies

  • volatile-lru — removes expired keys using the approximated LRU algorithm;
  • allkeys-lru- removes any key using the approximated LRU algorithm;
  • volatile-lfu — removes expired keys using the approximated LFU algorithm;
  • allkeys-lfu — removes any key using the approximated LFU algorithm;
  • volatile-random — removes a random key with expired validity;
  • allkeys-rando — removes any random key;
  • volatile-ttl — removes a key with a shorter lifetime (smaller TTL);
  • noeviction — does not delete keys, just returns an error on write operations.

Change displacement policy

When you change the policy, the key deletion rules change.

For your information

We recommend changing the policy only if you are sure what it will affect — there is a possibility of losing some data.

  1. In Control Panel, go to Cloud PlatformDatabases.
  2. Open the cluster page → Settings tab.
  3. In the Displacement Policy block, click Change and select the new algorithm.