From e029c40fdb2e1578bba3832e249879ea13d133da Mon Sep 17 00:00:00 2001 From: Alex Cope Date: Wed, 28 Jun 2023 23:19:34 -0700 Subject: [PATCH] revert --- keydb.conf | 5 ++--- src/evict.cpp | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/keydb.conf b/keydb.conf index 8fa711c1f..1a006fcd3 100644 --- a/keydb.conf +++ b/keydb.conf @@ -1145,9 +1145,8 @@ acllog-max-len 128 # # active-expire-effort 1 -# Force evictions when remaining total system memory reaches this percent. -# System memory is measured against RSS memory, not used memory. This is -# useful as a safeguard to prevent OOM kills when RSS overhead is +# Force evictions when RSS memory reaches this percent of total system memory. +# This is useful as a safeguard to prevent OOM kills when RSS overhead is # significant (0 to disable). # # force-eviction-percent 0 diff --git a/src/evict.cpp b/src/evict.cpp index 2aa9337a2..f4edb86fd 100644 --- a/src/evict.cpp +++ b/src/evict.cpp @@ -425,10 +425,10 @@ int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *lev if (g_pserver->FRdbSaveInProgress()) maxmemory = static_cast(maxmemory*1.2); - /* If there is less than a configurable percent of free system memory, force eviction */ + /* If rss memory exceeds configurable percent of system memory, force eviction */ bool mem_rss_max_exceeded; if (g_pserver->force_eviction_percent && g_pserver->cron_malloc_stats.sys_total) { - float sys_total_ratio = (float)(100 - g_pserver->force_eviction_percent)/100; + float sys_total_ratio = (float)(g_pserver->force_eviction_percent)/100; size_t mem_rss_max = static_cast(g_pserver->cron_malloc_stats.sys_total * sys_total_ratio); mem_rss_max_exceeded = g_pserver->cron_malloc_stats.process_rss > mem_rss_max; if (mem_rss_max_exceeded) {