Sounds exciting!
Anything asynchronous sounds good to me.![]()
Phoronix: Linux Kernel To Get AIO Performance Improvements
The Linux Kernel A-synchronous I/O support has been receiving some performance improvements and clean-ups that should soon be merged to mainline...
http://www.phoronix.com/vr.php?view=MTI0MTk
Sounds exciting!
Anything asynchronous sounds good to me.![]()
This probably would help IO response times inside your VMs, but I am not sure if you would notice any effect on the host.
When you start a VM, Linux could evict pages from cache to make room for it, which would affect system response times. It could also be that your system is IO limited.
The kernel's VFS layer provides AIO functions. However, writing programs that take advantage of asynchronous operations requires more effort than those using their traditional UNIX counterparts. Utilizing AIO provides no benefit unless your program is a daemon that can do other things while waiting for IO.
Do you have a lot of RAM?
It took me a long time to figure it out, but I noticed on my system (32GB RAM) that the settings for VM dirty_ratio and dirty_background_ratio are not nearly low enough -- even 1 is not low enough. What seems to be happening is that during heavy write activity, the system caches writes until it has hundred of MiBs or more in the cache, then decides to write it to storage and that seems to block other processes and can cause the system to nearly freeze for seconds at a time.
My partial solution is to use dirty_bytes and dirty_background_bytes instead. I currently set them to 96MiB and 32MiB:
echo "100663296" > /proc/sys/vm/dirty_bytes
echo "33554432" > /proc/sys/vm/dirty_background_bytes
That much can be written to storage in less than a second. It seems to help. The mulitple second freezes are mostly gone.
Last time I checked you had to specifically link your program against libaio to get true Linux AIO, using non standard system call io_submit(2) and friends.
Standard POSIX AIO (aio_write(3)) on Linux is a kludge implemented by spawning blocking threads in the glibc. Red Hat and Novell rolled their own implementation of POSIX AIO on top of Linux AIO for their OSes.
Nginx, a popular high-perfomance webserver, should benefit from these patches. It has asynchronous design and it supports file AIO in Linux. Would be interesting if phoronix had tested its performance with and w/o the patches.