Re: [And-httpd-devel] Linux AIO
Status: Beta
Brought to you by:
james-antill
From: James A. <ja...@an...> - 2006-11-15 01:06:45
|
"Adam Zell" <zel...@gm...> writes: > Hello, > > Substantial performance improvements noted here: > http://blog.lighttpd.net/articles/2006/11/12/lighty-1-5-0-and-linux-aio > http://blog.lighttpd.net/articles/2006/11/14/linux-aio-and-large-files See my response: http://illiterat.livejournal.com/2989.html ...the PR is mightier than the reality. It's possible the result is still faster in some cases, although misleadingly named, but IMNSHO it's the wrong approach. And I can guarantee there are cases where it'll perform worse. The right approach for real zero copy AIO, atm., is to have multiple helpers doing semi blocking IO using splice() with the "master" process doing splice() between the helper pipe and the network socket. There is also the real aio_sendfile() call, if/when that ever gets into Linux[1]. Doing the above with 4 IO helpers is basically the better/efficient way of just changing the 0.9.11 config with something like: (org.and.daemon-conf-1.0 procs = 4 * <sysconf-number-processors-configured>) ...now. > It is not clear to me without looking at the code why lighttpd chose to use > pthreads. Additional reading on AIO: > > http://www-128.ibm.com/developerworks/linux/library/l-async/ The glibc implementation of AIO (which is the portable interface, libaio is extremely Linux specific, and basically deprecated) is backed by a pthread pool (for one of the implementations, it prefers the libaio approach if that works ... which it doesn't always). From what I saw lighttpd uses the libaio API, but I assume some glibc dependency also fell out due to bad documentation. [1] Although splice() might still be better, even then ... but it is much more work, so if it gets in before I implement the splice() way it might be a long time before we find out :). -- James Antill -- ja...@an... http://www.and.org/and-httpd/ -- $2,000 security guarantee http://www.and.org/vstr/ |