Benchmarking kqueue() performance?

Terry Lambert tlambert2 at
Fri Oct 17 22:04:30 PDT 2003

Lev Walkin wrote:
> One of the most comprehensive sites about that problem is:

That's about scaling to a large number of connections, not about
kqueue() vs. select performance.

The biggest problem with a large number of connections, at least
as far as FreeBSD is concerned, is the TCP timer implementation
using a callout wheel, since any expiring timer has to traverse
every bucket in the chain, instead of stopping at the first one
that's un expired (see the BSD 4.2/4.3 timers for an example of
the right way to do it).

FWIW: I've had a FreeBSD box with a static page server on it up
to 1.6M simultaneous connections with very little work, so 10K
is pretty trivial in comparison.

For doing real work, and giving 1G to a server process and 512M
to caching, this number drops to ~250K connections, but that's
still 25 time what he claims is some insurmountable barrier.

BTW, the company for which I did this work is still shipping
real product that handles those loads on a FreeBSD box, FWIW.

-- Terry

More information about the freebsd-hackers mailing list