You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ruediger Pluem <rp...@apache.org> on 2022/06/20 06:53:48 UTC
Re: svn commit: r1902005 - in /httpd/httpd/trunk/modules/http2: h2_c1.c h2_config.c h2_config.h h2_mplx.c h2_mplx.h h2_workers.c h2_workers.h mod_http2.c
On 6/17/22 11:24 AM, icing@apache.org wrote:
> Author: icing
> Date: Fri Jun 17 09:24:57 2022
> New Revision: 1902005
>
> URL: http://svn.apache.org/viewvc?rev=1902005&view=rev
> Log:
> *) mod_http2: new implementation of h2 worker pool.
> - O(1) cost at registration of connection processing producers
> - no limit on registered producers
> - join of ongoing work on unregister
> - callbacks to unlink dependencies into other h2 code
> - memory cleanup on workers deactivation (on idle timeouts)
> - idle_limit as apr_time_t instead of seconds
>
>
> Modified:
> httpd/httpd/trunk/modules/http2/h2_c1.c
> httpd/httpd/trunk/modules/http2/h2_config.c
> httpd/httpd/trunk/modules/http2/h2_config.h
> httpd/httpd/trunk/modules/http2/h2_mplx.c
> httpd/httpd/trunk/modules/http2/h2_mplx.h
> httpd/httpd/trunk/modules/http2/h2_workers.c
> httpd/httpd/trunk/modules/http2/h2_workers.h
> httpd/httpd/trunk/modules/http2/mod_http2.c
>
> Modified: httpd/httpd/trunk/modules/http2/h2_c1.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_c1.c?rev=1902005&r1=1902004&r2=1902005&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/http2/h2_c1.c (original)
> +++ httpd/httpd/trunk/modules/http2/h2_c1.c Fri Jun 17 09:24:57 2022
> @@ -56,11 +56,8 @@ apr_status_t h2_c1_child_init(apr_pool_t
> {
> apr_status_t status = APR_SUCCESS;
> int minw, maxw;
> - int max_threads_per_child = 0;
> - int idle_secs = 0;
> + apr_time_t idle_limit;
>
> - ap_mpm_query(AP_MPMQ_MAX_THREADS, &max_threads_per_child);
> -
> status = ap_mpm_query(AP_MPMQ_IS_ASYNC, &async_mpm);
> if (status != APR_SUCCESS) {
> /* some MPMs do not implemnent this */
> @@ -70,12 +67,8 @@ apr_status_t h2_c1_child_init(apr_pool_t
>
> h2_config_init(pool);
>
> - h2_get_num_workers(s, &minw, &maxw);
> - idle_secs = h2_config_sgeti(s, H2_CONF_MAX_WORKER_IDLE_SECS);
> - ap_log_error(APLOG_MARK, APLOG_TRACE3, 0, s,
> - "h2_workers: min=%d max=%d, mthrpchild=%d, idle_secs=%d",
> - minw, maxw, max_threads_per_child, idle_secs);
> - workers = h2_workers_create(s, pool, minw, maxw, idle_secs);
> + h2_get_workers_config(s, &minw, &maxw, &idle_limit);
> + workers = h2_workers_create(s, pool, maxw, minw, idle_limit);
Shouldn't that be
workers = h2_workers_create(s, pool, minw, maxw, idle_limit);
instead?
>
> h2_c_logio_add_bytes_in = APR_RETRIEVE_OPTIONAL_FN(ap_logio_add_bytes_in);
> h2_c_logio_add_bytes_out = APR_RETRIEVE_OPTIONAL_FN(ap_logio_add_bytes_out);
>
Regards
Rüdiger
Re: svn commit: r1902005 - in /httpd/httpd/trunk/modules/http2: h2_c1.c h2_config.c h2_config.h h2_mplx.c h2_mplx.h h2_workers.c h2_workers.h mod_http2.c
Posted by Stefan Eissing <st...@eissing.org>.
> Am 20.06.2022 um 09:01 schrieb Stefan Eissing <st...@eissing.org>:
>
>
>
>> Am 20.06.2022 um 08:59 schrieb Ruediger Pluem <rp...@apache.org>:
>>
>>
>>
>> On 6/20/22 8:53 AM, Ruediger Pluem wrote:
>>>
>>>
>>> On 6/17/22 11:24 AM, icing@apache.org wrote:
>>>> Author: icing
>>>> Date: Fri Jun 17 09:24:57 2022
>>>> New Revision: 1902005
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=1902005&view=rev
>>>> Log:
>>>> *) mod_http2: new implementation of h2 worker pool.
>>>> - O(1) cost at registration of connection processing producers
>>>> - no limit on registered producers
>>>> - join of ongoing work on unregister
>>>> - callbacks to unlink dependencies into other h2 code
>>>> - memory cleanup on workers deactivation (on idle timeouts)
>>>> - idle_limit as apr_time_t instead of seconds
>>>>
>>>>
>>>> Modified:
>>>> httpd/httpd/trunk/modules/http2/h2_c1.c
>>>> httpd/httpd/trunk/modules/http2/h2_config.c
>>>> httpd/httpd/trunk/modules/http2/h2_config.h
>>>> httpd/httpd/trunk/modules/http2/h2_mplx.c
>>>> httpd/httpd/trunk/modules/http2/h2_mplx.h
>>>> httpd/httpd/trunk/modules/http2/h2_workers.c
>>>> httpd/httpd/trunk/modules/http2/h2_workers.h
>>>> httpd/httpd/trunk/modules/http2/mod_http2.c
>>>>
>>>> Modified: httpd/httpd/trunk/modules/http2/h2_c1.c
>>>> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_c1.c?rev=1902005&r1=1902004&r2=1902005&view=diff
>>>> ==============================================================================
>>>> --- httpd/httpd/trunk/modules/http2/h2_c1.c (original)
>>>> +++ httpd/httpd/trunk/modules/http2/h2_c1.c Fri Jun 17 09:24:57 2022
>>>> @@ -56,11 +56,8 @@ apr_status_t h2_c1_child_init(apr_pool_t
>>>> {
>>>> apr_status_t status = APR_SUCCESS;
>>>> int minw, maxw;
>>>> - int max_threads_per_child = 0;
>>>> - int idle_secs = 0;
>>>> + apr_time_t idle_limit;
>>>>
>>>> - ap_mpm_query(AP_MPMQ_MAX_THREADS, &max_threads_per_child);
>>>> -
>>>> status = ap_mpm_query(AP_MPMQ_IS_ASYNC, &async_mpm);
>>>> if (status != APR_SUCCESS) {
>>>> /* some MPMs do not implemnent this */
>>>> @@ -70,12 +67,8 @@ apr_status_t h2_c1_child_init(apr_pool_t
>>>>
>>>> h2_config_init(pool);
>>>>
>>>> - h2_get_num_workers(s, &minw, &maxw);
>>>> - idle_secs = h2_config_sgeti(s, H2_CONF_MAX_WORKER_IDLE_SECS);
>>>> - ap_log_error(APLOG_MARK, APLOG_TRACE3, 0, s,
>>>> - "h2_workers: min=%d max=%d, mthrpchild=%d, idle_secs=%d",
>>>> - minw, maxw, max_threads_per_child, idle_secs);
>>>> - workers = h2_workers_create(s, pool, minw, maxw, idle_secs);
>>>> + h2_get_workers_config(s, &minw, &maxw, &idle_limit);
>>>> + workers = h2_workers_create(s, pool, maxw, minw, idle_limit);
>>>
>>> Shouldn't that be
>>>
>>> workers = h2_workers_create(s, pool, minw, maxw, idle_limit);
>>>
>>> instead?
>>
>> Scratch that. I just noticed that the order of the parameters in h2_workers_create was changed as well.
>
> You had me scrambling there for a second. ;)
>
> Yeah, might be more "natural" to have them the other way around. No strong feelings.
As an explainer: I played around with different parameters here and ended up removing them again. In the interim versions, the order got changed.
>
> Cheers,
> Stefan
>
>>
>> Regards
>>
>> Rüdiger
Re: svn commit: r1902005 - in /httpd/httpd/trunk/modules/http2: h2_c1.c h2_config.c h2_config.h h2_mplx.c h2_mplx.h h2_workers.c h2_workers.h mod_http2.c
Posted by Stefan Eissing <st...@eissing.org>.
> Am 20.06.2022 um 08:59 schrieb Ruediger Pluem <rp...@apache.org>:
>
>
>
> On 6/20/22 8:53 AM, Ruediger Pluem wrote:
>>
>>
>> On 6/17/22 11:24 AM, icing@apache.org wrote:
>>> Author: icing
>>> Date: Fri Jun 17 09:24:57 2022
>>> New Revision: 1902005
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1902005&view=rev
>>> Log:
>>> *) mod_http2: new implementation of h2 worker pool.
>>> - O(1) cost at registration of connection processing producers
>>> - no limit on registered producers
>>> - join of ongoing work on unregister
>>> - callbacks to unlink dependencies into other h2 code
>>> - memory cleanup on workers deactivation (on idle timeouts)
>>> - idle_limit as apr_time_t instead of seconds
>>>
>>>
>>> Modified:
>>> httpd/httpd/trunk/modules/http2/h2_c1.c
>>> httpd/httpd/trunk/modules/http2/h2_config.c
>>> httpd/httpd/trunk/modules/http2/h2_config.h
>>> httpd/httpd/trunk/modules/http2/h2_mplx.c
>>> httpd/httpd/trunk/modules/http2/h2_mplx.h
>>> httpd/httpd/trunk/modules/http2/h2_workers.c
>>> httpd/httpd/trunk/modules/http2/h2_workers.h
>>> httpd/httpd/trunk/modules/http2/mod_http2.c
>>>
>>> Modified: httpd/httpd/trunk/modules/http2/h2_c1.c
>>> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_c1.c?rev=1902005&r1=1902004&r2=1902005&view=diff
>>> ==============================================================================
>>> --- httpd/httpd/trunk/modules/http2/h2_c1.c (original)
>>> +++ httpd/httpd/trunk/modules/http2/h2_c1.c Fri Jun 17 09:24:57 2022
>>> @@ -56,11 +56,8 @@ apr_status_t h2_c1_child_init(apr_pool_t
>>> {
>>> apr_status_t status = APR_SUCCESS;
>>> int minw, maxw;
>>> - int max_threads_per_child = 0;
>>> - int idle_secs = 0;
>>> + apr_time_t idle_limit;
>>>
>>> - ap_mpm_query(AP_MPMQ_MAX_THREADS, &max_threads_per_child);
>>> -
>>> status = ap_mpm_query(AP_MPMQ_IS_ASYNC, &async_mpm);
>>> if (status != APR_SUCCESS) {
>>> /* some MPMs do not implemnent this */
>>> @@ -70,12 +67,8 @@ apr_status_t h2_c1_child_init(apr_pool_t
>>>
>>> h2_config_init(pool);
>>>
>>> - h2_get_num_workers(s, &minw, &maxw);
>>> - idle_secs = h2_config_sgeti(s, H2_CONF_MAX_WORKER_IDLE_SECS);
>>> - ap_log_error(APLOG_MARK, APLOG_TRACE3, 0, s,
>>> - "h2_workers: min=%d max=%d, mthrpchild=%d, idle_secs=%d",
>>> - minw, maxw, max_threads_per_child, idle_secs);
>>> - workers = h2_workers_create(s, pool, minw, maxw, idle_secs);
>>> + h2_get_workers_config(s, &minw, &maxw, &idle_limit);
>>> + workers = h2_workers_create(s, pool, maxw, minw, idle_limit);
>>
>> Shouldn't that be
>>
>> workers = h2_workers_create(s, pool, minw, maxw, idle_limit);
>>
>> instead?
>
> Scratch that. I just noticed that the order of the parameters in h2_workers_create was changed as well.
You had me scrambling there for a second. ;)
Yeah, might be more "natural" to have them the other way around. No strong feelings.
Cheers,
Stefan
>
> Regards
>
> Rüdiger
Re: svn commit: r1902005 - in /httpd/httpd/trunk/modules/http2: h2_c1.c h2_config.c h2_config.h h2_mplx.c h2_mplx.h h2_workers.c h2_workers.h mod_http2.c
Posted by Ruediger Pluem <rp...@apache.org>.
On 6/20/22 8:53 AM, Ruediger Pluem wrote:
>
>
> On 6/17/22 11:24 AM, icing@apache.org wrote:
>> Author: icing
>> Date: Fri Jun 17 09:24:57 2022
>> New Revision: 1902005
>>
>> URL: http://svn.apache.org/viewvc?rev=1902005&view=rev
>> Log:
>> *) mod_http2: new implementation of h2 worker pool.
>> - O(1) cost at registration of connection processing producers
>> - no limit on registered producers
>> - join of ongoing work on unregister
>> - callbacks to unlink dependencies into other h2 code
>> - memory cleanup on workers deactivation (on idle timeouts)
>> - idle_limit as apr_time_t instead of seconds
>>
>>
>> Modified:
>> httpd/httpd/trunk/modules/http2/h2_c1.c
>> httpd/httpd/trunk/modules/http2/h2_config.c
>> httpd/httpd/trunk/modules/http2/h2_config.h
>> httpd/httpd/trunk/modules/http2/h2_mplx.c
>> httpd/httpd/trunk/modules/http2/h2_mplx.h
>> httpd/httpd/trunk/modules/http2/h2_workers.c
>> httpd/httpd/trunk/modules/http2/h2_workers.h
>> httpd/httpd/trunk/modules/http2/mod_http2.c
>>
>> Modified: httpd/httpd/trunk/modules/http2/h2_c1.c
>> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_c1.c?rev=1902005&r1=1902004&r2=1902005&view=diff
>> ==============================================================================
>> --- httpd/httpd/trunk/modules/http2/h2_c1.c (original)
>> +++ httpd/httpd/trunk/modules/http2/h2_c1.c Fri Jun 17 09:24:57 2022
>> @@ -56,11 +56,8 @@ apr_status_t h2_c1_child_init(apr_pool_t
>> {
>> apr_status_t status = APR_SUCCESS;
>> int minw, maxw;
>> - int max_threads_per_child = 0;
>> - int idle_secs = 0;
>> + apr_time_t idle_limit;
>>
>> - ap_mpm_query(AP_MPMQ_MAX_THREADS, &max_threads_per_child);
>> -
>> status = ap_mpm_query(AP_MPMQ_IS_ASYNC, &async_mpm);
>> if (status != APR_SUCCESS) {
>> /* some MPMs do not implemnent this */
>> @@ -70,12 +67,8 @@ apr_status_t h2_c1_child_init(apr_pool_t
>>
>> h2_config_init(pool);
>>
>> - h2_get_num_workers(s, &minw, &maxw);
>> - idle_secs = h2_config_sgeti(s, H2_CONF_MAX_WORKER_IDLE_SECS);
>> - ap_log_error(APLOG_MARK, APLOG_TRACE3, 0, s,
>> - "h2_workers: min=%d max=%d, mthrpchild=%d, idle_secs=%d",
>> - minw, maxw, max_threads_per_child, idle_secs);
>> - workers = h2_workers_create(s, pool, minw, maxw, idle_secs);
>> + h2_get_workers_config(s, &minw, &maxw, &idle_limit);
>> + workers = h2_workers_create(s, pool, maxw, minw, idle_limit);
>
> Shouldn't that be
>
> workers = h2_workers_create(s, pool, minw, maxw, idle_limit);
>
> instead?
Scratch that. I just noticed that the order of the parameters in h2_workers_create was changed as well.
Regards
Rüdiger