From owner-freebsd-smp Thu Jan 11 8:27: 4 2001 Delivered-To: freebsd-smp@freebsd.org Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (Postfix) with ESMTP id 9FF0E37B400 for ; Thu, 11 Jan 2001 08:26:46 -0800 (PST) Received: (from daemon@localhost) by smtp04.primenet.com (8.9.3/8.9.3) id JAA08529; Thu, 11 Jan 2001 09:21:56 -0700 (MST) Received: from usr08.primenet.com(206.165.6.208) via SMTP by smtp04.primenet.com, id smtpdAAADXaGpq; Thu Jan 11 09:21:36 2001 Received: (from tlambert@localhost) by usr08.primenet.com (8.8.5/8.8.5) id JAA16987; Thu, 11 Jan 2001 09:26:03 -0700 (MST) From: Terry Lambert Message-Id: <200101111626.JAA16987@usr08.primenet.com> Subject: Re: mysql (smp) performance To: vallo@matti.ee Date: Thu, 11 Jan 2001 16:26:03 +0000 (GMT) Cc: mauri@inspiral.net (Lauri Laupmaa), smp@FreeBSD.ORG In-Reply-To: <20010110191412.B265@myhakas.matti.ee> from "Vallo Kallaste" at Jan 10, 2001 07:14:12 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > After some fair amount of testing I came to conclusion that > > unfortunately mysql (both 3.22 and 3.23) performance is considerably > > slower on freebsd than linux...at least on stock install. > > > > I have used 4.x-STABLE systems, both on SMP and singleproc and linux > > 2.1/2.2 kernels. > > > > It seems that on SMP mysql doesn't scale well. (currently testing on > > dual 833 PIII and running on couple older dual systems) > > > > I'm interested if there is some magic to get mysql run faster ? > > Or should I use 5.x-CURRENT ? > > Do not use -current at this time, it's too unstable and doesn't help > you anyway. The case is very simple, you'll have to wait for a year > or so until SMP support matures, or switch to well-known OS wrt SMP > and database applications. I don't want to start flame war, but free > x86 Solaris seems reasonable if you have powerful hardware. For > second don't know, haven't used Linux for a long time, but I don't > believe it'll be better for databases running MP system. For two > processors only, who knows.. MySQL uses POSIX threads; on FreeBSD, POSIX threads do not scale to an increased number of processors when running SMP. On Linux, POSIX threads scale poorly to an increased number of processors, when compared to Solaris and similar OS implemenations. As a practical matter, you can install the Linux threads kernel module and library on FreeBSD, and get at least as "good" SMP threads scaling on FreeBSD as you would on Linux, but both platforms are a poor second to even the worst of the commercial SMP systems at this time. POSIX threads also have some serious limitations, where the designers of the API exposed OS implementation issues specific to the reference platforms, all of which were System V UNIX variants. One major example of this is preallocation of fixed size stacks, which is not really necessary even on SVR4 systems, so long as they postdate Steve Baumel's VM work as of SVR4.2 (even on earlier implementations, it's pretty trivial to establish a guard page on a region, and auto-grow it by taking the fault in user space using a signal handler). Really, most people using threads should go back to the drawing board, and select a design that doesn't require threads. In any case, I have to agree here with the Solaris recommendation probably being your best bet for optimum SMP scalability at this time, at least as long as you don't go over 4 processors. For higher scaling, you will need to wait until FreeBSD completes the work already designed, but not yet implemented, or until another SMP OS threads support matures beyond the 4 CPU limit that comes from poor scheduling and too large a conflict domain brought about by unnecessarily over-shared resources. PS: I can't really see ythis being a real problem, if you are using MySQL as your engine; you will hit engine contention limits well before that level of scaling anyway. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message