Search code examples
redis

Does redis evict subkeys from a map on reaching max memory limit?


On reaching the memory limit does redis evict keys or subkeys ( as in case of maps )?

How is the behavior prior to Redis 7.4 and 7.4+? Redis 7.4 added support for HEXPIRE. Can someone let me know if I have set eviction policy to volatile-lru, then will Redis remove subkeys from Map (where TTL is set for a map entry via HEXPIRE) when memory limit is breached. How is this going to behave in Redis 7.4 with allkeys-lru?


Solution

  • Eviction and expiration are two different things.

    Redis never evicts sub-keys (set members, hash fields, or list elements). The added support for hash field expiration doesn't change anything in this regard.