BIND9 and libpthread performance

Pawel Worach pawel.worach at telia.com
Thu Oct 7 18:09:44 PDT 2004


Daniel Eischen wrote:
> 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.

Yes, system has two physical cpus with HTT enabled, FreeBSD sees four.
kern.smp.cpus: 4
hw.ncpu: 4

As I don't have access to the datacenter to turn off HTT in the BIOS now
I set machdep.hlt_logical_cpus in loader.conf which should theoretically
do the same thing right?

> 
> 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.
> 
The first tests I did where with LIBPTHREAD_SYSTEM_SCOPE set.

Here are new results for all the parameters above.

* kern.threads.virtual_cpu=1, named -n 1 (named still sees four cpus and fires 
up four theads if I don't force it not to)
x process-scope-1-cpu
+ system-scope-1-cpu
+--------------------------------------------------------------------------+
|x            xx   x  x                               + +   +           + +|
|     |_______AM______|                               |_____M__A_________| |
+--------------------------------------------------------------------------+
     N           Min           Max        Median           Avg        Stddev
x   5     9531.2955     10089.776     9895.4739     9876.4389     211.59661
+   5     10925.816     11449.187     11082.488     11168.616     244.15478
Difference at 95.0% confidence
         1292.18 +/- 333.191
         13.0834% +/- 3.37359%
         (Student's t, pooled s = 228.456)

* kern.threads.virtual_cpu=2, named -n 2
x process-scope-2-cpu
+ system-scope-2-cpu
+--------------------------------------------------------------------------+
|x   x x xx                                                         ++  +++|
|  |__AM__|                                                          |_AM_||
+--------------------------------------------------------------------------+
     N           Min           Max        Median           Avg        Stddev
x   5     8319.6891     8558.6617     8476.9996     8463.3126     96.296725
+   5     10159.815     10336.033     10284.944      10260.51     74.904761
Difference at 95.0% confidence
         1797.2 +/- 125.815
         21.2352% +/- 1.48659%
         (Student's t, pooled s = 86.2664)

The two thread test results don't look quite right, I will turn off HTT in the
BIOS and redo this in about 12 hours. HTT seems to suck, not using the logical
cpus gives me about ~11k queries per second which is about 1k better than
libc_r, woho!

Thanks! Keep up the good threading work!

-- 
Pawel


More information about the freebsd-threads mailing list