haproxy/include/haproxy/quic_pacing.h
Amaury Denoyelle cb91ccd8a8 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.
2025-01-23 17:40:48 +01:00

22 lines
493 B
C

#ifndef _HAPROXY_QUIC_PACING_H
#define _HAPROXY_QUIC_PACING_H
#include <haproxy/quic_pacing-t.h>
#include <haproxy/list.h>
#include <haproxy/quic_frame.h>
static inline void quic_pacing_init(struct quic_pacer *pacer,
const struct quic_cc *cc)
{
pacer->cc = cc;
pacer->cur = 0;
pacer->credit = 0;
}
void quic_pacing_sent_done(struct quic_pacer *pacer, int sent);
int quic_pacing_reload(struct quic_pacer *pacer);
#endif /* _HAPROXY_QUIC_PACING_H */