opendal icon indicating copy to clipboard operation
opendal copied to clipboard

feat: Implement io_uring support via `tokio_uring`

Open Xuanwo opened this issue 2 years ago • 15 comments

Previously, we aimed to implement runtime agonistic io_uring support in OpenDAL, but this proved to be a difficult task that hindered our progress. Therefore, we have revised our goal to initially add io_uring support via tokio_uring and then collaborate with the community to enhance it.

To enable tokio_uring, a newer Linux kernel (5.6 and above) and a tokio-uring runtime are required. We will integrate this support under a new feature known as services-fs-with-io-uring. Once activated, the service fs implementation will be based on io_uring.

NOTE: It is the users' responsibility to ensure that this service is running on the tokio_uring runtime.

Related Discussions

  • https://github.com/datafuselabs/opendal/issues/489
  • https://github.com/datafuselabs/opendal/issues/479
  • https://github.com/datafuselabs/opendal/issues/477
  • https://github.com/datafuselabs/opendal/issues/110
  • https://github.com/datafuselabs/opendal/issues/40
  • https://github.com/datafuselabs/opendal/issues/19

Xuanwo avatar Mar 05 '23 08:03 Xuanwo

I still maintain an interest in these types of questions, so let me see if tokio_uring is already available.

PsiACE avatar Mar 05 '23 15:03 PsiACE

actix-files already employs tokio_uring, making it worthwhile to give it a shot.

Xuanwo avatar Mar 05 '23 15:03 Xuanwo

~~It's also worth to take a look over: https://github.com/spacejam/rio~~

It's GPL-3.0 unless we become spacejam's github sponsors.

Xuanwo avatar Apr 21 '23 16:04 Xuanwo

Hello, it seems this future is not moved forward in a long time, Can I get to know which blocked it? If needed, I can help to further push this feature to opendal. @Xuanwo

oowl avatar Jun 22 '23 17:06 oowl

Can I get to know which blocked it?

Using tokio_uring requires additional runtime setup that goes against OpenDAL's VISION. I am exploring alternatives to enable us to use io_uring without this setup.

Xuanwo avatar Jun 23 '23 04:06 Xuanwo

You mean that opendal core codebase can not require some special rust runtime instance (for example tokio), we need to find some io_uring instance just return Furture?

oowl avatar Jun 23 '23 07:06 oowl

You mean that opendal core codebase can not require some special rust runtime instance (for example tokio), we need to find some io_uring instance just return Furture?

Exactly!

Xuanwo avatar Jun 23 '23 10:06 Xuanwo

As we have added some Tokio runtime as dependencies of OpenDAL, So I think the problem against OpenDAL vision which we mentioned before does not exist.

I have done some research on tokio-ioring, the main block of OpenDAL using it is iouring specific thread models in tokio, because io-uring pulls msg queue design, so tokio-uring adopts an isolated thread-per-core model as runtime, OpenDAL has been using originally tokio thread model, So which means we can not use io-uring as only fs operation if we want to use tokio-uring function in OpenDAL, we need to replace whole runtime as tokio-uring supported.

oowl avatar Dec 16 '23 17:12 oowl

Here the nuclei author, I am writing the new ring design. Hopefully, it will land soon. On the other hand, what exactly this comment mentions is why I wrote whole nuclei and why I wrote async runtimes, and M:N model everywhere. Tioli, don't poison your dependencies, it will be irreversible, and you are %100 right on what you wrote there.

vertexclique avatar Jan 19 '24 09:01 vertexclique

Here the nuclei author, I am writing the new ring design.

Looking forward to your project!

Xuanwo avatar Jan 19 '24 09:01 Xuanwo

Hi all, I have updated nuclei to 0.4. It now includes also multishot accept and some parts of multishot API. + socket state changes and more improvements and recent io_uring changes came with 5.19+. Now I am working on 6.1+ changes, it will take some time, since that requires some design changes. https://crates.io/crates/nuclei

In addition to that, here is the benchmark comparison with Epoll for HTTP server: https://vertexclique.github.io/nuclei/#/benches

In addition to that book is here: https://vertexclique.github.io/nuclei/#/

Have a good time!

vertexclique avatar Jan 22 '24 03:01 vertexclique

Congrats!

In addition to that, here is the benchmark comparison with Epoll for HTTP server: https://vertexclique.github.io/nuclei/#/benches

A small feedback: the website seems broken for css missing.

Xuanwo avatar Jan 22 '24 03:01 Xuanwo

I will check, just deployed the site. Is it readable at least?

vertexclique avatar Jan 22 '24 03:01 vertexclique

Is it readable at least?

Yep, ok to read

image

Xuanwo avatar Jan 22 '24 03:01 Xuanwo

There is a pdf at the end of the page. That summarizes io_uring performance in two modes. Maybe that's better to check. I will take a look at the site tomorrow.

vertexclique avatar Jan 22 '24 03:01 vertexclique

Tracked at https://github.com/apache/opendal/issues/4520. We will start a new issue once we start this work.

Xuanwo avatar Jun 14 '24 12:06 Xuanwo