From owner-freebsd-threads@FreeBSD.ORG Fri Oct 8 01:09:44 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1CED516A4CE; Fri, 8 Oct 2004 01:09:44 +0000 (GMT) Received: from av9-1-sn4.m-sp.skanova.net (av9-1-sn4.m-sp.skanova.net [81.228.10.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A07343D2D; Fri, 8 Oct 2004 01:09:43 +0000 (GMT) (envelope-from pawel.worach@telia.com) Received: by av9-1-sn4.m-sp.skanova.net (Postfix, from userid 502) id 99E1438346; Fri, 8 Oct 2004 03:09:42 +0200 (CEST) Received: from smtp2-1-sn4.m-sp.skanova.net (smtp2-1-sn4.m-sp.skanova.net [81.228.10.183]) by av9-1-sn4.m-sp.skanova.net (Postfix) with ESMTP id 8814437EBD; Fri, 8 Oct 2004 03:09:42 +0200 (CEST) Received: from corona.sajd.net (h47n2fls31o265.telia.com [217.208.189.47]) by smtp2-1-sn4.m-sp.skanova.net (Postfix) with ESMTP id 70B2137E43; Fri, 8 Oct 2004 03:09:42 +0200 (CEST) Received: from [127.0.0.1] (sajd@localhost [127.0.0.1]) by corona.sajd.net (8.13.1/8.13.1) with ESMTP id i9819Zv0006726; Fri, 8 Oct 2004 03:09:36 +0200 (CEST) (envelope-from pawel.worach@telia.com) Message-ID: <4165E8CF.8090409@telia.com> Date: Fri, 08 Oct 2004 03:09:35 +0200 From: Pawel Worach User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040815) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: BIND9 and libpthread performance X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 01:09:44 -0000 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