From owner-freebsd-performance@FreeBSD.ORG Thu Oct 28 16:09:21 2004 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0C1AF16A4CE for ; Thu, 28 Oct 2004 16:09:21 +0000 (GMT) Received: from otter3.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81FAF43D2F for ; Thu, 28 Oct 2004 16:09:20 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by otter3.centtech.com (8.12.3/8.12.3) with ESMTP id i9SG9H6u005429; Thu, 28 Oct 2004 11:09:17 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <418119AA.6050608@centtech.com> Date: Thu, 28 Oct 2004 11:09:14 -0500 From: Eric Anderson User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20041025 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Omer Faruk Sen References: <20041028074929.77915.qmail@istanbul.enderunix.org> In-Reply-To: <20041028074929.77915.qmail@istanbul.enderunix.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-performance@freebsd.org Subject: Re: Mysql high cpu usage problem X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2004 16:09:21 -0000 Omer Faruk Sen wrote: > Hi, > I have a system with apache+php+mysql. The system was fine for a long > time but my problem started a few weeks ago. > I have two 2.8 Ghz Xeon CPU's. Hyperthreading is enabled. 2 gigs of RAM. > machdep.hlt_logical_cpus=0 and polling is enabled. > Mysql (which was compiled with linux_threads and staticly linked > libraries) has started to consume lots of cpu time (mainly system and > nice times) > Here's a moment from top output: > last pid: 60888; load averages: 114.70, 114.42, > 115.72 up 2+01:10:28 10:44:18 > 3 processes: 2 running, 1 sleeping > CPU states: 1.7% user, 52.3% nice, 44.9% system, 1.1% interrupt, 0.0% > idle > Mem: 494M Active, 1034M Inact, 357M Wired, 97M Cache, 199M Buf, 21M Free > Swap: 3072M Total, 104K Used, 3072M Free > What's worth attention here is that, cpu spends nearly all of its time > in kernel mode. > Number of hits, the web server gets did not change much, maybe a little > rise. > Can you please provide some info tracking down the problem? Have you optimized your tables/indexes recently? Also - do you have a large number of outstanding connections to the db? Eric -- ------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Talk sense to a fool and he calls you foolish. ------------------------------------------------------------------