From owner-freebsd-amd64@FreeBSD.ORG Wed May 19 12:12:09 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C27516A4CE for ; Wed, 19 May 2004 12:12:09 -0700 (PDT) Received: from daintree.corp.yahoo.com (daintree.corp.yahoo.com [216.145.52.172]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2761C43D31 for ; Wed, 19 May 2004 12:12:09 -0700 (PDT) (envelope-from peter@yahoo-inc.com) Received: by daintree.corp.yahoo.com (Postfix, from userid 2154) id 245C78826; Wed, 19 May 2004 12:11:26 -0700 (PDT) From: Peter Wemm To: freebsd-amd64@freebsd.org, John-Mark Gurney Date: Wed, 19 May 2004 12:11:25 -0700 User-Agent: KMail/1.6.1 References: <5.2.0.9.2.20040519052743.04365f78@mail.ojoink.com> <5.2.0.9.2.20040519060611.0435f750@mail.ojoink.com> <20040519172913.GU601@funkthat.com> In-Reply-To: <20040519172913.GU601@funkthat.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200405191211.25786.peter@wemm.org> Subject: Re: Why is MySQL nearly twice as fast on Linux/AMD64 Vs. FreeBSD/AMD64? X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2004 19:12:09 -0000 On Wednesday 19 May 2004 10:29 am, John-Mark Gurney wrote: > JG wrote this message on Wed, May 19, 2004 at 06:07 -0700: > > At 04:53 PM 5/19/2004 +0400, you wrote: > > >In first time you built MySQL statically. > > >Now - dinamically. > > > > > >What results with statical linked MySQL ? > > > > > >JG wrote: > > > > Those results are in earlier posts of this thread. > > > > I compiled it dynamically to be sure that libpthreads was used. > > (so I could use ldd against mysqld) > > There is a patch to make use of _SYSTEM scoped threads instead of > process scoped threads for mysql mentioned ealier.. Also, if you > use libmap to remap libpthread to libthr, you'll have similar > results... Actually, the patch was the other way around. mysqld was running into limits of system scope threads, so the port has patches to turn it into process scope. It might be worth deleting the file from the port and rebuilding, just to see what happens. However.... > libpthread (aka libkse) is a design for M:N threads, and requires > the user of pthreads to create new system scoped threads to make > use of multiple cpu's... Not quite. The default N in the M:N case for libpthread 'ncpu'. pthread_getconcurrency()/pthread_setconcurrency() can check and change this. Of course, this is fine in theory - libpthread *should* be scheduling threads on all cpus at once. But the numbers earlier in the email thread suggest otherwise. So much for theory... BTW: your suggestion to try libthr isn't really helpful here. peter@daintree[12:01pm]~lib/libpthread/thread-255> ls /usr/lib/libthr* ls: No match. Somebody mentioned MD patches for libthr at one point, but I haven't seen them. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5