MEDIUM: mux-quic: reduce pacing CPU usage with passive wait
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 22 Jan 2025 16:31:10 +0000 (17:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 19 Feb 2025 10:19:38 +0000 (11:19 +0100)
commitfd0e7a105e99db4b39a65594c9fef33c6c8b305f
tree26afa1dd458eeceb13d0405fa3bcdeb53e3beda9
parenta12f1b573e3a6bbf013fa831e727ac7aa227c2f8
MEDIUM: mux-quic: reduce pacing CPU usage with passive wait

Pacing algorithm has been revamped in the previous commit to implement a
credit based solution. This is a far more adaptative solution, in
particular which allow to catch up in case pause between pacing emission
was longer than expected.

This allows QMUX to remove the active loop based on tasklet wake-up.
Instead, a new task is used when emission should be paced. The main
advantage is that CPU usage is drastically reduced.

New pacing task timer is reset each time qcc_io_send() is invoked. Timer
will be set only if pacing engine reports that emission must be
interrupted. In this case timer is set via qcc_wakeup_pacing() to the
delay reported by congestion algorithm, or 1ms if delay is too short. At
the end of qcc_io_cb(), pacing task is queued if timer has been set.

Pacing task execution is simple enough : it immediately wakes up QCC I/O
handler.

Note that to have decent performance, it requires to have a large enough
burst defined in configuration of quic-cc-algo. However, this value is
common to every listener clients, which may cause too much loss under
network conditions. This will be address in a future patch.

This should be backported up to 3.1.

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