From owner-freebsd-stable@FreeBSD.ORG Sun Jun 12 21:20:42 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D5C816A41C; Sun, 12 Jun 2005 21:20:42 +0000 (GMT) (envelope-from jd@ugcs.caltech.edu) Received: from regurgitate.ugcs.caltech.edu (regurgitate.ugcs.caltech.edu [131.215.176.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id E976B43D1F; Sun, 12 Jun 2005 21:20:39 +0000 (GMT) (envelope-from jd@ugcs.caltech.edu) Received: by regurgitate.ugcs.caltech.edu (Postfix, from userid 3640) id 4125AE816; Sun, 12 Jun 2005 14:20:39 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by regurgitate.ugcs.caltech.edu (Postfix) with ESMTP id 25EAFE815; Sun, 12 Jun 2005 14:20:39 -0700 (PDT) Date: Sun, 12 Jun 2005 14:20:39 -0700 (PDT) From: Jon Dama To: Robert Watson In-Reply-To: <20050611085604.J75625@fledge.watson.org> Message-ID: References: <746fd037f6ca8131a8fb8938f1e346e9@lonres.com> <20050610170537.GA67849@bibipentium.lonres.com> <20050611085604.J75625@fledge.watson.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Steve Roome , freebsd-stable@freebsd.org Subject: Re: FreeBSD MySQL still WAY slower than Linux X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2005 21:20:42 -0000 Just wondering: How much processor migration takes place on linux mysql? Do the threads mostly stick to the same processors? I've noticed that on FreeBSD the 4BSD scheduler doesn't do much to preserve cache coherency. What sort of cache/TLB misses do you see running mysql linux vs. mysql freebsd? -Jon On Sat, 11 Jun 2005, Robert Watson wrote: > > On Fri, 10 Jun 2005, Steve Roome wrote: > > > We're using mostly: > > > > 5.4-STABLE FreeBSD 5.4-STABLE #0: Mon Jun 6 12:22:18 BST 2005 > > In my experience, the following factors make a big performance difference: > > - Thread package. In 5.x, you get process scope threads by default, but > it turns out MySQL is tuned for system scope threads, and this is > particularly visible in the supersmack benchmark, which competes many > client processes against a few server threads. I'm not sure what the > condition is of libthr on 5.x, but you could give it a spin. In 6.x, > libthr has been largely rewritten and is a great deal faster. I think > there's a compile-time option to make libpthread use system scope > threads but the details ellude me. The Linuxthreads library may well > provide a substantial improvement -- not as good for MySQL as the 6.x > libthr, but perhaps much more appropriate than libpthread. > > - Locking model. Make sure that debug.mpsafenet is set to 1 (i.e., there > aren't components in the kernel that force Giant over the network stack. > Chances are there are none, but it's worth checking). > > - Twiddling hyper-threading, which helps or hurts differently in various > configurations. > > - On a UP system, consider compiling a kernel without "options SMP" to > reduce locking overhead. > > I've found the single largest remaining factor to be threading package -- > over the past year or so I've about doubled MySQL performance on 5.x > leading up to 5.3, largely through SMP locking work, but the remainder of > the difference appears to be in the threading package. > > Robert N M Watson > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" >