-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
What problem does this solve or what need does it fill?
Right now, our local file reads are done with async-fs, backed by the blocking crate, to run a dynamic thread pool for running blocking IO operations
This thread pool does its job, but may result in higher counts of context switches with the threads periodically returning control to the OS with each syscall.
What solution would you like?
Incorporate the use of OS-level async IO systems (i.e. io_uring on Linux, IORing on Windows) to lower our reliance on this blocking thread pool ,and stick as close as we can to a single thread per core for the engine as a whole.
This is already generally well supported within the Rust ecosystem for network IO via epoll, kqueue, and IOCP, but it does not support file IO, and it's been shown that io_uring and IORing are overall more CPU-time efficient than these options.
What alternative(s) have you considered?
Sticking to what we have right now. It works just fine.
Additional context
io_uring may not be compatible with async Rust as it is right now: https://tonbo.io/blog/async-rust-is-not-safe-with-io-uring. More ecosystem-wide support might be required.