-
Notifications
You must be signed in to change notification settings - Fork 50
Flow Control for HTTP/1.1 and HTTP/2 #714
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
base: main
Are you sure you want to change the base?
Conversation
awscrt/aio/http.py
Outdated
| conn_window_size_threshold (Optional[int]): Connection window size threshold. | ||
| If None, uses default value. | ||
|
|
||
| stream_window_size_threshold (Optional[int]): Stream window size threshold. | ||
| If None, uses default value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explain all of those configuration more in the doc.
I really cannot tell what they are without digging into the implementation.
eg:
stream_window_size_threshold (Optional[int]): HTTP/2 only. Threshold for sending
WINDOW_UPDATE frames for streams. To reduce network traffic, the client batches
window updates and only sends a WINDOW_UPDATE frame when the stream's flow-control
window drops below this threshold. If None, a reasonable default value is used
awscrt/aio/http.py
Outdated
| read_buffer_capacity (Optional[int]): Read buffer capacity for the connection. | ||
| If None, uses default value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is http/1.1 only.
The design is that AIOHttpClientConnectionUnified only takes configurations that applies to both protocol. The settings that only applies to one protocol should only be part of the protocol specific class.
awscrt/aio/http.py
Outdated
| read_buffer_capacity (Optional[int]): Read buffer capacity for the connection. | ||
| If None, uses default value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explain this.
/**
* Optional
* Capacity in bytes of the HTTP/1 connection's read buffer.
* The buffer grows if the flow-control window of the incoming HTTP-stream
* reaches zero. If the buffer reaches capacity, no further socket data is
* read until the HTTP-stream's window opens again, allowing data to resume flowing.
*
* Ignored if `manual_window_management` is false.
* If zero is specified (the default) then a default capacity is chosen.
* A capacity that is too small may hinder throughput.
* A capacity that is too big may waste memory without helping throughput.
*/
size_t read_buffer_capacity;
It seems like it controls the buffer when the connection read from the socket while the data cannot be delivered to stream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, the easy thing to do is to not expose this. This really just control the memory usage if people wanted to. There is no current ask, and it seems a bit confusing about what it can be used. We can add them later if needed.
Issue #, if available:
Description of changes:
Python API (awscrt/http.py, awscrt/aio/http.py):
C Bindings (source/http_connection.c):
Tests:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.