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

HTTP/3: Pool QuicStreamContext instances #34075

Merged
merged 4 commits into from
Jul 16, 2021
Merged

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Jul 4, 2021

Addresses #33680

There are a lot of allocations per HTTP/3 request (transport + stream + pipes + output writer + frame writer + QPack encoder/decoder). I'm pretty sure performance is going to be terrible without pooling. Note that this doesn't pool System.Net.Quic.QuicStream, which currently doesn't support reuse, but should be able to in the future.

Will wait on merging this PR for basic benchmarks.

TODO:

  1. CanReuse isn't quite finished. Needs to take into account explicit aborts and errors from QUIC client.
  2. What happens to features on the stream context? Known features are reset but new features aren't cleared.
  3. This only pools QuicStreamContext. The next step is to stash Http3Stream in the feature on the stream context and reuse (how does that overlap with clearing features?)

@Tratcher
Copy link
Member

Tratcher commented Jul 9, 2021

2. What happens to features on the stream context? Known features are reset but new features aren't cleared.

The feature collection needs to be cleared/reset between uses.

@JamesNK JamesNK force-pushed the jamesnk/http3-quicstreampooling branch from 75ef80d to 45dfcaf Compare July 13, 2021 02:21
@JamesNK JamesNK force-pushed the jamesnk/http3-quicstreampooling branch from 45dfcaf to df76007 Compare July 13, 2021 08:51
/// <summary>
/// Abstracts the system clock to facilitate testing.
/// </summary>
internal interface ISystemClock
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢

@JamesNK
Copy link
Member Author

JamesNK commented Jul 16, 2021

Will perf test this together with HTTP/3 stream pooling.

@JamesNK JamesNK merged commit 17f59a9 into main Jul 16, 2021
@JamesNK JamesNK deleted the jamesnk/http3-quicstreampooling branch July 16, 2021 03:58
@ghost ghost added this to the 6.0-rc1 milestone Jul 16, 2021
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants