[master] e74abf895 param: New vary_notice parameter

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Feb 15 14:26:07 UTC 2021


commit e74abf895d2e1147ab474e0490cbf7dd33ce2454
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Mon Feb 15 11:48:15 2021 +0100

    param: New vary_notice parameter
    
    To control the threshold used to warn.

diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index b8bb8b97b..eb40fa98f 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -543,7 +543,7 @@ cnt_lookup(struct worker *wrk, struct req *req)
 	if (req->hash_objhead)
 		had_objhead = 1;
 	lr = HSH_Lookup(req, &oc, &busy);
-	if (wrk->strangelove >= 10)
+	if (wrk->strangelove >= cache_param->vary_notice)
 		VSLb(req->vsl, SLT_Notice, "vsl: High number of variants (%d)",
 		    wrk->strangelove);
 	if (lr == HSH_BUSY) {
diff --git a/include/tbl/params.h b/include/tbl/params.h
index 6f4b6ad8b..fe4d2a293 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -944,6 +944,18 @@ PARAM_SIMPLE(
 	/* flags */	EXPERIMENTAL
 )
 
+PARAM_SIMPLE(
+	/* name */	vary_notice,
+	/* type */	uint,
+	/* min */	"1",
+	/* max */	NULL,
+	/* def */	"10",
+	/* units */	"variants",
+	/* descr */
+	"How many variants need to be evaluated to log a Notice that there "
+	"might be too many variants."
+)
+
 PARAM_SIMPLE(
 	/* name */	vcl_cooldown,
 	/* type */	timeout,


More information about the varnish-commit mailing list