You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "stefan@eissing.org" <st...@eissing.org> on 2018/02/01 14:58:13 UTC

Re: svn commit: r1822878 - in /httpd/httpd/trunk/modules: http2/h2_config.c http2/h2_config.h http2/h2_conn.c http2/mod_http2.c http2/mod_http2.h proxy/config.m4 proxy/proxy_util.c

Hmm...

> Am 01.02.2018 um 15:42 schrieb ylavic@apache.org:
> 
> +        /*
> +         * When mod_http2 is loaded we might have more processing threads
> +         * since it has it's own pool of processing threads.
> +         */
> +        ap_mpm_query(AP_MPMQ_MAX_THREADS, &max_threads);
> +        if (have_get_h2_num_workers) {
> +            get_h2_num_workers(s, &minw, &maxw);
> +            if (max_threads < maxw) {
> +                max_threads = maxw;
> +            }
> +        }

Is this what you want? I think the max number of threads 
that a proxy worker may be active in is:

   (max_threads-1) + maxw

with a single HTTP/2 connection, running maxw streams in 
parallel over proxy?

-Stefan



AW: svn commit: r1822878 - in /httpd/httpd/trunk/modules: http2/h2_config.c http2/h2_config.h http2/h2_conn.c http2/mod_http2.c http2/mod_http2.h proxy/config.m4 proxy/proxy_util.c

Posted by Plüm, Rüdiger, Vodafone Group <ru...@vodafone.com>.

> -----Ursprüngliche Nachricht-----
> Von: Stefan Eissing [mailto:stefan.eissing@greenbytes.de]
> Gesendet: Donnerstag, 1. Februar 2018 16:15
> An: dev@httpd.apache.org
> Betreff: Re: svn commit: r1822878 - in /httpd/httpd/trunk/modules:
> http2/h2_config.c http2/h2_config.h http2/h2_conn.c http2/mod_http2.c
> http2/mod_http2.h proxy/config.m4 proxy/proxy_util.c
> 
> 
> 
> > Am 01.02.2018 um 16:11 schrieb Yann Ylavic <yl...@gmail.com>:
> >
> > On Thu, Feb 1, 2018 at 3:58 PM, stefan@eissing.org
> <st...@eissing.org> wrote:
> >> Hmm...
> >>
> >>> Am 01.02.2018 um 15:42 schrieb ylavic@apache.org:
> >>>
> >>> +        /*
> >>> +         * When mod_http2 is loaded we might have more processing
> threads
> >>> +         * since it has it's own pool of processing threads.
> >>> +         */
> >>> +        ap_mpm_query(AP_MPMQ_MAX_THREADS, &max_threads);
> >>> +        if (have_get_h2_num_workers) {
> >>> +            get_h2_num_workers(s, &minw, &maxw);
> >>> +            if (max_threads < maxw) {
> >>> +                max_threads = maxw;
> >>> +            }
> >>> +        }
> >>
> >> Is this what you want? I think the max number of threads
> >> that a proxy worker may be active in is:
> >>
> >>   (max_threads-1) + maxw
> >
> > The max number of connections a proxy worker might have to handle
> > simultaneously is the maximum number of threads requesting one at the
> > same time.
> >
> > The default for minw (ThreadsPerChild) and the doc about H2MaxWorkers
> > saying "This directive sets the maximum number of worker threads to
> > spawn per child process for HTTP/2 processing" suggested (to me) that
> > H2MaxWorkers already included ThreadsPerChild.
> > But if it should be "(max_threads-1) + maxw" per above, well, I trust
> you ;)
> >
> >>
> >> with a single HTTP/2 connection, running maxw streams in
> >> parallel over proxy?
> >
> > Can't each stream by proxied?
> 
> Maybe I am confused, but I see the max at
> 
> n-1 HTTP/1.1 connections with requests of the same proxy
> 1   HTTP/2 connection,
>     with m streams in parallel over the same proxy
> 
> With current implementation, the limits are:
> n <= ThreadsPerChild
> m <= maxw
> 
> or?

This is my understanding as well. So something like:

Index: proxy_util.c
===================================================================
--- proxy_util.c        (revision 1822880)
+++ proxy_util.c        (working copy)
@@ -1850,9 +1850,7 @@
         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;
