summaryrefslogtreecommitdiff
path: root/items.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2022-08-18 23:03:54 -0700
committerdormando <dormando@rydia.net>2022-08-25 20:43:32 -0700
commit3d6d74a340c3eb27777f96937bead823b4901753 (patch)
tree310cde0318f3e6afb8fa4e36704ab3a5bcb4556d /items.c
parenta102df4554e18c8733331f61a1285dd6f6ff4d39 (diff)
downloadmemcached-3d6d74a340c3eb27777f96937bead823b4901753.tar.gz
extstore: make defaults more aggressive
extstore has a background thread which examines slab classes for items to flush to disk. The thresholds for flushing to disk are managed by a specialized "slab automove" algorithm. This algorithm was written in 2017 and not tuned since. Most serious users set "ext_item_age=0" and force flush all items. This is partially because the defaults do not flush aggressively enough, which causes memory to run out and evictions to happen. This change simplifies the slab automove portion. Instead of balancing free chunks of memory per slab class, it sets a target of a certain number of free global pages. The extstore flusher thread also uses the page pool and some low chunk limits to decide when to start flushing. Its sleep routines have also been adjusted as it could oversleep too easily. A few other small changes were required to avoid over-moving slab pages around.
Diffstat (limited to 'items.c')
-rw-r--r--items.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/items.c b/items.c
index e5347cc..9cee07e 100644
--- a/items.c
+++ b/items.c
@@ -1669,13 +1669,7 @@ static void *lru_maintainer_thread(void *arg) {
LOGGER_LOG(l, LOG_SYSEVENTS, LOGGER_SLAB_MOVE, NULL,
src, dst);
}
- // dst == 0 means reclaim to global pool, be more aggressive
- if (dst != 0) {
- last_automove_check = current_time;
- } else if (dst == 0) {
- // also ensure we minimize the thread sleep
- to_sleep = 1000;
- }
+ last_automove_check = current_time;
}
}
pthread_mutex_unlock(&lru_maintainer_lock);