r1102 - in branches/1.0: . bin/varnishd

des at projects.linpro.no des at projects.linpro.no
Wed Sep 20 11:44:40 CEST 2006


Author: des
Date: 2006-09-20 11:44:40 +0200 (Wed, 20 Sep 2006)
New Revision: 1102

Modified:
   branches/1.0/
   branches/1.0/bin/varnishd/cache_pool.c
Log:
 r31731 at cat (orig r1100):  phk | 2006-09-20 11:00:20 +0200
 When ditching sessions due to overflow, only ditch new sessions.
 
 



Property changes on: branches/1.0
___________________________________________________________________
Name: svk:merge
   + d4fa192b-c00b-0410-8231-f00ffab90ce4:/trunk/varnish-cache:1100

Modified: branches/1.0/bin/varnishd/cache_pool.c
===================================================================
--- branches/1.0/bin/varnishd/cache_pool.c	2006-09-20 09:43:39 UTC (rev 1101)
+++ branches/1.0/bin/varnishd/cache_pool.c	2006-09-20 09:44:40 UTC (rev 1102)
@@ -295,7 +295,15 @@
 	UNLOCK(&qp->mtx);
 
 	LOCK(&tmtx);
-	if ((VSL_stats->n_wrk_overflow >
+	/*
+	 * If we have too much in the overflow, and this is a new session
+	 * just drop it.  We do not drop sessions which were waiting for
+	 * a busy object, they will be cheap to serve from here and the
+	 * cleanup would be more complex to carry out than delivering
+	 * the result will be
+	 */
+	if (sp->obj == NULL &&
+	    (VSL_stats->n_wrk_overflow >
 	    (params->wthread_max * params->overflow_max) / 100)) {
 		VSL_stats->n_wrk_drop++;
 		UNLOCK(&tmtx);




More information about the varnish-commit mailing list