From fb2317342bc13ac68fc6c5ab1e69236961e788ae Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 1 Feb 2018 15:41:49 +0000 Subject: [PATCH] mod_proxy: follow up to r1822849 and r1822879. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix my maths, thanks Stefan and Rüdiger! git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1822883 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/proxy_util.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 4388ae990f..ee20176cd3 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1843,16 +1843,18 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, ser } /* - * When mod_http2 is loaded we might have more processing threads - * since it has it's own pool of processing threads. + * When mod_http2 is loaded we might have more threads since it has + * its own pool of processing threads. */ ap_mpm_query(AP_MPMQ_MAX_THREADS, &max_threads); get_h2_num_workers = APR_RETRIEVE_OPTIONAL_FN(http2_get_num_workers); if (get_h2_num_workers) { get_h2_num_workers(s, &minw, &maxw); - if (max_threads < maxw) { - max_threads = maxw; - } + /* So now the max is: + * max_threads-1 threads for HTTP/1 each requiring one connection + * + one thread for HTTP/2 requiring maxw connections + */ + max_threads = max_threads - 1 + maxw; } if (max_threads > 1) { /* Default hmax is max_threads to scale with the load and never -- 2.50.1