Better bgrewritebuf allocation behavior #476

yossigo opened this Issue Apr 23, 2012 · 0 comments


None yet
1 participant

yossigo commented Apr 23, 2012

There is currently no control over the growth of bgrewritebuf, and in some cases I've seen this lead to out-of-memory crashes (e.g., large redis DB which leads to long-running rewrite while high volume write traffic takes place).

Without AOF this wouldn't be a problem as eviction would take care of it, but once AOF is enabled the server suddenly crashes with OOM. I see two choices here:

  1. The simple/dumb way - config a hard limit to bgrewritebuf, and refuse new writes once it is exceeded (like maxmemory with no eviction candidates).
  2. The smarter way - apply maxmemory checks and eviction when growing the bgrewritebuf (which will probably also require to the rate at which it grows, due to sdsMakeRoomFor() doubling its size forever).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment