perf(http2): improve default HTTP2 flow control settings

Set default HTTP2 window sizes much larger values than the spec default.

ref #1960
This commit is contained in:
Sean McArthur
2019-10-08 15:37:33 -07:00
parent b4dbad6dbf
commit 22695968d2
5 changed files with 104 additions and 15 deletions

View File

@@ -306,7 +306,9 @@ impl<I, E> Builder<I, E> {
/// Sets the [`SETTINGS_INITIAL_WINDOW_SIZE`][spec] option for HTTP2
/// stream-level flow control.
///
/// Default is 65,535
/// Passing `None` will do nothing.
///
/// If not set, hyper will use a default.
///
/// [spec]: https://http2.github.io/http2-spec/#SETTINGS_INITIAL_WINDOW_SIZE
pub fn http2_initial_stream_window_size(mut self, sz: impl Into<Option<u32>>) -> Self {
@@ -316,7 +318,9 @@ impl<I, E> Builder<I, E> {
/// Sets the max connection-level flow control for HTTP2
///
/// Default is 65,535
/// Passing `None` will do nothing.
///
/// If not set, hyper will use a default.
pub fn http2_initial_connection_window_size(mut self, sz: impl Into<Option<u32>>) -> Self {
self.protocol.http2_initial_connection_window_size(sz.into());
self
@@ -325,7 +329,7 @@ impl<I, E> Builder<I, E> {
/// Sets the [`SETTINGS_MAX_CONCURRENT_STREAMS`][spec] option for HTTP2
/// connections.
///
/// Default is no limit (`None`).
/// Default is no limit (`std::u32::MAX`). Passing `None` will do nothing.
///
/// [spec]: https://http2.github.io/http2-spec/#SETTINGS_MAX_CONCURRENT_STREAMS
pub fn http2_max_concurrent_streams(mut self, max: impl Into<Option<u32>>) -> Self {