From: phk Date: Sun, 30 Sep 2007 20:19:50 +0000 (+0000) Subject: Evict backend-health code which had strayed fra from it's proper place. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b48fab9438e2a63929b0a646739bbdf78478a6a;p=varnish Evict backend-health code which had strayed fra from it's proper place. cache_fetch.c now reports the response code or a indicative negative status for failed requests to the backend code. Any timeouts, keepalives or other overhead processing of health codes should happen in a thread in the backend handling. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2064 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index b48130de..127a6b44 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -304,12 +304,6 @@ cnt_fetch(struct sess *sp) sp->bereq = NULL; if (i) { - /* Experimental. If the fetch failed, it would also seem - * to be a backend problem, so decrease the health parameter. - */ - if (sp->backend->health > -10000) - sp->backend->health--; - SYN_ErrorPage(sp, 503, "Error talking to backend", 30); } else { RFC2616_cache_policy(sp, &sp->obj->http); /* XXX -> VCL */ @@ -402,22 +396,9 @@ DOT hit -> deliver [label="deliver",style=bold,color=green,weight=4] static int cnt_hit(struct sess *sp) { - double time_diff; - double minutes; assert(!sp->obj->pass); - /* Experimental. Reduce health parameter of backend towards zero - * if it has been more than a minute since it was checked. */ - CHECK_OBJ_NOTNULL(sp->backend, BACKEND_MAGIC); - time_diff = TIM_mono() - sp->backend->last_check; - minutes = time_diff / 60; - if (minutes > sp->backend->minute_limit) { - sp->backend->minute_limit++; - sp->backend->health = (int)((double)sp->backend->health / 2); - VBE_UpdateHealth(sp, NULL, 0); - } - VCL_hit_method(sp); if (sp->handling == VCL_RET_DELIVER) {