Redis Eviction Policies
An eviction policy is a rule that Redis uses to evict keys to free up memory when its consumption reaches the set limit. For more information about eviction policies, see the Key eviction guide in the Redis documentation.
You can view the list of eviction policies.
You can select an eviction policy when creating a cluster or change it in an existing cluster.
Memory limit for key storage
The memory limit for storing keys is specified in the maxmemory parameter. The default maxmemory value is 75% of RAM on the cluster node. The remaining 25% is reserved for Redis internal mechanisms.
You can change the maxmemory value only in Redis version 8:
- when creating a cluster;
- or when changing the eviction policy in an existing cluster.
You can change this value within the range of 1% to 75%. If you set a value lower than 75%, the remaining memory can be used by Redis internal mechanisms.
List of eviction policies
Change the Eviction policy
We recommend changing the policy only if you are sure about the consequences — there is a possibility of partial data loss.
Redis 6
Redis 8
- In the control panel, in the top menu, click Products and select Cloud Databases.
- In the Databases section, open the Active tab.
- Open the cluster page → Settings tab.
- In the Eviction Policy block, click Edit.
- In the Maxmemory Policy field, select an eviction policy.
- Click Save.