r3132 - in trunk/varnish-cache: bin/varnishd include

phk at projects.linpro.no phk at projects.linpro.no
Tue Aug 26 11:47:50 CEST 2008


Author: phk
Date: 2008-08-26 11:47:49 +0200 (Tue, 26 Aug 2008)
New Revision: 3132

Modified:
   trunk/varnish-cache/bin/varnishd/cache_backend.c
   trunk/varnish-cache/include/stat_field.h
Log:
Tada!

First step in activating backend polling:  Do not attempt to open
connections to a unhealthy backend.



Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c	2008-08-26 09:32:24 UTC (rev 3131)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c	2008-08-26 09:47:49 UTC (rev 3132)
@@ -313,6 +313,11 @@
 		VBE_ClosedFd(sp);
 	}
 
+	if (!bp->healthy) {
+		VSL_stats->backend_unhealthy++;
+		return (NULL);
+	}
+
 	vc = VBE_NewConn();
 	assert(vc->fd == -1);
 	AZ(vc->backend);

Modified: trunk/varnish-cache/include/stat_field.h
===================================================================
--- trunk/varnish-cache/include/stat_field.h	2008-08-26 09:32:24 UTC (rev 3131)
+++ trunk/varnish-cache/include/stat_field.h	2008-08-26 09:47:49 UTC (rev 3132)
@@ -37,6 +37,7 @@
 MAC_STAT(cache_miss,		uint64_t, 'a', "Cache misses")
 
 MAC_STAT(backend_conn,		uint64_t, 'a', "Backend connections success")
+MAC_STAT(backend_unhealthy,	uint64_t, 'a', "Backend connections not attempted")
 MAC_STAT(backend_fail,		uint64_t, 'a', "Backend connections failures")
 MAC_STAT(backend_reuse,		uint64_t, 'a', "Backend connections reuses")
 MAC_STAT(backend_recycle,	uint64_t, 'a', "Backend connections recycles")




More information about the varnish-commit mailing list