apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Querna <c...@force-elite.com>
Subject [PATCH] KQueue AND sys_epoll Support for apr_pollset
Date Sun, 06 Jun 2004 06:08:22 GMT
Based on my work from earlier this week, I have a new Patch.

On Joe Orton's advice I removed the sys_epoll backend for apr_poll().
The more scalable platform specific backends will only be used by
apr_pollset().  As Joe explained, the extra overhead of sys_epoll or
KQueue in apr_poll() would of likely made them slower than the original
poll() version for small numbers of sockets.(common case)

This version includes support for FreeBSD's KQueue().  It has only been
tested on FreeBSD-5.2-CURRENT with HTTPd's Worker MPM.  It needs to be
tested on the NetBSD, OpenBSD and older versions of FreeBSD.

Simple Benchmarks on my LAN with ab:
FreeBSD KQueue(): 511.24 [requests/sec]
FreeBSD Poll(): 430.56 [requests/sec]

I was quite surprised with this performance increase (about 18% faster).
I believe most of the performance gain comes from lower latency KQueue
can offer over traditional poll().

The KQueue() Implmentation does not handle all the flags for
apr_pollset().  The fact is FreeBSD's KQueue does not have an exact API
match with traditional poll().[POLLPRI,POLLERR,POLLHUP,POLLNVAL].  It
still passes all the tests, and seems to work great with HTTPd, but I
believe it will hit some inconsistencies compared to how poll() behaves.

Suggestions and Comments Welcome.

-Paul Querna


Mime
View raw message