]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
OPTIM: mux-h2: increase h2_settings_initial_window_size default to 64k
authorGlenn Strauss <gstrauss@gluelogic.com>
Sun, 5 Jun 2022 02:11:50 +0000 (22:11 -0400)
committerWilly Tarreau <w@1wt.eu>
Thu, 9 Jun 2022 07:28:21 +0000 (09:28 +0200)
This changes the default from RFC 7540's default 65535 (64k-1) to avoid
avoid some degenerative WINDOW_UPDATE behaviors in the wild observed with
clients using 65536 as their buffer size, and have to complete each block
with a 1-byte frame, which with some servers tend to degenerate in 1-byte
WU causing more 1-byte frames to be sent until the transfer almost only
uses 1-byte frames.

More details here: https://github.com/nghttp2/nghttp2/issues/1722

As mentioned in previous commit (MEDIUM: mux-h2: try to coalesce outgoing
WINDOW_UPDATE frames) the issue could not be reproduced with haproxy but
individual WU frames are sent so theoretically nothing prevents this from
happening. As such it should be backported as a workaround for already
deployed clients after watching for any possible side effect with rare
clients. As an added benefit, uploads from curl now use less DATA frames
(all are 16384 now). Note that the previous patch alone is sufficient to
stop the issue with curl in case this one would need to be reverted.

[wt: edited commit messaged, updated doc]

doc/configuration.txt
src/mux_h2.c

index 927c97ce392d7f68ada94096756421069a51499e..183710c357b142170f569a728635476f4c2e032b 100644 (file)
@@ -2744,7 +2744,7 @@ tune.h2.initial-window-size <number>
   Sets the HTTP/2 initial window size, which is the number of bytes the client
   can upload before waiting for an acknowledgment from HAProxy. This setting
   only affects payload contents (i.e. the body of POST requests), not headers.
-  The default value is 65535, which roughly allows up to 5 Mbps of upload
+  The default value is 65536, which roughly allows up to 5 Mbps of upload
   bandwidth per client over a network showing a 100 ms ping time, or 500 Mbps
   over a 1-ms local network. It can make sense to increase this value to allow
   faster uploads, or to reduce it to increase fairness when dealing with many
index 4b615fc894984480f72e91b70f16ebb910e7c30a..cd3b5799c407d75522553723c2cee8824fa5e9ed 100644 (file)
@@ -518,7 +518,7 @@ DECLARE_STATIC_POOL(pool_head_h2s, "h2s", sizeof(struct h2s));
 
 /* a few settings from the global section */
 static int h2_settings_header_table_size      =  4096; /* initial value */
-static int h2_settings_initial_window_size    = 65535; /* initial value */
+static int h2_settings_initial_window_size    = 65536; /* initial value */
 static unsigned int h2_settings_max_concurrent_streams = 100;
 static int h2_settings_max_frame_size         = 0;     /* unset */