Skip to content

Is RIO going to be Kestrel's default networking engine? #1903

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

Closed
mnns opened this issue Jan 17, 2017 · 10 comments
Closed

Is RIO going to be Kestrel's default networking engine? #1903

mnns opened this issue Jan 17, 2017 · 10 comments

Comments

@mnns
Copy link

mnns commented Jan 17, 2017

Is RIO going to be integrated into Kestrel anytime soon?
Why shouldn't it be the standard, instead of libuv? I mean, it is faster in most cases... isn't it?

@Tratcher
Copy link
Member

@halter73

@halter73
Copy link
Member

aspnet/KestrelHttpServer#828 Is work that should help us enable that. There are some trade-offs with RIO, so we will probably have people opt in to using RIO and allow developers to configure RIO-specific settings.

@mnns
Copy link
Author

mnns commented Jan 18, 2017

What are the trade-offs with RIO? As far as I've seen in some tests, it works faster and better than plain socket and simple IOCP. We all want people to start talking about ASP.NET Core and .NET core in general. Performance is a great tool to get them started. If RIO still has some pitfalls (which I'm not yet aware of), I think MSFT should concentrate on making it flawless so they could market .NET Core as a fast, reliable, lean and cross platform (also cross ISA) framework.

BTW, if you ask developers why they switched to NodeJS (and many have) they will almost automatically shout the "Asynchronous Non Blocking I/O" as if its Node's slogan. Why shouldn't Microsoft attract developers with even a faster, leaner approach?

Kestrel can use netmap for Linux and RIO for Windows.

@mnns mnns changed the title Is RIO going to be used in Kestrel? Is RIO going to be Kestrel's default networking engine? Jan 18, 2017
@halter73
Copy link
Member

I'm not an expert on RIO, so the short answer to the new title is that I don't know if RIO will be made the default. We'll be able to make a more informed decision once we build the RIO transport.

@mnns Are aware of any other production HTTP server that uses RIO and/or netmap (which seems to be a kernel module you need to manually install on Linux)? If so, that could certainly help our investigation. It's interesting you bring up NodeJS which, as I'm sure you are aware, is what libuv was built for.

@benaadams worked on an experimental RIO server a while back that I've taken a quick look at. One big issue seems to be is that every connection needs to have a unique (as in not shared with other concurrent connections) buffer constantly registered. This could lead the RIO server to consume a lot more memory than the equivalent libuv/socket based server given a lot of idle connections.

Without knowing ahead of time whether or not a given connection would be saturated or idle, it could be difficult to determine the optimal size of the registered buffer in order not to waste too much memory on idle connections while maintaining perf for active ones.

It's entirely possible we could work around the memory usage with some smart heuristics, but I'm not able to commit to making RIO the default networking engine without further investigation.

@mnns
Copy link
Author

mnns commented Jan 19, 2017

@halter73 Yep, NodeJS is using libuv and that's exactly why I think we should make ASP.NET Core better and faster than NodeJS, especially if we have the tools and technology (RIO), as we do right now.

Also, like you said, I'm sure that constantly registered connection buffers memory consumption can be easily mitigated with some simple heuristics. I'm no expert on RIO, but I've ran some tests and the numbers are extremely impressive, even unusual for a Windows machine.

Imagine the market impact if MSFT would announce a cross platform, cross ISA, modular, easy to deploy, extremely fast web server that utilizes cutting edge networking methodologies, both on Linux and on Windows. Add some PHP/ASP-like simple scriptable HTML web pages and you've got the best server in the market (only then add the bloated MVC overhead as an option, but that's another issue).

@mnns
Copy link
Author

mnns commented Aug 7, 2017

Any thoughts guys?

@benaadams
Copy link
Member

The transport refactoring has already happened to a degree https://github.com/aspnet/KestrelHttpServer/tree/dev/src

Kestrel.Transport.Abstractions
Kestrel.Transport.Sockets
Kestrel.Transport.Libuv

So RIO would become just another Transport aspnet/KestrelHttpServer#1630

However there are bigger changes for the whole stack that means it will be easier for everyone to take advantage of these changes https://github.com/aspnet/KestrelHttpServer/issues/1980

@aspnet-hello
Copy link

This issue is being closed because it has not been updated in 3 months.

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

@davidalpert
Copy link

davidalpert commented Dec 30, 2017 via email

@davidalpert
Copy link

davidalpert commented Dec 30, 2017 via email

@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants