summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2018-02-12 10:41:24 -0800
committerdormando <dormando@rydia.net>2018-02-12 10:41:24 -0800
commitabfa8cf888db4ad9edc6b41b72f8d024d53290ee (patch)
treed0d13622fac90c77e6b858d5d9acdf99aba018a7
parent7f06ee82a7a2f5b8db40f08a8a88180c9038458f (diff)
downloadmemcached-abfa8cf888db4ad9edc6b41b72f8d024d53290ee.tar.gz
add evictions-happened test back to am script
not as easy to do the "global pool filled once" check, since the underlying memcached can be restarted but the script will just reconnect. simplest thing to do is to keep the evictions check, which stops the algorithm on a sudden reset.
-rwxr-xr-xscripts/memcached-automove-extstore19
1 files changed, 10 insertions, 9 deletions
diff --git a/scripts/memcached-automove-extstore b/scripts/memcached-automove-extstore
index e6509c0..db66d8c 100755
--- a/scripts/memcached-automove-extstore
+++ b/scripts/memcached-automove-extstore
@@ -295,15 +295,16 @@ while True:
(diffs, totals) = diff_stats(stats_pre, stats_post)
#if args.verbose:
# show_detail(diffs, totals)
- if (last_memfree_check < time() - 60) and totals.get('total_pages'):
- memfree = memfree_check(s, diffs, totals)
- last_memfree_check = time()
- decision = (-1, -1)
- decision = determine_move(history, stats, diffs, memfree)
- if int(decision[0]) > 0 and int(decision[1]) >= 0:
- print("moving page from, to:", decision)
- if args.automove:
- run_move(s, decision)
+ if int(stats['evictions']) > 0:
+ if (last_memfree_check < time() - 60) and totals.get('total_pages'):
+ memfree = memfree_check(s, diffs, totals)
+ last_memfree_check = time()
+ decision = (-1, -1)
+ decision = determine_move(history, stats, diffs, memfree)
+ if int(decision[0]) > 0 and int(decision[1]) >= 0:
+ print("moving page from, to:", decision)
+ if args.automove:
+ run_move(s, decision)
# Minimize sleeping if we just moved a page to global pool.
# Improves responsiveness during flushes/quick changes.