Search code examples
cachingredisamazon-elasticache

Will Redis maxmemory-policy volatile-lru evict if nothing is past expired date?


I've a redis server set with a maxmemory-policy set to volatile-lru. The documentation indicate this will evict from the set of entries with expires set when memory limit has reached.

In this case, does redis only evict items past their expiration? If everything in memory has an expire set, but nothing is past the expiration time, will anything get evicted when max memory is reached?


Solution

  • If your eviction policy is set to any of the volatile-* policies, when running out of memory and having no volatile keys to evict, Redis will return an OOM error.