MINOR: quic: Tunable "initial_max_streams_bidi" transport parameter

Add tunable "tune.quic.frontend.max_streams_bidi" setting for QUIC frontends
to set the "initial_max_streams_bidi" transport parameter.
Add some documentation for this new setting.
This commit is contained in:
Frédéric Lécaille 2022-05-23 17:28:01 +02:00 committed by Amaury Denoyelle
parent 1d96d6e024
commit 2674098569
6 changed files with 23 additions and 3 deletions

View File

@ -1120,6 +1120,7 @@ The following keywords are supported in the "global" section :
- tune.pool-low-fd-ratio
- tune.quic.conn-buf-limit
- tune.quic.frontend.max-idle-timeout
- tune.quic.frontend.max-streams-bidi
- tune.quic.retry-threshold
- tune.rcvbuf.client
- tune.rcvbuf.server
@ -2954,6 +2955,17 @@ tune.quic.frontend.max-idle-timeout <timeout>
The default value is 30000.
tune.quic.frontend.max-streams-bidi <number>
Warning: QUIC support in HAProxy is currently experimental. Configuration may
change without deprecation in the future.
Sets the QUIC initial_max_streams_bidi transport parameter for frontends.
This is the initial maximum number of bidirectional streams the remote peer
will be authorized to open. This determines the number of concurrent client
requests.
The default value is 100.
tune.quic.retry-threshold <number>
Warning: QUIC support in HAProxy is currently experimental. Configuration may
change without deprecation in the future.

View File

@ -160,6 +160,7 @@ struct global {
#ifdef USE_QUIC
unsigned int quic_backend_max_idle_timeout;
unsigned int quic_frontend_max_idle_timeout;
unsigned int quic_frontend_max_streams_bidi;
unsigned int quic_retry_threshold;
unsigned int quic_streams_buf;
#endif /* USE_QUIC */

View File

@ -31,6 +31,7 @@ struct tp_preferred_address {
#define QUIC_DFLT_ACK_DELAY_COMPONENT 3 /* milliseconds */
#define QUIC_DFLT_MAX_ACK_DELAY 25 /* milliseconds */
#define QUIC_DFLT_FRONT_MAX_IDLE_TIMEOUT 30000 /* milliseconds */
#define QUIC_DFLT_FRONT_MAX_STREAMS_BIDI 100
#define QUIC_DFLT_BACK_MAX_IDLE_TIMEOUT 30000 /* milliseconds */
#define QUIC_ACTIVE_CONNECTION_ID_LIMIT 2 /* number of connections */

View File

@ -76,6 +76,7 @@ static int cfg_parse_quic_tune_setting(char **args, int section_type,
{
unsigned int arg = 0;
int prefix_len = strlen("tune.quic.");
const char *suffix;
if (too_many_args(1, args, err, NULL))
return -1;
@ -88,9 +89,12 @@ static int cfg_parse_quic_tune_setting(char **args, int section_type,
return -1;
}
if (strcmp(args[0] + prefix_len, "conn-buf-limit") == 0)
suffix = args[0] + prefix_len;
if (strcmp(suffix, "conn-buf-limit") == 0)
global.tune.quic_streams_buf = arg;
else if (strcmp(args[0] + prefix_len, "retry-threshold") == 0)
else if (strcmp(suffix, "frontend.max-streams-bidi") == 0)
global.tune.quic_frontend_max_streams_bidi = arg;
else if (strcmp(suffix, "retry-threshold") == 0)
global.tune.quic_retry_threshold = arg;
else {
memprintf(err, "'%s' keyword not unhandled (please report this bug).", args[0]);
@ -103,6 +107,7 @@ static int cfg_parse_quic_tune_setting(char **args, int section_type,
static struct cfg_kw_list cfg_kws = {ILH, {
{ CFG_GLOBAL, "tune.quic.backend.max-idle-timeou", cfg_parse_quic_time },
{ CFG_GLOBAL, "tune.quic.conn-buf-limit", cfg_parse_quic_tune_setting },
{ CFG_GLOBAL, "tune.quic.frontend.max-streams-bidi", cfg_parse_quic_tune_setting },
{ CFG_GLOBAL, "tune.quic.frontend.max-idle-timeout", cfg_parse_quic_time },
{ CFG_GLOBAL, "tune.quic.retry-threshold", cfg_parse_quic_tune_setting },
{ 0, NULL, NULL }

View File

@ -208,6 +208,7 @@ struct global global = {
#ifdef USE_QUIC
.quic_backend_max_idle_timeout = QUIC_DFLT_BACK_MAX_IDLE_TIMEOUT,
.quic_frontend_max_idle_timeout = QUIC_DFLT_FRONT_MAX_IDLE_TIMEOUT,
.quic_frontend_max_streams_bidi = QUIC_DFLT_FRONT_MAX_STREAMS_BIDI,
.quic_retry_threshold = QUIC_DFLT_RETRY_THRESHOLD,
.quic_streams_buf = 30,
#endif /* USE_QUIC */

View File

@ -45,7 +45,7 @@ static void quic_dflt_transport_params_cpy(struct quic_transport_params *dst)
void quic_transport_params_init(struct quic_transport_params *p, int server)
{
const uint64_t ncb_size = global.tune.bufsize - NCB_RESERVED_SZ;
const int max_streams_bidi = 100;
const int max_streams_bidi = global.tune.quic_frontend_max_streams_bidi;
const int max_streams_uni = 3;
/* Set RFC default values for unspecified parameters. */