[master] 561579a add the long missing per-backend busy and unhealthy counters

Nils Goroll nils.goroll at uplex.de
Mon Jun 11 08:29:11 UTC 2018


commit 561579a3e12b2307e19e5da7b4cb37fd4ee1b74e
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Jun 5 10:51:45 2018 +0200

    add the long missing per-backend busy and unhealthy counters

diff --git a/bin/varnishd/VSC_vbe.vsc b/bin/varnishd/VSC_vbe.vsc
index 5212119..cc05598 100644
--- a/bin/varnishd/VSC_vbe.vsc
+++ b/bin/varnishd/VSC_vbe.vsc
@@ -78,6 +78,18 @@
 	:level:	info
 	:oneliner:	Backend requests sent
 
+.. varnish_vsc:: unhealthy
+	:type:	counter
+	:level: info
+	:oneliner:	Fetches not attempted due to backend being unhealthy
+
+.. varnish_vsc:: busy
+	:type:	counter
+	:level: info
+	:oneliner:	Fetches not attempted due to backend being busy
+
+	Number of times the max_connections limit was reached
+
 ..
 	=== Anything below is actually per VCP entry, but collected per
 	=== backend for simplicity
diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index 4513474..a6e1760 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -90,7 +90,7 @@ vbe_dir_getfd(struct worker *wrk, struct backend *bp, struct busyobj *bo,
 	if (bp->director->sick) {
 		VSLb(bo->vsl, SLT_FetchError,
 		     "backend %s: unhealthy", VRT_BACKEND_string(bp->director));
-		// XXX: per backend stats ?
+		bp->vsc->unhealthy++;
 		VSC_C_main->backend_unhealthy++;
 		return (NULL);
 	}
@@ -98,7 +98,7 @@ vbe_dir_getfd(struct worker *wrk, struct backend *bp, struct busyobj *bo,
 	if (bp->max_connections > 0 && bp->n_conn >= bp->max_connections) {
 		VSLb(bo->vsl, SLT_FetchError,
 		     "backend %s: busy", VRT_BACKEND_string(bp->director));
-		// XXX: per backend stats ?
+		bp->vsc->busy++;
 		VSC_C_main->backend_busy++;
 		return (NULL);
 	}


More information about the varnish-commit mailing list