MEDIUM: quic: use dynamic credit for pacing
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 22 Jan 2025 16:26:13 +0000 (17:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 19 Feb 2025 10:19:38 +0000 (11:19 +0100)
commitfa92739c9ccf8f06644b69404ca609071447ed03
tree8e94dc7804cc0325d6d9455f338f04f38180a8a5
parentfd0e7a105e99db4b39a65594c9fef33c6c8b305f
MEDIUM: quic: use dynamic credit for pacing

Major improvements have been introduced in pacing recently. Most
notably, QMUX schedules emission on a millisecond resolution, which
allow to use passive wait to be much CPU friendly.

However, an issue remains with the pacing max credit. Unless BBR is
used, it is fixed to the configured value from quic-cc-algo bind
statement. This is not practical as if too low, it may drastically
reduce performance due to 1ms sleep resolution. If too high, some
clients will suffer from too much packet loss.

This commit fixes the issue by implementing a dynamic maximum credit
value based on the network condition specific to each clients.
Calculation is done to fix a maximum value which should allow QMUX
current tasklet context to emit enough data to cover the delay with the
next tasklet invokation. As such, avg_loop_us is used to detect the
process load. If too small, 1.5ms is used as minimal value, to cover the
extra delay incurred by the system which will happen for a default 1ms
sleep.

This should be backported up to 3.1.

(cherry picked from commit cb91ccd8a8b548d85bf5155b1a8ce759f1480a4e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
doc/configuration.txt
include/haproxy/quic_pacing.h
src/quic_pacing.c