MINOR: quic: activate socket per conn by default

Activate QUIC connection socket to achieve the best performance. The
previous behavior can be reverted by tune.quic.socket-owner
configuration option.

This change is part of quic-conn owned socket implementation.

Contrary to its siblings patches, I suggest to not backport it to 2.7.
This should ensure that stable releases behavior is perserved. If a user
faces issues with QUIC performance on 2.7, he can nonetheless change the
default configuration.
This commit is contained in:
Amaury Denoyelle 2022-11-21 11:54:13 +01:00
parent d3083c9df9
commit e30f378236
2 changed files with 20 additions and 17 deletions

View File

@ -3095,17 +3095,17 @@ tune.quic.socket-owner { listener | connection }
Connections can share listener socket or each connection can allocate its Connections can share listener socket or each connection can allocate its
own socket. own socket.
Default "listener" value indicates that QUIC transfers will occur on the When default "connection" value is set, a dedicated socket will be allocated
shared listener socket. This option can be a good compromise for small by every QUIC connections. This option is the preferred one to achieve the
traffic as it allows to reduce FD consumption. However, performance won't be best performance with a large QUIC traffic. However, this relies on some
optimal due to a higher CPU usage if listeners are shared accross a lot of advanced features from the UDP network stack. If your platform is deemed not
threads or a large number of QUIC connections can be used simultaneously. compatible, haproxy will automatically switch to "listener" mode on startup.
If "connection" value is set, a dedicated socket will be allocated by every The "listener" value indicates that QUIC transfers will occur on the shared
QUIC connections. This option is the preferred one to achieve the best listener socket. This option can be a good compromise for small traffic as it
performance with a large QUIC traffic. However, this relies on some advanced allows to reduce FD consumption. However, performance won't be optimal due to
features from the UDP network stack. If your platform is deemed not a higher CPU usage if listeners are shared accross a lot of threads or a
compatible, haproxy will automatically revert to "listener" mode on startup. large number of QUIC connections can be used simultaneously.
tune.rcvbuf.client <number> tune.rcvbuf.client <number>
tune.rcvbuf.server <number> tune.rcvbuf.server <number>
@ -4622,13 +4622,13 @@ bind /<path> [, ...] [param*]
to receive a FD over the unix socket and uses it as if it to receive a FD over the unix socket and uses it as if it
was the FD of an accept(). Should be used carefully. was the FD of an accept(). Should be used carefully.
- 'quic4@' -> address is resolved as IPv4 and protocol UDP - 'quic4@' -> address is resolved as IPv4 and protocol UDP
is used. Note that by default QUIC connections attached is used. Note that to achieve the best performance with a
to a listener will be multiplexed over the listener large traffic you should keep "tune.quic.conn-owner" on
socket. With a large traffic this has a noticeable impact connection. Else QUIC connections will be multiplexed
on performance and CPU consumption. To improve this, you over the listener socket. Another alternative would be to
can change default settings of "tune.quic.conn-owner" to duplicate QUIC listener instances over several threads,
connection or at least duplicate QUIC listener instances for example using "shards" keyword to at least reduce
over several threads, for example using "shards" keyword. thread contention.
- 'quic6@' -> address is resolved as IPv6 and protocol UDP - 'quic6@' -> address is resolved as IPv6 and protocol UDP
is used. The performance note for QUIC over IPv4 applies is used. The performance note for QUIC over IPv4 applies
as well. as well.

View File

@ -1577,6 +1577,9 @@ static void init_args(int argc, char **argv)
#endif #endif
#ifdef USE_THREAD #ifdef USE_THREAD
global.tune.options |= GTUNE_IDLE_POOL_SHARED; global.tune.options |= GTUNE_IDLE_POOL_SHARED;
#endif
#ifdef USE_QUIC
global.tune.options |= GTUNE_QUIC_SOCK_PER_CONN;
#endif #endif
global.tune.options |= GTUNE_STRICT_LIMITS; global.tune.options |= GTUNE_STRICT_LIMITS;