summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2017-12-06 11:22:23 -0800
committerdormando <dormando@rydia.net>2017-12-06 11:22:23 -0800
commitbb1080bb9f8ab5271699bb84eb90de1fcf9ed695 (patch)
tree1825e2f2a5cfb9b1bd8fc336eb16b5670e8e3e24 /scripts
parentbf8a7b4af951f48ebfdf135d39c8a4abfd1f3a24 (diff)
downloadmemcached-bb1080bb9f8ab5271699bb84eb90de1fcf9ed695.tar.gz
extstore: fix min free chunks in automove script
need to hold at least 1.5 pages free so balancing won't early evict in most situations.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/memcached-automove-extstore3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/memcached-automove-extstore b/scripts/memcached-automove-extstore
index f8f8220..d895bed 100755
--- a/scripts/memcached-automove-extstore
+++ b/scripts/memcached-automove-extstore
@@ -241,6 +241,9 @@ def memfree_check(s, diffs, totals):
if sid == 0:
continue
hold_free = int((slab['used_chunks'] + slab['free_chunks']) * args.free)
+ # Hold a minimum of 1.5 pages so page moves are unlikely to lose items.
+ if slab['chunks_per_page'] * 1.5 > hold_free:
+ hold_free = int(slab['chunks_per_page'] * 1.5)
info[sid] = hold_free
# TODO: only adjust if different?
s.write("extstore free_memchunks {} {}\r\n".format(sid, hold_free))