summaryrefslogtreecommitdiff
path: root/proto_text.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 /proto_text.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 'proto_text.c')
-rw-r--r--proto_text.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/proto_text.c b/proto_text.c
index d794514..6885786 100644
--- a/proto_text.c
+++ b/proto_text.c
@@ -2410,7 +2410,7 @@ static void process_extstore_command(conn *c, token_t *tokens, const size_t ntok
if (ntokens < 4) {
ok = false;
} else if (strcmp(tokens[1].value, "free_memchunks") == 0 && ntokens > 4) {
- /* per-slab-class free chunk setting. */
+ // setting is deprecated and ignored, but accepted for backcompat
unsigned int clsid = 0;
unsigned int limit = 0;
if (!safe_strtoul(tokens[2].value, &clsid) ||
@@ -2418,7 +2418,7 @@ static void process_extstore_command(conn *c, token_t *tokens, const size_t ntok
ok = false;
} else {
if (clsid < MAX_NUMBER_OF_SLAB_CLASSES) {
- settings.ext_free_memchunks[clsid] = limit;
+ ok = true;
} else {
ok = false;
}