mirror of
https://github.com/fluencelabs/redis
synced 2025-03-18 16:40:50 +00:00
Do not update the LRU info on key lookup when we have a saving child. With this trivial change the additional memory used while saving with a background child in presence of many read operations is zero.
This commit is contained in:
parent
3ce014c766
commit
7d0966a6b7
7
src/db.c
7
src/db.c
@ -11,8 +11,11 @@ robj *lookupKey(redisDb *db, robj *key) {
|
||||
if (de) {
|
||||
robj *val = dictGetEntryVal(de);
|
||||
|
||||
/* Update the access time for the aging algorithm. */
|
||||
val->lru = server.lruclock;
|
||||
/* Update the access time for the aging algorithm.
|
||||
* Don't do it if we have a saving child, as this will trigger
|
||||
* a copy on write madness. */
|
||||
if (server.bgsavechildpid == -1 && server.bgrewritechildpid == -1)
|
||||
val->lru = server.lruclock;
|
||||
|
||||
if (server.vm_enabled) {
|
||||
if (val->storage == REDIS_VM_MEMORY ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user