Welcome! Log In Create A New Profile


[nginx] HTTP/2: relaxed PRIORITY frames limit.

Maxim Dounin
April 07, 2021 06:36PM
details: https://hg.nginx.org/nginx/rev/3674d5b7174e
changeset: 7819:3674d5b7174e
user: Maxim Dounin <mdounin@mdounin.ru>
date: Wed Apr 07 02:03:29 2021 +0300
HTTP/2: relaxed PRIORITY frames limit.

Firefox uses several idle streams for PRIORITY frames[1], and
"http2_max_concurrent_streams 1;" results in "client sent too many
PRIORITY frames" errors when a connection is established by Firefox.

Fix is to relax the PRIORITY frames limit to use at least 100 as
the initial value (which is the recommended by the HTTP/2 protocol
minimum limit on the number of concurrent streams, so it is not
unreasonable for clients to assume that similar number of idle streams
can be used for prioritization).

[1] https://hg.mozilla.org/mozilla-central/file/32a9e6e145d6e3071c3993a20bb603a2f388722b/netwerk/protocol/http/Http2Stream.cpp#l1270


src/http/v2/ngx_http_v2.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r e2e9e0fae747 -r 3674d5b7174e src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c Mon Apr 05 20:14:16 2021 +0300
+++ b/src/http/v2/ngx_http_v2.c Wed Apr 07 02:03:29 2021 +0300
@@ -277,7 +277,7 @@ ngx_http_v2_init(ngx_event_t *rev)
h2scf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_v2_module);

h2c->concurrent_pushes = h2scf->concurrent_pushes;
- h2c->priority_limit = h2scf->concurrent_streams;
+ h2c->priority_limit = ngx_max(h2scf->concurrent_streams, 100);

h2c->pool = ngx_create_pool(h2scf->pool_size, h2c->connection->log);
if (h2c->pool == NULL) {
nginx-devel mailing list
Subject Author Views Posted

[nginx] HTTP/2: relaxed PRIORITY frames limit.

Maxim Dounin 102 April 07, 2021 06:36PM

Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 57
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready