Epoll vs. Io_uring in Linux

(sibexi.co)

32 points | by Sibexico 1 hour ago

3 comments

  • spliffedr 14 minutes ago
    Take a look at https://github.com/concurrencykit/ck and https://github.com/microsoft/mimalloc, it will fit well for a zero-copy and mem aligned reverse proxy. Also, if you want to add a DDoS protection and more advanced L4 stuff check out https://docs.ebpf.io/ebpf-library/libxdp/libxdp/
  • mrlonglong 1 hour ago
    Boost asio if you love C++ and asynchronous networking.
    • MathMonkeyMan 39 minutes ago
      I switched out asio's epoll backend for its io_uring in a database server and CPU utilization shot up. Probably depends on usage and the specifics of how it's integrated into the event code.
      • vlovich123 25 minutes ago
        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.
  • Uptrenda 42 minutes ago
    Yes, io_uring is significantly faster than epoll (I think I had like 20% faster req/s with io_uring.) The catch is that its kernel opt-in and disabled just about everywhere for security reasons. I think that it has direct memory sharing between the kernel and user-land which is kind of yikes. There's been multiple exploits that hit io_uring in recent times. It's because of this that even engineering projects that try to reach the highest performance possible (like Go) don't really bake io_uring in as a sane default. Though if you want to take the risk you can always run it yourself for your favourite language. It is faster but the cost is possible exploits.
    • happyPersonR 11 minutes ago
      Any kind of poll mode networking:

      Rdma, dpdk, io_uring it’s really kind of up to the user to do the memory isolation

      In io_urings case tho, you can’t do much because the rings are in the kernel.

      I’m hopeful though that with Llm things will get better.

      But it’s just hard problem to solve . Very difficult to do in the kernel itself, and folks don’t really even understand tuning for it.