diff options
author | dormando <dormando@rydia.net> | 2017-11-28 17:56:20 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2017-11-28 17:56:20 -0800 |
commit | 81c83e803d2be797f70147e7214b2382ecadb5fc (patch) | |
tree | 54a625358371781fbbc26ac8871d960b6f0b682a /t/extstore.t | |
parent | 9716994daec8b30844c5c9bb8ee69f2dba031929 (diff) | |
download | memcached-81c83e803d2be797f70147e7214b2382ecadb5fc.tar.gz |
extstore: add ext_drop_unread option + live tune
was struggling to figure out how to automatically turn this on or off, but I
think it should be part of an outside process.
ie; a mechanism should be able to target a specific write rate, and one of
its tools for reducing the write rate should be flipping this on.
there's *still* a hole where you can't trigger a compaction attempt if
there's no fragmentation. I kind of want, if this feature is on, to attempt
a compaction on the oldest page while dropping unread items.
Diffstat (limited to 't/extstore.t')
-rw-r--r-- | t/extstore.t | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/t/extstore.t b/t/extstore.t index 8a8180e..4963ca6 100644 --- a/t/extstore.t +++ b/t/extstore.t @@ -100,6 +100,13 @@ mem_get_is($sock, "foo", "hi"); is($stats->{extstore_pages_free}, 0, '0 pages are free'); is($stats->{miss_from_extstore}, 1, 'exactly one miss'); + # refresh some keys so rescues happen while drop_unread == 1. + for (1 .. $keycount / 2) { + next unless $_ % 2 == 1; + print $sock "touch mfoo$_ 0 noreply\r\n"; + } + print $sock "extstore drop_unread 1\r\n"; + my $res = <$sock>; for (1 .. $keycount) { next unless $_ % 2 == 0; print $sock "delete mfoo$_ noreply\r\n"; @@ -110,6 +117,8 @@ mem_get_is($sock, "foo", "hi"); cmp_ok($stats->{extstore_pages_free}, '>', 0, 'some pages now free'); cmp_ok($stats->{extstore_compact_rescues}, '>', 0, 'some compaction rescues happened'); cmp_ok($stats->{extstore_compact_skipped}, '>', 0, 'some compaction skips happened'); + print $sock "extstore drop_unread 0\r\n"; + $res = <$sock>; } # attempt to incr/decr/append/prepend or chunk objects that were sent to disk. |