From owner-freebsd-questions@FreeBSD.ORG Tue Nov 27 13:46:09 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3162D16A469 for ; Tue, 27 Nov 2007 13:46:09 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.freebsd.org (Postfix) with ESMTP id B9F0213C442 for ; Tue, 27 Nov 2007 13:46:08 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from epia-2.farid-hajji.net (epia-2 [192.168.254.11]) by fw.farid-hajji.net (Postfix) with ESMTP id 325E1E061F; Tue, 27 Nov 2007 14:46:07 +0100 (CET) Date: Tue, 27 Nov 2007 14:46:05 +0100 From: cpghost To: Albert.Shih@obspm.fr Message-ID: <20071127144605.3339a38c@epia-2.farid-hajji.net> In-Reply-To: <20071126120319.GA70494@pcjas.obspm.fr> References: <20071126115022.GA70340@pcjas.obspm.fr> <20071126115816.DB21928C76@smtp.proximedia.com> <20071126120319.GA70494@pcjas.obspm.fr> Organization: Cordula's Web X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.1; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Help for very bad perf for MySQL X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2007 13:46:09 -0000 On Mon, 26 Nov 2007 13:03:19 +0100 Albert Shih wrote: > > > I've a bi-proc single core Xeon 3.2ghz with FreeBSD 6.2, I'm > > > running Mysql 5.X on this server and the performance of MySQL > > > is very bad. For some complexe select I've got ~6secondes (on > > > some basic Linux it's take 0.6 sec). And I think this is > > > nothing about thead (that's mean I don't think FreeBSD 7.0 > > > can solve my problem) because it's just for one select. > > I don't really known it's some scientifical data. But the problem is > on a basic linux pc (with SATA disk) the time is 0.6 sec with same > request and same data. And it's for web applications. At 6 sec for > one request it's become very long for the visitor because the > application make many requests. It may also be a simple database administration issue: If selects are taking so long, I'd strongly suspect that an INDEX table is either missing or damaged. Are you 100% sure that the database schema is *identical* on the Linux and FreeBSD machines? Perhaps dropping and rebuilding the index tables could speed things up? You could also try to listen to the disks while that slow select is performed: if the disks are thrashing, AND the swap activity is not really higher than else (vmstat -s, or top), it's a dead giveaway that mysqld is doing more disk i/o than necessary, i.e. check the index tables. If on the contrary the disks are quiet while the select runs, check if mysqld is accumulating CPU time (with top): if it is NOT, I'd guess it is some issue with the threading library, i.e. some threads are deadlocked and waiting. -cpghost. -- Cordula's Web. http://www.cordula.ws/