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

Provide an option to auto-tune the connection flow control window #453

Open
glbrntt opened this issue Jul 26, 2024 · 0 comments
Open

Provide an option to auto-tune the connection flow control window #453

glbrntt opened this issue Jul 26, 2024 · 0 comments

Comments

@glbrntt
Copy link
Contributor

glbrntt commented Jul 26, 2024

Having appropriately sized flow control windows can have a significant effect on the throughput of a connection. If the window is too small then connections can stall waiting for WINDOW_UPDATEs.

The bandwidth-delay-product (BDP) of a connection measures how much data can fit "on the wire". gRPC implementations (but not grpc-swift, yet) do this by estimating the BDP and comparing it to the current connection window size and adjusting it as appropriate.

The algorithm works as follows: when a DATA frame is received and there is no PING frame waiting for an ACK then note the current time and begin counting the number of flow controlled bytes (including the just received DATA frame) and send a PING frame to the remote peer. When a PING ACK is received, compute the round-trip-time.

The product of the number of flow controlled bytes received and the RTT is an effective measure of 1.5 * BDP (as there was half-a-round-trips worth of DATA already on the wire when the first PING was sent). If this value is close to the current flow control window size then the window should be increased in size. If it is low enough (say, 2/3 of the current window size) then the window size can be reduced (to shrink buffer sizes).

This is described in some more detail here.


I'll likely experiment with this in gRPC first and report back.

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

No branches or pull requests

1 participant