mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Heath <mhe...@apache.org>
Subject Re: Is there someone trying the AsynchronousFileIO?
Date Wed, 24 Jan 2007 00:20:02 GMT
I'll try to look into this.  It will be a couple of weeks before I
really start to dig deep into the POSIX AIO stuff.  I'm hoping to do
some performance comparisons between Linux and Solaris which may be
interesting.  My goal is to be able to build more scalable network
servers with MINA.  I will definitely be doing a lot of performance
metrics which I'm sure will lead to digging into the details of POSIX
AIO performance tuning.

BTW - I've published the API to my asynchronous file API at:
http://people.apache.org/~mheath/aio/apidocs/  Any feedback would be
appreciated.  I also posted a bit about the API on my blog
http://swamp.homelinux.net/blog/?p=6  I'll be updating my blog (and this
list) regularly wrt to the progress of this framework.

-Mike

On Tue, 2007-01-23 at 16:02 +0800, yueyu lin wrote:
> I have to stop the experiment. The most surprise is that I use pure
> C/pthread to implement the similar test, the performance is even bad than
> the java version.
> I read some material, it was said that the Linux thread and AIO performance
> are not so good.
> I don't know if it can explain the performance problem I met.
> Can someone continue to dig deeper? I'm afraid I miss something.
> 
> On 1/18/07, yueyu lin <popeyelin@gmail.com> wrote:
> >
> > Although the performance is not so good, but I still continue to dig
> > something out today.
> > I have to clear one thing is that currently I only focus on the read
> > performance because our system is some like a search engine. Read
> > performance is the first priority.
> >
> > I add some time statistics in codes to see how long each step takes.
> > The shame is that my list operation cost almost 50% time. That means if we
> > can improve that, it may possibly be quicker than RandomAccessFile.
> > I've done some researches with my colleague, we found Sun did an excellent
> > job for introducing CAS(Compare and Set) into java. That interface is even
> > lack of in Linux's core library. Solaris has atomic_xxx functions to provide
> > the feature. This feature will improve the linked list performance in
> > multiple threads environment much. In Sun's JDK implementation, the assemble
> > codes are for X86. That inspires me to do it!
> > I'll continue to do something. If there is any progress, I will post to
> > the list.
> >
> > On 1/18/07, Mike Heath < mheath@apache.org> wrote:
> > >
> > > On Wed, 2007-01-17 at 18:27 +0800, yueyu lin wrote:
> > > > OK, I finally implement a stable version based on the signal call in
> > > > aio_read .
> > >
> > > This is awesome!  I'm going to try and integrate some of this into my
> > > AIO framework.  Good work.
> > >
> > > > The performance is improved about 70%~100% compared with the thread
> > > > notification way.
> > > > But sadly, it's still slower than Sun's simple implementation. I've
> > > checked
> > > > the codes, it just only call read(2) for any read invokation. No
> > > special
> > > > operations.
> > > > Mentioned by the mail from Sun's employee in OpenJDK, the aio_read is
> > > > aio_read(3)
> > > > instead of aio_read(2). That means that's a lib call, not a syscall.
> > > The
> > > > syscall may benefit from the legacy interrupt to improve
> > > performance.  I
> > > > also noted that Linux has already put the aio_read implemented in the
> > > kernel
> > > > in the Kernel 2.5 or later. But it's still a software way to do that.
> > > > Indeed, the asynchronous read may improve the throughput, but it needs
> > >
> > > > current application to change their model to event-driven model. My
> > > idea
> > > > that is to replace the RandomAccessFile may not work. Because our
> > > > application is just work as a block reading way.
> > >
> > > MINA uses an event-driven model which is why I've been looking at using
> > > POSIX AIO with Java.  Java has excellent support for event-driven
> > > networking (which MINA takes advantage of) but but Java is still
> > > limited with file AIO.  I should point out though that JSR 203 is in
> > > active development and will be released with Java 7.
> > >
> > > I'm hoping to have some solid benchmarks measuring the performance
> > > difference between using AIO and blocking I/O on a server handling
> > > thousands of concurrent network connections.  I'll post my results on
> > > this list.  I'm also very interested to see the difference in
> > > performance of POSIX AIO between Linux and Solaris.  I'll try to
> > > benchmark that as well.
> > >
> > > -Mike
> > >
> > >
> >
> >
> > --
> > --
> > Yueyu Lin
> 
> 
> 
> 


Mime
View raw message