dotnet/aspnetcore

HTTP/3: Enable in Kestrel by default

JamesNK opened this issue ยท 9 comments

Turn on HTTP/3 by default in .NET 7, i.e. default protocol is Http1AndHttp2AndHttp3. ๐ŸŒถ๏ธ ๐Ÿ”ฅ ๐Ÿ’ฅ

Should do this sooner rather than later to get feedback in .NET 7 previews.

Before we enable H3 by default, we need:

  • #34858
  • Performance needs to match/exceed H2
  • SNQuic team needs to consider SNQuic stable
  • #41762

HTTP/3 support has now been enabled by default in HttpClient (dotnet/runtime#73153). I'm nervous about doing this in .NET 7 for Kestrel though. I feel that HTTP/2 had more bake time before we enabled it by default.

I'm worried we're not properly hardened and perf tested given issues like dotnet/runtime#49972 and #32034. @stephentoub

@sebastienros Do we have any HTTP/2 vs HTTP/3 benchmarks? Anything on https://aka.ms/aspnet/benchmarks?

HTTP/3 support has now been enabled by default in HttpClient

You still need to opt-in to sending HTTP/3 requests, e.g. set the http message request version to 3.0, or set the version policy to request version or higher. It's just that before that PR, you also had to toggle an appcontext switch or else HTTP/3 wasn't available at all.

I see. That's similar to how you currently have to opt-in with HttpProtocols.Http3 (or more likely HttpProtocols.Http1AndHttp2AndHttp3 for the alt-svc header to work) for Kestrel.

We removed the preview flags from HttpProtocol.Http3 and HttpProtocol.Http1AndHttp2AndHttp3 in Kestrel many previews ago.

I'm leaning towards leaving HTTP/3 opt-in in .NET 7 for Kestrel. We haven't seen any issues reported for it. Either there are no bugs or problems, or few people are using it so far.

Do you know if the communication between IIS and Kestrel in out-of-process scenario is upgraded to HTTP/3 (for .NET 7) by default if it's supported by both servers ?

https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/http3?view=aspnetcore-6.0

HTTP/3 is supported with ASP.NET Core in the following IIS deployment scenarios:

  • In-process
  • Out-of-Process. In Out-of-Process, IIS responds to the client using HTTP/3, but the reverse proxy connection to the Kestrel server uses HTTP/1.1.

If HTTP/3 were "Enabled by default" then would that mean a client connecting would get upgraded to HTTP/3 without a specific opt-in?
I think that would mean that services behind a TCP load balancer (not UDP) would have clients told to upgrade to HTTP/3, fail to connect over UDP, then need to come back on HTTP/2 over TCP. Not sure what the performance impact would be on connections in that scenario.

Thanks for contacting us.

We're moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.