AIO and some advice needed.

Avinash Lakshman avinash.lakshman at gmail.com
Fri Nov 28 13:39:01 PST 2008


Thanks for the reponse inspite of it being a holiday. I appreciate it. What
I am doing is on the main thread submitting read requests to the
AsynchronousFileChannel and having it read from positions that are randomly
generated. The FileChannel is equipped with a thread pool which has 8
threads. If it is doing synchronous reads with a thread pool then the
performance is understandable I guess.

Thanks
Avinash

On Fri, Nov 28, 2008 at 11:01 AM, Alan Bateman <Alan.Bateman at sun.com> wrote:

> Avinash Lakshman wrote:
>
>> Thanks Alan. Do you have any performance benchmark numbers that you can
>> share comparing the performance of synchronous and asynchronous approaches
>> on Linux?
>>
> I don't have numbers to share but one thing to say is that kernel AIO on
> Linux isn't supported (to my knowledge) for files that aren't opened for
> direct I/O. Direct I/O is very much for databases and a few cases that do
> their own caching. This means that when you are using an asynchronous file
> channel it is actually doing synchronous I/O with a thread pool. This works
> surprisingly well but you need to play around with sizing of the thread pool
> to get the right concurrency. In the future we can make use of the kernel
> support if it changes. I don't think I understand your environment
> sufficiently to make any reasonable recommendations. I understand there is a
> big 45GB file but it's not clear to me how it is used. If indeed you can
> read and process areas of the file in parallel then try
> AsynchronousFileChannel and send feedback. FileChannel also defines a
> positional read method and so can support concurrent access without concern
> for the global file position.
>
> -Alan.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-discuss/attachments/20081128/d95f459d/attachment.html 


More information about the nio-discuss mailing list