-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Use io_uring for io operations #2140
Comments
Yes we've been actively looking into this. |
I have some attempts, and currently ritsu can be used in combination with hyper. :D https://github.com/quininer/ritsu/blob/master/ritsu-hyper/src/main.rs |
@quininer I will try that code, have you seen some improvement in performance? |
@andresmargalef I am currently not focus performance improvement. |
Have any of you had a look at rio? It seems to be a safe approach to io_uring |
AFAIK there is no way to build safe&sound API on top of io_uring without redesigning Tokio IO traits. |
Also would add you can use Glommio which uses io_uring internally: https://github.com/DataDog/glommio/blob/master/examples/hyper.rs |
#577 |
Tokio is working on io-uring here |
Any web framework which supports io_uring? |
Unlikely given that most frameworks are built on top of hyper. There is this actix/actix-web#2404 but thats specifically for files 🤷 |
So, any next-generation web framework which will supports io_uring in the future? |
just support monoio and then we dont have to keep on upgrading for speed. right? the world is complicated enough |
I have a runtime that is based on io_uring: Heph, which is based on A10. I'm trying to port Hyper's client to it, but its I/O traits will not work with io_uring (without introducing an intermediary buffer). Taking pub trait Read {
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: ReadBufCursor<'_>
) -> Poll<Result<(), Error>>;
} The problem is the lifetime in With completion based I/O, such as io_uring, this doesn't work. With completion based I/O you pass a mutable reference to the buffer to the kernel which it keeps around until the For A10 the only solution to this problem I could come up with is that the I'm not exactly sure how this would change Hyper's I/O traits though. I've been thinking about a an owned version of Maybe we can use something similar to the Long post, but I hope it highlights some of the major blockers of using Hyper with a completion based I/O implementation. |
This comment has been minimized.
This comment has been minimized.
@Thomasdezeeuw One alternative to the owned buffer could be to replace |
Except that's not long enough. The future can be dropped at any time, however the read operation might still be ongoing, which means the kernel still has mutable access to the buffer even after the future is dropped. Either you have to do a synchronous cancel in the future's |
And even that's not safe, right? The future might be leaked via |
It's only safe if the buffer is heap (or not stack) allocated. Because then the buffer is leaked and the kernel still has safe mutable access. |
I don't know if this is for hyper, tokio or mio but it is interesting to use the new io stack from linux 5.1 +.
In async java world there is interest to start to support the new feature.
Copy&paste that issue here
The text was updated successfully, but these errors were encountered: