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

Configure receive window size for auto flow control #1280

Open
jonathanslenders opened this issue Feb 6, 2024 · 2 comments
Open

Configure receive window size for auto flow control #1280

jonathanslenders opened this issue Feb 6, 2024 · 2 comments

Comments

@jonathanslenders
Copy link

When using auto flow control through acknowledge_receive_data, is there a way to configure the receive window (for both the connection and the stream)?

I know that we can set the INITIAL_WINDOW_SIZE for streams, and the WindowManager will use this setting for the max window size. Unfortunately, at the connection level, the window size remains pretty small, I think at 64k.

We're in a situation with higher than usual round-trip-times, so, I'd like to increase window sizes, but still use auto flow control if possible.

@jonathanslenders
Copy link
Author

There is a solution I found that seems to work:

  • To increase the flow control window of the connection, we can call conn.increment_flow_control_window(1024*1024, stream_id=None right after conn.initiate_connection(). This will increase the max_window_size of the WindowManager, which will be used from then onwards.

  • The flow control window of the stream can be configured through the INITIAL_WINDOW_SIZE setting at the start.

That seems to do the job. I'm somewhat confused by this, wondering whether it's the right approach. The docs about "Auto Flow Control" make it seem like we no longer have to call increment_flow_control_window, but only acknowledge_received_data However, it looks like if we want a larger window, we have to both change the INITIAL_WINDOW_SIZE setting, and still call increment_flow_control_window once for the connection. Is this correct?

@sethmlarson
Copy link
Member

I haven't dug in whether that's a safe way to do things. This seems like a useful feature though, being able to configure the connection level window separate from initial stream windows.

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

2 participants