tags:

views:

60

answers:

1

Recently I am learning how to write a high performance web server.There is a experiment by RedHat says that epoll is faster than aio. someone says that because aio in Linux kernel is implemented with pthread. It's difficult for me to find latest information to prove this.Also I don't know is epoll still better than aio now on Linux?So I want to know where can I get the newest information about aio on Linux 2.6.x. Thx a lot!

A: 

I'm researching the same area.

Can you even make aio on Linux work? I write 300M with aio_write() and see them as dirty pages in the cache. That means they don't go directly to the IO scheduler, but to the VM and later pdflush/flush. Which means aio is as good/bad as just buffered io.

I'm on 2.6.16.46 on the build machine and 2.6.27.19 on the target. This isn't exactly newest Linux kernel/libs, so that may be a problem.

Another aspect is the IO scheduler you use. CFQ favors synchronous IO, but may be tuned for async. It also supports IO priorities.

For starters, I would recommend watching a few places when you execute your IO:

  1. /proc/meminfo - see dirty pages trends
  2. echo 1 > /proc/sys/vm/block_dump and watch syslog, you'll see who's doing the writing and when
  3. sar -dp 1 - see if your devices are being utilized at 100%
  4. cd /proc; cat */status | grep State - see who's blocked on disk
  5. /sys/block//queue/iosched - io scheduler tunables
n-alexander
@n-alexander thanks!these helps me a lot;)