]> git.saurik.com Git - redis.git/commit
More incremental active expired keys collection process.
authorantirez <antirez@gmail.com>
Fri, 11 May 2012 17:17:31 +0000 (19:17 +0200)
committerantirez <antirez@gmail.com>
Fri, 11 May 2012 17:17:31 +0000 (19:17 +0200)
commit1dcc95d08105167a3a69acc4fd8d3bb725a5ac8f
treee468055b8a0656559984624dec58b6282b681641
parent27737964c40716d61321cb0101d5ddb641298fff
More incremental active expired keys collection process.

If a large amonut of keys are all expiring about at the same time, the
"active" expired keys collection cycle used to block as far as the
percentage of already expired keys was >= 25% of the total population of
keys with an expire set.

This could block the server even for many seconds in order to reclaim
memory ASAP. The new algorithm uses at max a small amount of
milliseconds per cycle, even if this means reclaiming the memory less
promptly it also means a more responsive server.
src/redis.c
src/redis.h