[4.1] 6a672d4 Apply queue limits only to requests

PÃ¥l Hermunn Johansen hermunn at varnish-software.com
Tue Nov 22 14:31:05 CET 2016


commit 6a672d40982cb590a3a60e427209b91d4d016f77
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Oct 27 07:52:46 2016 +0200

    Apply queue limits only to requests
    
    We should queue bo tasks to avoid failing client requests
    unnecessarily.
    
    The detailed parameter description of the queue_limit was already
    correct, improve the short one.

diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c
index 3625365..4f7460f 100644
--- a/bin/varnishd/cache/cache_wrk.c
+++ b/bin/varnishd/cache/cache_wrk.c
@@ -243,8 +243,11 @@ Pool_Task(struct pool *pp, struct pool_task *task, enum task_how how)
 		return (0);
 	}
 
-	/* Acceptors are not subject to queue limits */
-	if (how == TASK_QUEUE_VCA ||
+	/*
+	 * queue limits only apply to client threads - all other
+	 * work is vital and needs do be done at the earliest
+	 */
+	if (how != TASK_QUEUE_REQ ||
 	    pp->lqueue < cache_param->wthread_max +
 	    cache_param->wthread_queue_limit + pp->nthr) {
 		pp->nqueued++;
diff --git a/bin/varnishd/mgt/mgt_pool.c b/bin/varnishd/mgt/mgt_pool.c
index f5a9cf4..724087a 100644
--- a/bin/varnishd/mgt/mgt_pool.c
+++ b/bin/varnishd/mgt/mgt_pool.c
@@ -187,7 +187,7 @@ struct parspec WRK_parspec[] = {
 		"10", "requests" },
 	{ "thread_queue_limit", tweak_uint, &mgt_param.wthread_queue_limit,
 		"0", NULL,
-		"Permitted queue length per thread-pool.\n"
+		"Permitted request queue length per thread-pool.\n"
 		"\n"
 		"This sets the number of requests we will queue, waiting "
 		"for an available thread.  Above this limit sessions will "
diff --git a/include/tbl/params.h b/include/tbl/params.h
index a5157ee..c68500b 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -1230,7 +1230,7 @@ PARAM(
 	/* units */	NULL,
 	/* flags */	EXPERIMENTAL,
 	/* s-text */
-	"Permitted queue length per thread-pool.\n"
+	"Permitted request queue length per thread-pool.\n"
 	"\n"
 	"This sets the number of requests we will queue, waiting for an "
 	"available thread.  Above this limit sessions will be dropped "



More information about the varnish-commit mailing list