Skip to content

Conversation

@halter73
Copy link
Member

@halter73 halter73 commented Aug 15, 2022

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
Copy link
Member Author

halter73 commented Aug 15, 2022

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
Member Author

/backport to release/7.0-rc1

@github-actions
Copy link
Contributor

Started backporting to release/7.0-rc1: https://github.com/dotnet/aspnetcore/actions/runs/2870724507

@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