drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.51k stars 1.1k forks source link

support for IO_uring #1074

Open LifeIsStrange opened 2 years ago

LifeIsStrange commented 2 years ago

Hi, in the Readme you say

Use a non-blocking I/O network lib based on epoll (kqueue under macOS/FreeBSD) to provide high-concurrency, high-performance network IO

IO_uring is the new linux API that allow greater performance for async IO, I was wondering wether you could use IO_uring for even more performance? https://github.com/axboe/liburing

feel free to close this issue, and BTW congrats for the amazing performance!

marty1885 commented 2 years ago

The maintainers have considered io_uring support. But temporary put it down due to the lack of time and the amount of changes it needs.

Without going into details. io_uring's model does not work well with database drivers. Current drivers are designed to work with epoll and kqueue. Where the framework doesn't need to know when and how DB talks. It merely asks the kernel to keep an eye on replies from DB. But io_uring expects the framework to submit read and write requests while using them as a notification for when IO is done. This either forces the framework to understand how DB communication works, or frameworks has to support both epoll and io_uring at the same time and dispatch different traffic to the respective function. It's a mess both ways.

We certainly are excited and eager to support io_uring. The matter is just complicated. But nevertheless contributions are more than welcomed :)