Skip to content

Allow send capacity buffering beyond a full congestion window - #2583

Open
jeniksv wants to merge 1 commit into
cloudflare:masterfrom
jeniksv:jeniksv/send_capacity_factor
Open

Allow send capacity buffering beyond a full congestion window#2583
jeniksv wants to merge 1 commit into
cloudflare:masterfrom
jeniksv:jeniksv/send_capacity_factor

Conversation

@jeniksv

@jeniksv jeniksv commented Aug 13, 2026

Copy link
Copy Markdown

tx_cap_factor is intended to allow applications to buffer additional stream data ahead of the congestion window. Currently, tx_cap is calculated as minimum of available congestion window and available flow control multiplied by tx_cap_factor. This means that once cwnd_available reaches zero, tx_cap also becomes zero regardless of tx_cap_factor. As a result, the application cannot pre buffer additional stream data while the congestion window is full and quiche needs to wait for more application data after ACKs make congestion window capacity available again.

This change keeps the existing cwnd_available() as the base capacity and adds an extra buffering allowance derived from the total congestion window:

base_cap =
    min(cwnd_available, flow_control_available)
    * min(tx_cap_factor, 1)

extra_cap =
    max((tx_cap_factor - 1) * cwnd - tx_buffered, 0)

tx_cap =
    min(base_cap + extra_cap, flow_control_available)

For values greater than one, the additional capacity no longer depends on cwnd_available being non-zero and quiche can keep stream data buffered even when the current congestion window is fully occupied.

Already buffered stream data is deducted only from the additional buffering allowance, preventing repeated tx_cap updates from granting the same extra capacity again.

The peer's connection-level flow-control limit remains an absolute upper bound and is not scaled by tx_cap_factor.

@jeniksv
jeniksv requested a review from a team as a code owner August 13, 2026 12:18
@jeniksv
jeniksv force-pushed the jeniksv/send_capacity_factor branch from 16d6917 to 0688496 Compare August 13, 2026 12:34
@jeniksv
jeniksv force-pushed the jeniksv/send_capacity_factor branch from 0688496 to 20b1622 Compare August 13, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant