的/ proc / SYS / FS / AIO-NR从不大于1024(AIO在Linux上) [英] /proc/sys/fs/aio-nr is never higher than 1024 (AIO on linux)
问题描述
我试图在Linux上使用异步IO。据我所知,是3个选项:
I'm trying to use async io on linux. As far as i know there're 3 options:
- 内核调用(io_submit和朋友)
- libRT - 使用线程在用户空间
- libRTKAIO - 内核调用的包装不使用线程
我使用的是最后的选择,而我看到,一个运行在很多多线程异步IO请求,在我的单元测试,的/ proc / SYS / FS / AIO-NR永远不会比1024我不知道高在这里奠定了这样的限制。
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.
我给自己定的/ proc / SYS / FS / AIO-MAX-NR 16M的,所以它不是一个问题。
I've set /proc/sys/fs/aio-max-nr to 16M, so it's not an issue.
一个相关的问题(也是我)<一个href=\"http://stackoverflow.com/questions/1763712/aiowrite-on-linux-with-rtkaio-is-sometimes-long\">http://stackoverflow.com/questions/1763712/aiowrite-on-linux-with-rtkaio-is-sometimes-long
A related question (also mine) http://stackoverflow.com/questions/1763712/aiowrite-on-linux-with-rtkaio-is-sometimes-long
推荐答案
有一个名为io_setup一个系统调用。在librtkaio此调用接收1024作为参数。这一点,因为我描述的,如果有是平行超过1024 IOS伤害的表现引出恒1024
需要注意的是1024是很难codeD。
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.
只有lio_listio会将呼叫阻塞模式将允许你提出的1024个吧。
Only calling lio_listio in blocking mode will allow you to raise this 1024 bar.
这篇关于的/ proc / SYS / FS / AIO-NR从不大于1024(AIO在Linux上)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!