Skip to content

Increase Kestrel's default HTTP/2 upload window sizes - #43302

Merged
halter73 merged 4 commits into
mainfrom
halter73/41825
Aug 16, 2022
Merged

halter73 merged 4 commits into
mainfrom
halter73/41825

Conversation

@halter73

@halter73 halter73 commented Aug 15, 2022 •

Copy link
Copy Markdown
Member

Fixes #41825

This should dramatically improve HTTP/2 upload speeds with high-latency connections using Kestrel's default configuration. Clients are limited by both the connection and stream limits. So even though there could be many streams, Kestrel will still only buffer up to 1MB of request body data for all streams across the entire connection with this new default.

@halter73 halter73 changed the title Increase default upload window sizes HTTP/2 Increase Kestrel's default HTTP/2 upload window sizes Aug 15, 2022
@halter73

halter73 commented Aug 15, 2022 •

Copy link
Copy Markdown
Member Author

I tested this with a 108 MB file upload using a single stream on localhost before and after the default window sizes changes. I induced 10 ms of latency introduced by adding a Task.Delay to Http2FrameWriter.WriteWindowUpdateAsync(int streamId, int sizeIncrement).

We see a ~6x improvement when we're bottlenecked by the WINDOW_UPDATE latency as is the case with 10 ms of latency on localhost. We should theoretically see an 8x improvement from the 8x larger window update, but there could be some other overhead preventing the full theoretical improvement.

Before (10 ms delay before writing WINDOW_UPDATEs)

image

After (10 ms delay before writing WINDOW_UPDATEs)

image

@halter73
halter73 enabled auto-merge (squash) August 15, 2022 23:16
@halter73
halter73 merged commit 77ea9ee into main Aug 16, 2022
@halter73
halter73 deleted the halter73/41825 branch August 16, 2022 19:17
@ghost ghost added this to the 7.0-rc1 milestone Aug 16, 2022
@halter73

Copy link
Copy Markdown
Member Author

/backport to release/7.0-rc1

@github-actions

Copy link
Copy Markdown
Contributor

@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions Perf

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTP/2: Consider increasing default window sizes

6 participants