BIND9 and libpthread performance

Daniel Eischen deischen at freebsd.org
Thu Oct 7 16:52:35 PDT 2004


On Fri, 8 Oct 2004, Pawel Worach wrote:

> Hi,
>
> I did some simple benchmarking with libpthread vs. libc_r and BIND.
> The numbers puzzle me. Are pthreads supposed to this much slower?
>
> Tests done using BIND9 with a authoritative root zone. The queryperf
> tool from bind-9.3.0/contrib/queryperf was used to get the numbers.
> Queries where done for ". SOA". (queryperf -s 127.0.0.1 -l 30)
>
> This is on -CURRENT from Oct 6th, WITNESS, INVARIANTS off and
> libpthread built without _LOCK_DEBUG and _PTHREADS_INVARIANTS.
> Hardware is a dual IBM x345 2.8ghz Xeon box with HTT on. SCHED_4BSD,
> PREEMPTION and ADAPTIVE_GIANT are in the kernel config, malloc.conf
> symlinked to 'aj'.

So that's a true dual CPU system with HTT CPUs (the kernel sees
4 CPUs)?  Turn HTT off, set kern.threads.virtual_cpu = 1, and try
using process scope threads.  Then set kern.threads.virtual_cpu = 2
and try again using process scope threads.  Then try the same 2
tests with system scope threads.

You can set LIBPTHREAD_SYSTEM_SCOPE in your environment to force
system scope threads, and set LIBPTHREAD_PROCESS_SCOPE to force
process scope threads (you needn't rebuild libpthread or your
application).  If they are both set, system scope wins out.

-- 
Dan Eischen



More information about the freebsd-threads mailing list