Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis ignores maxmemory setting

Tags:

memory

redis

Redis has the following settings:

"config get maxmemory"

1) "maxmemory"
2) "2147483648"

(which is 2G)

But when I do "info"

used_memory:6264349904
used_memory_human:5.83G
used_memory_rss:6864515072

Clearly it ignores all the settings... Why?

P.S.

"config get maxmemory-policy" shows:

1) "maxmemory-policy" 
2) "volatile-ttl" 

and: "config get maxmemory-samples" shows:

1) "maxmemory-samples" 
2) "3" 

What means, they should expire keys with the nearest expiration date...

like image 613
alexeypro Avatar asked Nov 04 '22 13:11

alexeypro


1 Answers

Do you have expiration settings on all your keys? volatile-ttl will only remove keys with an expiration set. This should be in your info output.

If you don't have expiration ttls set try allkeys-lru or allkeys-random for your policy.

like image 193
John Eikenberry Avatar answered Nov 09 '22 14:11

John Eikenberry