Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only send MAX_STREAMS when >1/8 of flow control window is consumed #1898

Merged
merged 3 commits into from
Jun 17, 2024

Conversation

Ralith
Copy link
Collaborator

@Ralith Ralith commented Jun 15, 2024

Minor optimization to reduce outgoing traffic when receiving large numbers of streams. Mirrors existing logic for data flow control, e.g.

// Only announce a window update if it's significant enough
// to make it worthwhile sending a MAX_DATA frame.
// We use a fraction of the configured connection receive window to make
// the decision, to accommodate for connection using bigger windows requiring
// less updates.
let diff = self.local_max_data - self.sent_max_data.into_inner();
ShouldTransmit(diff >= (self.receive_window / 8))

@Ralith Ralith changed the title Only MAX_STREAMS when at last 1/8 of flow control window is consumed Only send MAX_STREAMS when >1/8 of flow control window is consumed Jun 15, 2024
Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@djc djc merged commit c7a2c40 into main Jun 17, 2024
8 checks passed
@djc djc deleted the reduce-stream-id-rate branch June 17, 2024 08:14
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.

2 participants