[PATCH] Log LRU attempts where no candidate objects were found, and add a varnishstat counter for these events.
Martin Blix Grydeland
martin at varnish-software.com
Thu Aug 16 14:37:36 CEST 2012
---
bin/varnishd/cache/cache_expire.c | 3 +++
include/tbl/vsc_f_main.h | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c
index 3d18d78..daf8f88 100644
--- a/bin/varnishd/cache/cache_expire.c
+++ b/bin/varnishd/cache/cache_expire.c
@@ -446,6 +446,9 @@ EXP_NukeOne(struct busyobj *bo, struct lru *lru)
binheap_delete(exp_heap, oc->timer_idx);
assert(oc->timer_idx == BINHEAP_NOIDX);
VSC_C_main->n_lru_nuked++;
+ } else {
+ VSLb(bo->vsl, SLT_ExpKill, "LRU no candidates");
+ VSC_C_main->n_lru_no_candidates++;
}
Lck_Unlock(&exp_mtx);
Lck_Unlock(&lru->mtx);
diff --git a/include/tbl/vsc_f_main.h b/include/tbl/vsc_f_main.h
index d9c78ce..9aed160 100644
--- a/include/tbl/vsc_f_main.h
+++ b/include/tbl/vsc_f_main.h
@@ -314,6 +314,10 @@ VSC_F(n_lru_moved, uint64_t, 0, 'i',
"N LRU moved objects",
""
)
+VSC_F(n_lru_no_candidates, uint64_t, 0, 'c',
+ "LRU attemps with no candidates",
+ "Count of LRU attempts where no possible candidate objects were found"
+)
VSC_F(losthdr, uint64_t, 0, 'a',
"HTTP header overflows",
--
1.7.9.5
More information about the varnish-dev
mailing list