与rtkaio的Linux则aio_write有时长 [英] aio_write on linux with rtkaio is sometimes long

查看:566
本文介绍了与rtkaio的Linux则aio_write有时长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是与rtkaio库Linux的异步IO。在我的测试一切完美,但是,在我的实际应用中我看到,则aio_write这应该返回速度非常快,很慢。它可以在100多个milis写一个128KB到O_DIRECT填充文件。
我的两个测试和应用程序使用相同的I / O大小,我入住的是同一个文件系统(GFS)上。

I'm using async io on linux with rtkaio library. In my tests everything works perfectly, but, in my real application i see that aio_write which is supposed to return very fast, is very slow. It can take more than 100 milis to write a 128KB to a O_DIRECT padded file. Both my test and the application use same I/O size, i check on the same file system (GFS).

我加计数,我看到有一些短(短则2 milis)和50%的长异步IO操作的约50%(超过2 milis)。

I added counting and i see that there are about 50% of async io operations that are short (shorter then 2 milis) and 50% that are long (longer than 2 milis).

我还检查,测试和应用程序中都使用相同的rtkaio库。

I also checked that the test and the application both use the same rtkaio library.

我是pretty丢失,任何人任何想法我应该在哪里看?

I'm pretty lost, anyone any ideas where should i look?

我的另一个相关的问题:<一href=\"http://stackoverflow.com/questions/1799537/proc-sys-fs-aio-nr-is-never-higher-than-1024-aio-on-linux\">http://stackoverflow.com/questions/1799537/proc-sys-fs-aio-nr-is-never-higher-than-1024-aio-on-linux

Another my related question: http://stackoverflow.com/questions/1799537/proc-sys-fs-aio-nr-is-never-higher-than-1024-aio-on-linux

推荐答案

我并不想被劝退,但我怀疑你会得到一个非常有用的回答这个问题,因为这里有太多的变量(一个集群文件系统的异步I / O, O_DIRECT 等),除非一个人是非常熟悉,尤其是你的设置,最好谁都可以做的就是给你模糊咨询。

I don't mean to be discouraging, but I doubt you'll get a very useful answer to this question because there are way too many variables here (a cluster file-system, asynchronous I/O, O_DIRECT, etc.), and unless someone is very familiar with your setup in particular, the best anyone can do is give you vague advice.

我猜你应该试图确定它是否是实际写入这是缓慢的,还是那就是要带长异步回调处理程序的调用开始。您可以尝试定期同步写入调用替换调用则aio_write 。另外,你提到的写大小显得pretty小,所以你为什么使用 O_DIRECT ?我想 O_DIRECT 这里会降低性能,如果有很多小的写操作。

I guess you should start by trying to determine whether it's the actual write that's slow, or whether it's the invocation of the async callback handler that's taking long. You can try replacing the calls to aio_write with regular synchronous write calls. Also, the write sizes you mention seem pretty small, so why are you using O_DIRECT? I would think O_DIRECT would decrease performance here, if there are many small writes.

这篇关于与rtkaio的Linux则aio_write有时长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