mirror of
https://github.com/darlinghq/darling-libkqueue.git
synced 2024-10-07 09:13:21 +00:00
5262384552
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@326 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
28 lines
1.6 KiB
HTML
28 lines
1.6 KiB
HTML
m4_include(header.m4)
|
|
|
|
<h2>Overview</h2>
|
|
libkqueue is a userspace implementation of the <a href="http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2">kqueue(2)</a> kernel event notification mechanism. Initial efforts are focused on porting to the Linux 2.6 kernel. There is also an experimental Solaris port.
|
|
|
|
<p>
|
|
libkqueue acts as a translator between the <code>kevent</code> structure and the native kernel facilities of the host machine. The following diagram illustrates how this works under Linux:
|
|
</p>
|
|
|
|
<p align=center>
|
|
<img src="linux_impl.png" alt="Linux implementation" border="0"/>
|
|
</p>
|
|
|
|
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:
|
|
|
|
<p align=center>
|
|
<img src="solaris_impl.png" alt="Solaris implementation" border="0"/>
|
|
</p>
|
|
|
|
<h2>Benchmarks</h2>
|
|
On Linux, libkqueue provides O(1) scalability relative to the number of concurrent client connections. This is an improvement over the traditional <code>poll(2)</code> system call which has O(N) scalability. For testing, two versions of the <a href="http://www.acme.com/software/thttpd/">thttpd web server</a> were compiled: one using libkqueue, and one using poll(2). 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.
|
|
<p align=center>
|
|
<img src="scalability.png" alt="Scalability" border="0"/>
|
|
</p>
|
|
|
|
m4_include(footer.m4)
|
|
|