Live data from Hacker News

Epoll vs. io_uring in Linux

sibexi.co

51–60 of 79 posts

Re: Epoll vs. io_uring in Linux

#51
post #44
post #31

Earlier quoted context omitted.

The main reason why it gets disabled is fixed now, the latest RC got cBPF support and as such you can restrict what OPs can be run now instead of just fully disabling it.

Well the reason it's disabled now is the recent history of pretty bad vulnerabilities. It probably needs to go a while without new vulnerabilities before it makes sense to enable by default. It's pretty complex completely unsafe C code, after all.

It's not complex actually, but it is C...

Re: Epoll vs. io_uring in Linux

#53

The author takes a very benchmark focus on this topic which only says part of the story particularly for complex systems. Noticed that there are a number of very similar interface that exist on other platform like windows long before io_uring, but that does make Linux’s I/O system worse or slow than these platforms. A fast server is likely fast in either multiplexing or async API if implemented correctly in almost al…

I'm now a Windows developer, mostly working with Linux and FreeBSD. Thx for the point, I'll look how it works in Windows systems.

Equivalent in Windows is Registered I/O (RIO) for sockets.

Windows network development is really, really different from Unixy stuff. But you might have fun :)

Re: Epoll vs. io_uring in Linux

#54
post #32

Earlier quoted context omitted.

That’s solved as of last week, you can use cBPF now to disable functionality.

How solved? AFAIK it's not meaningfully shipped but happy to hear otherwise.

you can now disable opertions with cBPF, like you would be able to with seccomp for normal syscalls.

Re: Epoll vs. io_uring in Linux

#55

Earlier quoted context omitted.

Boost is so inconvenient, they're huge dynamic libraries that are a pain to build and use. Even when I was already using CMake, getting Boost installed in a way where it could be discovered was super annoying. (I was on Mac, though)

Asio also comes in standalone form and both versions are header-only. Not necessarily directly related to your comment but adding it on, anyway.

[deleted]

Re: Epoll vs. io_uring in Linux

#56

Boost asio if you love C++ and asynchronous networking.

Boost is so inconvenient, they're huge dynamic libraries that are a pain to build and use. Even when I was already using CMake, getting Boost installed in a way where it could be discovered was super annoying. (I was on Mac, though)

Some (most?) Boost libraries are header-only. Including Boost.Asio nowadays.

Re: Epoll vs. io_uring in Linux

#58
post #11

> But my students weren’t as happy as I was - they wanted to build something genuinely useful, and they were really disappointed that our “product” had strong architectural limits and couldn’t outperform titans like nginx and haproxy. I took a (very brief) look at the github repo [1], it doesn't look like you're doing anything with cpu pinning. You can probably eke (thanks) out a bit more performance if you cpu pin y…

Basically, v0 and v1 of the repo is completely different implementations, written almost from scratch. Now working on the 3rd one implementation, I believe the last one. :) Completely different architectural choices was made.

Thanks for the write up. So the first version was synchronous, second version was using epoll and third one will be use io_uring?

Re: Epoll vs. io_uring in Linux

#59

Earlier quoted context omitted.

That’s paradoxically what you can expect on a busy server - your CPU can spend time doing work that would have been previously IO wait time. Of course, it could be a bug in the implementation where you’re spinning doing no work erroneously, but depends on the details.

This makes no sense. Epoll is already non-blocking, you never waste time waiting for I/O as long as there is work to do. Io_uring only boosts CPU efficiency (batching of syscalls, for example), it does not reduce blocking.

Your right, I was imprecise with my wording. You waste time doing context switches + mapping/unmapping CPU buffers meaning for a given unit of time you can churn through more I/O meaning your user space CPU time goes up and system time goes down.
Post reply on HN