/ proc / sys / fs / aio-nr is never higher than 1024 (AIO on Linux)

I am trying to use async io for linux. As far as I know, there are 3 options:

  • kernel calls (io_submit and friends)
  • libRT - uses threads in user space
  • libRTKAIO - kernel call wrapper that does not use threads

I use the last parameter, and I see that in my unit test, which runs many asynchronous requests in multiple threads, / proc / sys / fs / aio -nr is never higher than 1024. I wonder where this restriction lies.

I installed / proc / sys / fs / aio -max-nr in 16M, so this is not a problem.

Related question (also mine) aio_write on linux with rtkaio is sometimes long

+1
source share
1 answer

There is a system call called io_setup. In librtkaio, this call gets 1024 as an argument. This results in a constant 1024, as I described, and impairs performance if there are 1024 pixels in parallel. Please note that 1024 is hard-coded.

Only calling lio_listio in lock mode will allow you to raise that 1024 bar.

+1
source

Source: https://habr.com/ru/post/1723358/


All Articles