-            }
+            max_threads = max_threads - 1 + maxw;
         }
         if (max_threads > 1) {
             /* Default hmax is max_threads to scale with the load and never

Regards

Rüdiger

Re: svn commit: r1822878 - in /httpd/httpd/trunk/modules: http2/h2_config.c http2/h2_config.h http2/h2_conn.c http2/mod_http2.c http2/mod_http2.h proxy/config.m4 proxy/proxy_util.c

Posted by Stefan Eissing <st...@greenbytes.de>.

> Am 01.02.2018 um 16:23 schrieb Yann Ylavic <yl...@gmail.com>:
> 
> On Thu, Feb 1, 2018 at 4:21 PM, Yann Ylavic <yl...@gmail.com> wrote:
>> On Thu, Feb 1, 2018 at 4:15 PM, Stefan Eissing
>>> 
>>> Maybe I am confused, but I see the max at
>>> 
>>> n-1 HTTP/1.1 connections with requests of the same proxy
>>> 1   HTTP/2 connection,
>>>    with m streams in parallel over the same proxy
>>> 
>>> With current implementation, the limits are:
>>> n <= ThreadsPerChild
>>> m <= maxw
>> 
>> Oh, I see your point now, thanks!
>> 
>> But than, shouldn't it be m * n?
>> How about more than one HTTP/2 connection?
> 
> Argh, brain fart :)

;-)

Re: svn commit: r1822878 - in /httpd/httpd/trunk/modules: http2/h2_config.c http2/h2_config.h http2/h2_conn.c http2/mod_http2.c http2/mod_http2.h proxy/config.m4 proxy/proxy_util.c

Posted by Yann Ylavic <yl...@gmail.com>.
On Thu, Feb 1, 2018 at 4:21 PM, Yann Ylavic <yl...@gmail.com> wrote:
> On Thu, Feb 1, 2018 at 4:15 PM, Stefan Eissing
>>
>> Maybe I am confused, but I see the max at
>>
>> n-1 HTTP/1.1 connections with requests of the same proxy
>> 1   HTTP/2 connection,
>>     with m streams in parallel over the same proxy
>>
>> With current implementation, the limits are:
>> n <= ThreadsPerChild
>> m <= maxw
>
> Oh, I see your point now, thanks!
>
> But than, shouldn't it be m * n?
> How about more than one HTTP/2 connection?

Argh, brain fart :)

Re: svn commit: r1822878 - in /httpd/httpd/trunk/modules: http2/h2_config.c http2/h2_config.h http2/h2_conn.c http2/mod_http2.c http2/mod_http2.h proxy/config.m4 proxy/proxy_util.c

Posted by Yann Ylavic <yl...@gmail.com>.
On Thu, Feb 1, 2018 at 4:15 PM, Stefan Eissing
<st...@greenbytes.de> wrote:
>
>
>> Am 01.02.2018 um 16:11 schrieb Yann Ylavic <yl...@gmail.com>:
>>
>> On Thu, Feb 1, 2018 at 3:58 PM, stefan@eissing.org <st...@eissing.org> wrote:
>>> Hmm...
>>>
>>>> Am 01.02.2018 um 15:42 schrieb ylavic@apache.org:
>>>>
>>>> +        /*
>>>> +         * When mod_http2 is loaded we might have more processing threads
>>>> +         * since it has it's own pool of processing threads.
>>>> +         */
>>>> +        ap_mpm_query(AP_MPMQ_MAX_THREADS, &max_threads);
>>>> +        if (have_get_h2_num_workers) {
>>>> +            get_h2_num_workers(s, &minw, &maxw);
>>>> +            if (max_threads < maxw) {
>>>> +                max_threads = maxw;
>>>> +            }
>>>> +        }
>>>
>>> Is this what you want? I think the max number of threads
>>> that a proxy worker may be active in is:
>>>
>>>   (max_threads-1) + maxw
>>
>> The max number of connections a proxy worker might have to handle
>> simultaneously is the maximum number of threads requesting one at the
>> same time.
>>
>> The default for minw (ThreadsPerChild) and the doc about H2MaxWorkers
>> saying "This directive sets the maximum number of worker threads to
>> spawn per child process for HTTP/2 processing" suggested (to me) that
>> H2MaxWorkers already included ThreadsPerChild.
>> But if it should be "(max_threads-1) + maxw" per above, well, I trust you ;)
>>
>>>
>>> with a single HTTP/2 connection, running maxw streams in
>>> parallel over proxy?
>>
>> Can't each stream by proxied?
>
> Maybe I am confused, but I see the max at
>
> n-1 HTTP/1.1 connections with requests of the same proxy
> 1   HTTP/2 connection,
>     with m streams in parallel over the same proxy
>
> With current implementation, the limits are:
> n <= ThreadsPerChild
> m <= maxw

