From 8f62b380b7417e3ef97633d87143c4742ecddc6c Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 20 Sep 2006 09:00:20 +0000 Subject: [PATCH] When ditching sessions due to overflow, only ditch new sessions. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1100 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_pool.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_pool.c b/varnish-cache/bin/varnishd/cache_pool.c index 11b9a303..410600cc 100644 --- a/varnish-cache/bin/varnishd/cache_pool.c +++ b/varnish-cache/bin/varnishd/cache_pool.c @@ -295,7 +295,15 @@ WRK_QueueSession(struct sess *sp) 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); -- 2.39.5