1

In redis 2.4 the vm-enabled no is the default, so I am using redis as database (not cache), and maybe occasionally the db size is larger than the memory, should I enable it?

Or should I enfore maxmemory to prevent data loss?

1 Answer 1

1

http://redis.io/topics/faq

What happens if Redis runs out of memory?

With modern operating systems malloc() returning NULL is not common, usually the server will start swapping and Redis performances will degrade so you'll probably notice there is something wrong. The INFO command will report the amount of memory Redis is using so you can write scripts that monitor your Redis servers checking for critical conditions. Alternatively can use the "maxmemory" option in the config file to put a limit to the memory Redis can use. If this limit is reached Redis will start to reply with an error to write commands (but will continue to accept read-only commands), or you can configure it to evict keys when the max memory limit is reached in the case you are using Redis for caching.

Don't do anything...? At worst you get a serious performance degradation from swapping but that's it? You have error handling in your application anyways, don't you?

2
  • So just leave the default, and enabled a decent SWAP partition on my Linux seems to be a good fit?
    – Ryan
    Sep 28, 2012 at 3:58
  • That's what the manual suggests, yes.
    – chx
    Sep 28, 2012 at 5:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .