r2064 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Sun Sep 30 22:19:50 CEST 2007


Author: phk
Date: 2007-09-30 22:19:50 +0200 (Sun, 30 Sep 2007)
New Revision: 2064

Modified:
   trunk/varnish-cache/bin/varnishd/cache_center.c
Log:
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.



Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2007-09-30 20:16:28 UTC (rev 2063)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2007-09-30 20:19:50 UTC (rev 2064)
@@ -304,12 +304,6 @@
 	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 @@
 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) {




More information about the varnish-commit mailing list