comparison src/http/ngx_http_core_module.c @ 7822:82e174e47663

Changed keepalive_requests default to 1000 (ticket #2155). It turns out no browsers implement HTTP/2 GOAWAY handling properly, and large enough number of resources on a page results in failures to load some resources. In particular, Chrome seems to experience errors if loading of all resources requires more than 1 connection (while it is usually able to retry requests at least once, even with 2 connections there are occasional failures for some reason), Safari if loading requires more than 3 connections, and Firefox if loading requires more than 10 connections (can be configured with network.http.request.max-attempts, defaults to 10). It does not seem to be possible to resolve this on nginx side, even strict limiting of maximum concurrency does not help, and loading issues seems to be triggered by merely queueing of a request for a particular connection. The only available mitigation seems to use higher keepalive_requests value. The new default is 1000 and matches previously used default for http2_max_requests. It is expected to be enough for 99.98% of the pages (https://httparchive.org/reports/state-of-the-web?start=latest#reqTotal) even in Chrome.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 08 Apr 2021 00:16:30 +0300
parents fdc3d40979b0
children bdd4d89370a7 7f95010f10b7
comparison
equal deleted inserted replaced
7821:6d4f7d5e279f 7822:82e174e47663
3756 ngx_conf_merge_msec_value(conf->keepalive_timeout, 3756 ngx_conf_merge_msec_value(conf->keepalive_timeout,
3757 prev->keepalive_timeout, 75000); 3757 prev->keepalive_timeout, 75000);
3758 ngx_conf_merge_sec_value(conf->keepalive_header, 3758 ngx_conf_merge_sec_value(conf->keepalive_header,
3759 prev->keepalive_header, 0); 3759 prev->keepalive_header, 0);
3760 ngx_conf_merge_uint_value(conf->keepalive_requests, 3760 ngx_conf_merge_uint_value(conf->keepalive_requests,
3761 prev->keepalive_requests, 100); 3761 prev->keepalive_requests, 1000);
3762 ngx_conf_merge_uint_value(conf->lingering_close, 3762 ngx_conf_merge_uint_value(conf->lingering_close,
3763 prev->lingering_close, NGX_HTTP_LINGERING_ON); 3763 prev->lingering_close, NGX_HTTP_LINGERING_ON);
3764 ngx_conf_merge_msec_value(conf->lingering_time, 3764 ngx_conf_merge_msec_value(conf->lingering_time,
3765 prev->lingering_time, 30000); 3765 prev->lingering_time, 30000);
3766 ngx_conf_merge_msec_value(conf->lingering_timeout, 3766 ngx_conf_merge_msec_value(conf->lingering_timeout,