Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say you're hosting redis on a small server with little RAM.

What happens if there's too much data, and all the RAM gets used up?

Does redis die? Or does it continue operating?

share|improve this question
up vote 1 down vote accepted

First, it will try to move some less-used data out of RAM and into swap file space (if you have any). After that the OOM (Out Of Memory) killer will start finding processes that look less important based on some set of generic rules and kill them off so that the system can survive. If that fails, eventually the system will just sort of jam. Also, it things can go haywire if the OOM killer decides to kill something important to you or the function of the machine.

share|improve this answer
Does Redis start writing to disk? – Alex May 16 '11 at 1:20
@Alex: I'm not sure what you're asking. – Caleb May 17 '11 at 15:11
@Alex - you should read the links I included in my response. While Caleb's answer is correct for an OOM condition in Linux, redis can manage its own virtual memory. – JimB May 17 '11 at 15:47
The method described above will only work if you have set the MaxMemory directive in the config and are not using no-eviction along with it. – s1d Jul 16 '13 at 7:43

Depends on how you configure it. You can always use ulimit to limit the resources available to the redis process, but you should look into how redis uses memory in the first place.

You can configure redis to limit the amount of ram it will use before moving to its swap file.

Here's a blog posting about how virtual memory works in redis.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.