summaryrefslogtreecommitdiff
path: root/memcached.h
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 /memcached.h
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 'memcached.h')
-rw-r--r--memcached.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/memcached.h b/memcached.h
index ba495d3..5f517f2 100644
--- a/memcached.h
+++ b/memcached.h
@@ -507,8 +507,8 @@ struct settings {
double ext_max_frag; /* ideal maximum page fragmentation */
double slab_automove_freeratio; /* % of memory to hold free as buffer */
bool ext_drop_unread; /* skip unread items during compaction */
- /* per-slab-class free chunk limit */
- unsigned int ext_free_memchunks[MAX_NUMBER_OF_SLAB_CLASSES];
+ /* start flushing to extstore after memory below this */
+ unsigned int ext_global_pool_min;
#endif
#ifdef TLS
bool ssl_enabled; /* indicates whether SSL is enabled */