From: phk Date: Tue, 26 Aug 2008 09:47:49 +0000 (+0000) Subject: Tada! X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a249984c24158d68507b329db94fe0feca7775c;p=varnish Tada! First step in activating backend polling: Do not attempt to open connections to a unhealthy backend. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3132 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_backend.c b/varnish-cache/bin/varnishd/cache_backend.c index 49672141..53afab0c 100644 --- a/varnish-cache/bin/varnishd/cache_backend.c +++ b/varnish-cache/bin/varnishd/cache_backend.c @@ -313,6 +313,11 @@ VBE_GetVbe(struct sess *sp, struct backend *bp) VBE_ClosedFd(sp); } + if (!bp->healthy) { + VSL_stats->backend_unhealthy++; + return (NULL); + } + vc = VBE_NewConn(); assert(vc->fd == -1); AZ(vc->backend); diff --git a/varnish-cache/include/stat_field.h b/varnish-cache/include/stat_field.h index b46e26c1..86f7b678 100644 --- a/varnish-cache/include/stat_field.h +++ b/varnish-cache/include/stat_field.h @@ -37,6 +37,7 @@ MAC_STAT(cache_hitpass, uint64_t, 'a', "Cache hits for pass") 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")