Menu

Home

Mark Heily

Important Note

NOTE: This project is in the process of moving to GitHub. The new location is here:

https://github.com/mheily/libkqueue

Overview

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.

Project Admins:

See also

[Links]
[Support]
[Usage]

Design

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:

Benchmarks

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.

Download

Debian users can install the libkqueue0 and libkqueue-dev packages.

Installation

Here are the instructions for building the source code on a variety of operating systems.

Linux

libkqueue currently requires the following:

  • GCC
  • Linux 2.6.22 or higher
  • glibc 2.8 or higher

 

Solaris

The Solaris port requires Solaris 10 or higher, and uses the GNU compiler and toolchain.

Nexenta

To build on Nexenta, the gcc-multilib package is required.

Red Hat Enterprise Linux 5

Required packages:

  • glibc-headers
  • gcc

Recommended packages:

  • rpm-build

Related

Wiki: Links
Wiki: Support
Wiki: Usage