Questions about maxmemory, PERSIST, EXPIRE, Eviction Policy, Expirations #4310
wernermorgenstern
started this conversation in
General
Replies: 1 comment
-
@romange , not sure if you can help with that please. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So, I have a discussion with a coworker about how DragonFly is handling Evictions and expirations.
I want to get clarification on how DragonFly handles those.
We are using DragonFly in AWS EKS.
We have Cache Mode enabled.
We have some keys which we want to expire, and we use the
EXPIRE
command to set the expiration.Some keys we never want to expire, and for those, we execute the
PERSIST
command.Now for the two different scenarios.
maxmemory=0
is used.This means that DragonFly will see how much memory is available, and allocate that memory.
maxmemory=2gb
(for example, 2gb)This means that we set the Maximum Memory explicitly to a value.
So here is my question.
If we reach Maximum Memory in the keys being used (OOM), how are keys expired and evicted?
If
maxmemory=0
, will keys still be evicted, even if the keys are not expired yet?Or will it only be done, when
maxmemory=VALUE
is being used?We want to know, if we want to have a similar behaviour what Redis has for
volatile-ttl
, how do we need to configure DragonFly?The way Redis does it, even if there are keys, where the expiration has not been reached yet, but we are reaching an OOM situation, it will evict keys which have the shortest/closed remaining TTL value.
The discussion I have with my coworker, is that when we use
maxmemory=0
, then the evictions will not take place.Beta Was this translation helpful? Give feedback.
All reactions