提交 7d0966a6 编写于 作者: A antirez

Do not update the LRU info on key lookup when we have a saving child. With...

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.
上级 3ce014c7
...@@ -11,7 +11,10 @@ robj *lookupKey(redisDb *db, robj *key) { ...@@ -11,7 +11,10 @@ robj *lookupKey(redisDb *db, robj *key) {
if (de) { if (de) {
robj *val = dictGetEntryVal(de); robj *val = dictGetEntryVal(de);
/* Update the access time for the aging algorithm. */ /* 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; val->lru = server.lruclock;
if (server.vm_enabled) { if (server.vm_enabled) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册