From owner-freebsd-amd64@FreeBSD.ORG Tue May 18 17:30:05 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 4909716A4CF for ; Tue, 18 May 2004 17:30:05 -0700 (PDT) Received: from daintree.corp.yahoo.com (daintree.corp.yahoo.com [216.145.52.172]) by mx1.FreeBSD.org (Postfix) with ESMTP id 393D043D31 for ; Tue, 18 May 2004 17:30:05 -0700 (PDT) (envelope-from peter@yahoo-inc.com) Received: by daintree.corp.yahoo.com (Postfix, from userid 2154) id 94E2F8826; Tue, 18 May 2004 13:59:18 -0700 (PDT) From: Peter Wemm To: freebsd-amd64@freebsd.org Date: Tue, 18 May 2004 13:59:18 -0700 User-Agent: KMail/1.6.1 References: <5.2.0.9.2.20040518103357.04c6cbb8@mail.ojoink.com> In-Reply-To: <5.2.0.9.2.20040518103357.04c6cbb8@mail.ojoink.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200405181359.18291.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 00:30:05 -0000 On Tuesday 18 May 2004 10:36 am, JG wrote: > MySQL Statically compiled with libc_r ^^^^^ That's your killer. You're using the the single-process polling loop based threads and comparing it to linux's parallel process based threads. The moment one thread blocks on disk IO, everything stops. You want -lpthread instead, but this isn't going to be happy on 5.2.1-RELEASE. I've fixed a lot of bugs in 5-current that would mean the difference between it working versus crashing. Also, there are patches to change MySQL to use PTHREAD_SCOPE_PROCESS threads with -lpthread. This works out a little better on benchmarks since it can make better use of the ligher weight context switches. -- 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