r968 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Sep 11 19:18:31 CEST 2006


Author: phk
Date: 2006-09-11 19:18:31 +0200 (Mon, 11 Sep 2006)
New Revision: 968

Modified:
   trunk/varnish-cache/bin/varnishd/cache_pool.c
Log:
If we have more threads than the max, kill one if we can.


Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c	2006-09-11 15:12:05 UTC (rev 967)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c	2006-09-11 17:18:31 UTC (rev 968)
@@ -269,7 +269,9 @@
 		now = time(NULL);
 		LOCK(&wrk_mtx);
 		w = TAILQ_LAST(&wrk_idle, workerhead);
-		if (w != NULL && w->idle + params->wthread_timeout < now)
+		if (w != NULL &&
+		   (w->idle + params->wthread_timeout < now ||
+		    VSL_stats->n_wrk <= params->wthread_max)
 			TAILQ_REMOVE(&wrk_idle, w, list);
 		else 
 			w = NULL;




More information about the varnish-commit mailing list