Capability of locking its database in-memory(No Swapping etc) #1177

jitendra908 opened this Issue Jul 3, 2013 · 4 comments


None yet
5 participants


Most people prefer in-memory databases because they are faster. These in-memory databases lose their power when they get involved in disk operations(Swapping etc).
As Redis is in-memory database, I strongly feel that Redis should have a capability of locking its database in-memory(No Swapping etc).

So please plan the capability of locking its database in-memory in future release of Redis.


Hi Antirez,

I also strongly feel that there should be some feature in redis to lock its pages into RAM instead of swapping out.
Without this feature people has to debug redis a lot because of less RAM issues of system. At least low RAM problems will not hit redis.

Anurag Berdia


Though while waiting for this to be implemented, what we can do for now is to disable swap altogether and keep our RAM supply as large as possible. I'm not quite sure if memory lock is supported on all systems.

+1 I'm stuck with some smaller servers and even with a low "swappiness" setting, end up with memory issues sometimes. I lock memcache's memory which solves the problem there, but would love it on redis as well...

You are talking about the use of the mlock right?
It is not a solution, but you can occasionally do a swapoff -a && swapon -a to dump swapped memory back into RAM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment