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

implement io_uring? #1355

Closed
superdolt opened this issue Oct 3, 2021 · 7 comments
Closed

implement io_uring? #1355

superdolt opened this issue Oct 3, 2021 · 7 comments

Comments

@superdolt
Copy link

implement io_uring?

@ghost
Copy link

ghost commented Oct 5, 2021

It's not a priority because

a) none of my computers perform better with io_uring (as of Linux 5.13, things are being optimized for 5.16 but still)
b) adopting it would mean complete rewrite of many parts (io_uring is proactor, while epoll is reactor)
c) when QUIC support comes, it will use sendmmsg and recvmmsg which are already capable of sending/receiving many packets per syscall

@superdolt
Copy link
Author

a) eventually will be there.
b) it's said to be able to perform much faster by 2x-755x benchmark somewhere
c) do agree quic is more important for now. thx in advance. great work by the way. huge fan.

d) pls get the proxy example up if possible. really hope to try it out as a proxy. but do get quic out first and io_uring coz i intend to build on the proxy part. seems uwebsocket http as proxy can be the best thing since slice bread.

@ghost
Copy link

ghost commented Oct 10, 2021

I've checked with io_uring since I first heard of it and never seen any improvement on my machines (I have old Intel machines). On ARM64 I can see a small gain now with 5.13, about 13% better in ideal scenarios.

This is on Raspberry PI 4, however this is with mitigations on. Similar can be seen on my old Intel machines, but I'm still pretty sure mitigations off still runs faster with epoll.

If you plan to shove tons of data to from kernel space then obviously io_uring is better since you can map memory and pass it zero copy, but we are not doing that here we only care about small message sending and I still can't see any significant wins that would still be there with mitigations off.

Also it takes time for these new kernels to become mainstream and spread to the audience.

I'm going to see if I can beat my records on this Raspberry PI 4 over LAN, but this all still runs insignificantly better/worse for motivating such a big architectural change (with all the drawbacks associated).

@zorro-fr24
Copy link

zorro-fr24 commented Oct 10, 2021 via email

@ghost
Copy link

ghost commented Oct 12, 2021

When I started testing io_uring back in 5.4 (or whatever) it had really bad perf. for my machines. It definitely did not perform any better than epoll in fact it sucked really hard (despite everyone blindly jumping on the hype train). Today with 5.13 and 5.14 it does seem to run at least as fast as epoll, even with mitigations off, so they are making progress. However I still cannot see any significant perf improvement for the cases I'm testing - it performs the same or like 1% better.

I'm talking about stuff like getting 128k msg/sec vs getting 130 msg/sec on all CPU-cores or like 55 msg/sec vs. 51-60 msg/sec on a single CPU-core.

Sure, I can get 2 more msg/sec in best possible case but that's insignificant and statistically uncertain. The only conclusion I can make right now is - it does NOT perform WORSE than epoll today. But that's not really enough motivation to bother.

Come back in a year and I can test it again, see where perf. is at. Whenever there is SIGNIFICANT perf. improvement I will certainly bake it into uSockets.

@markg85
Copy link

markg85 commented Jan 27, 2024

Come back in a year and I can test it again, see where perf. is at. Whenever there is SIGNIFICANT perf. improvement I will certainly bake it into uSockets.

Here's the ping for "a year" later (well.. make that well over 2 years).
I'd be surprised if io uring isn't beneficial at this point.
If it's not you might need to fiddle with io uring specific knobs in which case i'd suggest to just ping the io uring author, he seems to be responsive and willing to help.

@uNetworkingAB
Copy link
Contributor

It is tracked here #1603

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants