dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.38k stars 9.99k forks source link

HTTP/2 #4782

Closed ThatRendle closed 5 years ago

ThatRendle commented 9 years ago

Are there any immediate plans to add HTTP/2 support?

natemcmaster commented 7 years ago

The api review to add alpn to sslstream was rejected.

@Drawaes where are you getting that info? https://github.com/dotnet/corefx/issues/4721 is still open. Adding ALPN to SslStream is currently in the "Future" milestone. That doesn't mean "no", it just means "not yet".

Drawaes commented 7 years ago

Okay maybe "rejected" is a bit strong, but it's been in uservoice since at least 2014, and gone from milestone -> feature -> wishlist? So you can see that one from the outside might wonder what is going on. Most major platforms (including windows SChannel) support it, baring Apple and with it's now blocking Http2.

Someone did you a PR, sure it needs an API change, but 4 years since it popped up on user voice is probably enough to get that sorted. I mean it doesn't have to be supported on every platform, there are plenty of methods coming to standard 2.0 that will throw (app domains) if run on an unsupported platform.

OpenSsl and SChannel have both supported it for a long time, and do the heavy lifting for you. Other than Crypto being in the "too hard/dangerous basket" what are the other issues?

SNI and ALPN are pretty much the low bar for any modern web client or server and to just not have them is disappointing, so as one member of the community and I am sure there are many others...

If the API change is really impossible then maybe it's time to have a side by side library.

What can we do to help you guys on this issue?

otabekgb commented 7 years ago

I also think HTTP 2 should be considered as urgent and important. At least it should be put into time- predictible milestone. Otherwise, people won't take kestrel server serious.

otabekgb commented 7 years ago

Just checked, it is the most commented one among open issues. This should be an important metric.

FDUdannychen commented 7 years ago

+1 This issue lasts more than 2 years...

figuerres commented 7 years ago

Something I do not understand is that I have seen claims of how fast kestrel is. But if we need is as a front end then how can kestrel be any faster than Iis ? Or is its able to be as fast as kestrel but iis has some crap code that needs to be fixed ?

Drawaes commented 7 years ago

The issue is similar (although with Unix sockets it's certainly quicker) with NGNIX in that you are running a process hop with anything "infront". IIS is certainly not slow but adding a process hop and copy costs.

ThatRendle commented 7 years ago

Regarding proxies (Nginx/HAProxy/Apache/Traefik) in front of Kestrel, it is true that those proxies just terminate HTTP/2 and pass regular old HTTP/1.1 requests to the upstream server (or at least they did the last I checked, and weren't much interested in proxying HTTP/2 upstream). So for internet-facing applications, where running behind a proxy is recommended, there's not much urgency for this, I guess.

But for intranet applications, or for people who specifically choose a full HTTP/2 proxy like H2O or nghttpx so that they can use features like Server Push, having HTTP/2 support would still be very cool.

And who knows, maybe in the not-too-distant future, Kestrel will be so completely awesome that we're building the next generation of proxy server on it :rocket:

ThatRendle commented 7 years ago

@figuerres It's not so much about raw speed in terms of time-to-first-byte for each individual user; it's more about scalability and time-to-last-byte. The current industry-standard proxies (Nginx and HAproxy) are incredibly fast compared to most web frameworks, so while they may add a millisecond or two for a network hop, they're not going add any slow-down to applications built on regular general-purpose web frameworks.

The push to make Kestrel fast is to achieve a similar thing: the web server component shouldn't be adding friction to your application in terms of elapsed time, CPU cycles, heap allocations or whatever. The side-effect of aiming for that is that you get something that can do "plaintext" 200 OK Hello World nearly 2 million times a second.

figuerres commented 7 years ago

@markrendle i guess my question or issue is better stated this way:

I just want a good fast server to host my apps, i want to have a simple deployment and infrastructure. but i hear this talk about how amazing fast this thing is compared to that thing.

in the end it's just confusing things from my view.

if this Kestrel is not replacing iis then it sounds to me like more work to deploy and not much benefit. from what i have seen so far

possibly i have this all wrong.... but it sounds like it's that from what i have seen on this thread.

not that i have to have iis , just that it's the "standard" for a windows server.

we had the old IIS up to 7 that needed ISAPI , then 7 to 10 that have been reworked to clean up things a lot, then we have OWIN and KATANA stuff to manage and now this Kestrel thing....

lot's a messing with the plumbing and a lot of confusion on what the real path is going to be for the future.

I want a good http/2 production server that is clean and deploys well, if it uses code from kestrel ok, if not that's ok too.

benaadams commented 7 years ago

I want a good http/2 production server that is clean and deploys well, if it uses code from kestrel ok, if not that's ok too.

IIS 10 (on Windows Server 2016) gives you HTTP/2. Install Windows Server Hosting (x64 & x86) on the server. Then copy the output from dotnet publish to a site as you would for an MVC5 app.

It will use Kestrel to run ASP.NET Core; then communicate with IIS over localhost which is very low latency; between your users and the server (IIS) it will use HTTP/2 (if over https) and IIS will also do the https offload and you can configure the certs etc in IIS as normal.

redknightlois commented 7 years ago

Hi Guys,

Do we have any ETA for HTTP/2 support for Kestrel? Asking because we are suffering from head of line queueing performance issues that are holding us back (a testament to how good Kestrel performance is :) ). We are analyzing to go full RPC style to unlock the issue, but we want to avoid it if possible.

Would be great to have an official response if there is any.

Tratcher commented 7 years ago

No ETA, the dependencies like SslStream ALPN haven't even started yet.

davidfowl commented 7 years ago

We've started working on it.

lodejard commented 7 years ago

Yay! gRPC next? ;)

listepo commented 6 years ago

Hi, any news about gRPC support?)

muratg commented 6 years ago

We now have HTTP2 label tracking the actual HTTP2 work.

codecadwallader commented 6 years ago

Any news about server side push?

Tratcher commented 6 years ago

Hey folks, HTTP/2 support is live in 2.2.0-preview1! We've got more work to do, but do yourselves a favor and try it out. The sooner you file bugs the more likely we'll be able to address them for 2.2. https://blogs.msdn.microsoft.com/webdev/2018/08/22/asp-net-core-2-2-0-preview1-http-2-in-kestrel/ https://blogs.msdn.microsoft.com/webdev/2018/08/22/asp-net-core-2-2-0-preview1-now-available/

aspnet-hello commented 5 years ago

We periodically close 'discussion' issues that have not been updated in a long period of time.

We apologize if this causes any inconvenience. We ask that if you are still encountering an issue, please log a new issue with updated information and we will investigate.