diff options
author | dormando <dormando@rydia.net> | 2017-12-06 11:22:23 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2017-12-06 11:22:23 -0800 |
commit | bb1080bb9f8ab5271699bb84eb90de1fcf9ed695 (patch) | |
tree | 1825e2f2a5cfb9b1bd8fc336eb16b5670e8e3e24 /scripts | |
parent | bf8a7b4af951f48ebfdf135d39c8a4abfd1f3a24 (diff) | |
download | memcached-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-x | scripts/memcached-automove-extstore | 3 |
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)) |