summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2016-12-30 11:41:43 -0800
committerdormando <dormando@rydia.net>2016-12-30 17:26:16 -0800
commitbb174641e09feaafe80d86514375a552a5b47780 (patch)
treeb2c93378eae840db7b0d4b86d1b3163f565355de
parent1223b837527b7cbb110499aeb2f4dea25b58b236 (diff)
downloadmemcached-bb174641e09feaafe80d86514375a552a5b47780.tar.gz
tune crawler logger, fix crawler watermark
should be looking for 1% of potential reclaims, not 1% of all the items it saw. Otherwise could be wedged into doing nothing.
-rw-r--r--items.c7
-rw-r--r--logger.c2
2 files changed, 4 insertions, 5 deletions
diff --git a/items.c b/items.c
index 7f1246a..b83e035 100644
--- a/items.c
+++ b/items.c
@@ -1075,7 +1075,7 @@ static void lru_maintainer_crawler_check(struct crawler_expired_data *cdata, log
/* Need to think we can free at least 1% of the items before
* crawling. */
/* FIXME: Configurable? */
- uint64_t low_watermark = (s->seen / 100) + 1;
+ uint64_t low_watermark = (possible_reclaims / 100) + 1;
rel_time_t since_run = current_time - s->end_time;
/* Don't bother if the payoff is too low. */
for (x = 0; x < 60; x++) {
@@ -1100,10 +1100,9 @@ static void lru_maintainer_crawler_check(struct crawler_expired_data *cdata, log
next_crawls[i] = current_time + next_crawl_wait[i] + 5;
LOGGER_LOG(l, LOG_SYSEVENTS, LOGGER_CRAWLER_STATUS, NULL, i, (unsigned long long)low_watermark,
- (unsigned long long)possible_reclaims,
+ (unsigned long long)available_reclaims,
(unsigned int)since_run,
- next_crawls[i],
- current_time,
+ next_crawls[i] - current_time,
s->end_time - s->start_time,
s->seen,
s->reclaimed);
diff --git a/logger.c b/logger.c
index dfb89b6..7d8df54 100644
--- a/logger.c
+++ b/logger.c
@@ -50,7 +50,7 @@ static const entry_details default_entries[] = {
[LOGGER_ITEM_GET] = {LOGGER_ITEM_GET_ENTRY, 512, LOG_FETCHERS, NULL},
[LOGGER_ITEM_STORE] = {LOGGER_ITEM_STORE_ENTRY, 512, LOG_MUTATIONS, NULL},
[LOGGER_CRAWLER_STATUS] = {LOGGER_TEXT_ENTRY, 512, LOG_SYSEVENTS,
- "lru_crawler=%d low_mark=%llu possible_reclaims=%llu since_run=%u next_run=%d now=%d time_elapsed=%u examined=%llu reclaimed=%llu"
+ "lru_crawler=%d low_mark=%llu next_reclaims=%llu since_run=%u next_run=%d elapsed=%u examined=%llu reclaimed=%llu"
}
};