Oh, I see your point now, thanks!

But than, shouldn't it be m * n?
How about more than one HTTP/2 connection?

Re: svn commit: r1822878 - in /httpd/httpd/trunk/modules: http2/h2_config.c http2/h2_config.h http2/h2_conn.c http2/mod_http2.c http2/mod_http2.h proxy/config.m4 proxy/proxy_util.c

Posted by Stefan Eissing <st...@greenbytes.de>.

> Am 01.02.2018 um 16:11 schrieb Yann Ylavic <yl...@gmail.com>:
> 
> On Thu, Feb 1, 2018 at 3:58 PM, stefan@eissing.org <st...@eissing.org> wrote:
>> Hmm...
>> 
>>> Am 01.02.2018 um 15:42 schrieb ylavic@apache.org:
>>> 
>>> +        /*
>>> +         * When mod_http2 is loaded we might have more processing threads
>>> +         * since it has it's own pool of processing threads.
>>> +         */
>>> +        ap_mpm_query(AP_MPMQ_MAX_THREADS, &max_threads);
>>> +        if (have_get_h2_num_workers) {
>>> +            get_h2_num_workers(s, &minw, &maxw);
>>> +            if (max_threads < maxw) {
>>> +                max_threads = maxw;
>>> +            }
>>> +        }
>> 
>> Is this what you want? I think the max number of threads
>> that a proxy worker may be active in is:
>> 
>>   (max_threads-1) + maxw
> 
> The max number of connections a proxy worker might have to handle
> simultaneously is the maximum number of threads requesting one at the
> same time.
> 
> The default for minw (ThreadsPerChild) and the doc about H2MaxWorkers
> saying "This directive sets the maximum number of worker threads to
> spawn per child process for HTTP/2 processing" suggested (to me) that
> H2MaxWorkers already included ThreadsPerChild.
> But if it should be "(max_threads-1) + maxw" per above, well, I trust you ;)
> 
>> 
>> with a single HTTP/2 connection, running maxw streams in
>> parallel over proxy?
> 
> Can't each stream by proxied?

Maybe I am confused, but I see the max at

n-1 HTTP/1.1 connections with requests of the same proxy
1   HTTP/2 connection, 
    with m streams in parallel over the same proxy

With current implementation, the limits are:
n <= ThreadsPerChild
m <= maxw

or?

> 
> 
> Thanks,
> Yann.


Re: svn commit: r1822878 - in /httpd/httpd/trunk/modules: http2/h2_config.c http2/h2_config.h http2/h2_conn.c http2/mod_http2.c http2/mod_http2.h proxy/config.m4 proxy/proxy_util.c

Posted by Yann Ylavic <yl...@gmail.com>.
On Thu, Feb 1, 2018 at 3:58 PM, stefan@eissing.org <st...@eissing.org> wrote:
> Hmm...
>
>> Am 01.02.2018 um 15:42 schrieb ylavic@apache.org:
>>
>> +        /*
>> +         * When mod_http2 is loaded we might have more processing threads
>> +         * since it has it's own pool of processing threads.
>> +         */
>> +        ap_mpm_query(AP_MPMQ_MAX_THREADS, &max_threads);
>> +        if (have_get_h2_num_workers) {
>> +            get_h2_num_workers(s, &minw, &maxw);
>> +            if (max_threads < maxw) {
>> +                max_threads = maxw;
>> +            }
>> +        }
>
> Is this what you want? I think the max number of threads
> that a proxy worker may be active in is:
>
>    (max_threads-1) + maxw

The max number of connections a proxy worker might have to handle
simultaneously is the maximum number of threads requesting one at the
same time.

The default for minw (ThreadsPerChild) and the doc about H2MaxWorkers
saying "This directive sets the maximum number of worker threads to
spawn per child process for HTTP/2 processing" suggested (to me) that
H2MaxWorkers already included ThreadsPerChild.
But if it should be "(max_threads-1) + maxw" per above, well, I trust you ;)

>
> with a single HTTP/2 connection, running maxw streams in
> parallel over proxy?

Can't each stream by proxied?


Thanks,
Yann.