Linux – What happens to redis when your server runs out of free RAM

databaselinuxmemoryredisunix

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?

Best Answer

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.