NOTE: This project is in the process of moving to GitHub. The new location is here:
https://github.com/mheily/libkqueue
libkqueue is a portable userspace implementation of the kqueue(2) kernel event notification mechanism. It acts as a translator between the kevent structure and the native kernel facilities of the host machine.
The following diagram illustrates how libkqueue works under Linux:
(FIXME -- this image is missing)
Solaris has an event ports facility that is very similar to kqueue. On this platform, the kevent() function is mapped directly to the port_get() system call:
On Linux, libkqueue provides O(1) scalability relative to the number of concurrent client connections. This is an improvement over the traditional poll(2) system call which has O(N) scalability. For testing, two versions of the thttpd web server were compiled: one using libkqueue, and one using poll(). The ApacheBench benchmarking utility was used to compare the performance of both versions. A custom script was used to create thousands of idle connections to the server, to simulate the use of HTTP Keepalives on a busy real-world server.
Debian users can install the libkqueue0 and libkqueue-dev packages.
Here are the instructions for building the source code on a variety of operating systems.
libkqueue currently requires the following:
The Solaris port requires Solaris 10 or higher, and uses the GNU compiler and toolchain.
To build on Nexenta, the gcc-multilib package is required.
Required packages:
Recommended packages: