[4.1] ace6f49 Add n_lru_limited counter

PÃ¥l Hermunn Johansen hermunn at varnish-software.com
Sat Feb 24 22:56:06 UTC 2018


commit ace6f49dd458d67c71782752652ef9ef31f50700
Author: Shohei Tanaka(@xcir) <kokoniimasu+git at gmail.com>
Date:   Fri Feb 16 14:47:53 2018 +0900

    Add n_lru_limited counter
    
    This is a back port of the commits submitted in #2569 and merged in
    dc6c6520188fa6ffd5b9262cf1cbb86f8e5df4cc.

diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c
index 4172cea..28c79ab 100644
--- a/bin/varnishd/cache/cache_expire.c
+++ b/bin/varnishd/cache/cache_expire.c
@@ -331,6 +331,7 @@ EXP_NukeOne(struct worker *wrk, struct lru *lru)
 	CHECK_OBJ_NOTNULL(lru, LRU_MAGIC);
 	if (wrk->strangelove-- <= 0) {
 		VSLb(wrk->vsl, SLT_ExpKill, "LRU_Exhausted");
+		VSC_C_main->n_lru_limited++;
 		return (0);
 	}
 	/* Find the first currently unused object on the LRU.  */
diff --git a/bin/varnishtest/tests/r01764.vtc b/bin/varnishtest/tests/r01764.vtc
index 07bdb32..d79d23e 100644
--- a/bin/varnishtest/tests/r01764.vtc
+++ b/bin/varnishtest/tests/r01764.vtc
@@ -52,3 +52,5 @@ client c1 {
 	rxresp
 	expect resp.status == 503
 } -run
+
+varnish v1 -expect n_lru_limited == 1
diff --git a/include/tbl/vsc_f_main.h b/include/tbl/vsc_f_main.h
index 0da1989..710241f 100644
--- a/include/tbl/vsc_f_main.h
+++ b/include/tbl/vsc_f_main.h
@@ -322,6 +322,12 @@ VSC_F(n_lru_moved,		uint64_t, 0, 'g', 'i', diag,
 	"Number of move operations done on the LRU list."
 )
 
+VSC_F(n_lru_limited,		uint64_t, 0, 'c', 'i', info,
+    "Reached nuke_limit",
+	"Number of times more storage space were needed, but limit"
+	" was reached in a nuke_limit. See also parameter nuke_limit."
+)
+
 VSC_F(losthdr,			uint64_t, 0, 'c', 'i', info,
     "HTTP header overflows",
 	""


More information about the varnish-commit mailing list