Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Redis from saving to disc

I'm building a Redis db which consumes nearly all of my machines memory. If Redis startes to save to disc while heavy inserting is going on, the memory consumption is more or less doubled (as described in the documentation). This leads to terrible performance in my case.

I would like to force Redis to not to store any data while I'm inserting and would trigger the save manually afterwards. That should solve my problem, but however I configure the "save" setting, at some point in time Redis starts to save to disc. Any hint how to prevent Redis from doing so?

like image 550
Achim Avatar asked Aug 21 '12 06:08

Achim


2 Answers

You can disable saving by commenting all the "save" lines" in your redis.conf.

like image 123
Sripathi Krishnan Avatar answered Sep 28 '22 11:09

Sripathi Krishnan


Alternately, if you don't want to edit any .conf files, run Redis with:

redis-server --save ""

As per example config (search for save):

It is also possible to remove all the previously configured save
points by adding a save directive with a single empty string argument
like in the following example:

save ""
like image 23
Sljux Avatar answered Sep 28 '22 11:09

Sljux