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

不想你离开。 提交于 2020-01-05 07:23:12

问题


I'm trying to use async io on linux. As far as i know there're 3 options:

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

I'm using the last option, and i see, that in my unit test that runs a lot of async io requests in multiple threads, /proc/sys/fs/aio-nr is never higher than 1024. I wonder where lays such limitation.

I've set /proc/sys/fs/aio-max-nr to 16M, so it's not an issue.

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


回答1:


There's a system call named "io_setup". In librtkaio this call is receiving 1024 as an argument. This, leads to the constant 1024 as i described and hurts performance if there're more than 1024 ios in parallel. Note that 1024 is hardcoded.

Only calling lio_listio in blocking mode will allow you to raise this 1024 bar.



来源:https://stackoverflow.com/questions/1799537/proc-sys-fs-aio-nr-is-never-higher-than-1024-aio-on-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!