mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
MINOR: h2: expose tune.h2.initial-window-size to configure the window size
This will be advertised in the settings frame.
This commit is contained in:
parent
fe20e5b8c7
commit
e6baec0e23
@ -600,6 +600,7 @@ The following keywords are supported in the "global" section :
|
||||
- tune.chksize
|
||||
- tune.comp.maxlevel
|
||||
- tune.h2.header-table-size
|
||||
- tune.h2.initial-window-size
|
||||
- tune.http.cookielen
|
||||
- tune.http.logurilen
|
||||
- tune.http.maxhdr
|
||||
@ -1375,6 +1376,16 @@ tune.h2.header-table-size <number>
|
||||
memory is consumed for each HTTP/2 connection. It is recommended not to
|
||||
change it.
|
||||
|
||||
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 acknowledgement from haproxy. This setting
|
||||
only affects payload contents (ie: the body of POST requests), not headers.
|
||||
The default value is 65535, 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
|
||||
clients. It doesn't affect resource usage.
|
||||
|
||||
tune.http.cookielen <number>
|
||||
Sets the maximum length of captured cookies. This is the maximum value that
|
||||
the "capture cookie xxx len yyy" will be allowed to take, and any upper value
|
||||
|
18
src/mux_h2.c
18
src/mux_h2.c
@ -18,6 +18,7 @@
|
||||
|
||||
/* 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 */
|
||||
|
||||
|
||||
/*****************************************************************/
|
||||
@ -146,6 +147,22 @@ static int h2_parse_header_table_size(char **args, int section_type, struct prox
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* config parser for global "tune.h2.initial-window-size" */
|
||||
static int h2_parse_initial_window_size(char **args, int section_type, struct proxy *curpx,
|
||||
struct proxy *defpx, const char *file, int line,
|
||||
char **err)
|
||||
{
|
||||
if (too_many_args(1, args, err, NULL))
|
||||
return -1;
|
||||
|
||||
h2_settings_initial_window_size = atoi(args[1]);
|
||||
if (h2_settings_initial_window_size < 0) {
|
||||
memprintf(err, "'%s' expects a positive numeric value.", args[0]);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/****************************************/
|
||||
/* MUX initialization and instanciation */
|
||||
@ -175,6 +192,7 @@ static struct alpn_mux_list alpn_mux_h2 =
|
||||
/* config keyword parsers */
|
||||
static struct cfg_kw_list cfg_kws = {ILH, {
|
||||
{ CFG_GLOBAL, "tune.h2.header-table-size", h2_parse_header_table_size },
|
||||
{ CFG_GLOBAL, "tune.h2.initial-window-size", h2_parse_initial_window_size },
|
||||
{ 0, NULL, NULL }
|
||||
}};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user