From owner-freebsd-questions@FreeBSD.ORG Tue Oct 19 15:38:45 2010 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 D3960106566B for ; Tue, 19 Oct 2010 15:38:45 +0000 (UTC) (envelope-from freebsd@optiksecurite.com) Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by mx1.freebsd.org (Postfix) with ESMTP id A94218FC17 for ; Tue, 19 Oct 2010 15:38:45 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset=ISO-8859-1; format=flowed Received: from [69.69.69.193] ([69.70.93.206]) by vl-mh-mrz21.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTP id <0LAJ00ET0NGDA1F0@vl-mh-mrz21.ip.videotron.ca> for freebsd-questions@freebsd.org; Tue, 19 Oct 2010 11:38:37 -0400 (EDT) Message-id: <4CBDBB88.9030207@optiksecurite.com> Date: Tue, 19 Oct 2010 11:38:48 -0400 From: Martin Turgeon User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; fr; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 To: Adam Vande More References: <20101015071719.1536f19e@mail.ose.nl> <4CBC97CB.80604@optiksecurite.com> <4CBCA8D1.5040005@optiksecurite.com> In-reply-to: Cc: Bas Smeelen , freebsd-questions@freebsd.org Subject: Re: How is CPU usage calculated? 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, 19 Oct 2010 15:38:45 -0000 Le 2010-10-18 16:35, Adam Vande More a écrit : > On Mon, Oct 18, 2010 at 3:06 PM, Martin Turgeon > wrote: > >> I just reread it and it isn't clearer what is using the CPU so much. Can >> you please give me a little more explanation? >> > A line in top(1) like: > > CPU: 0.0% user, 0.0% nice, 0.4% system, 0.4% interrupt, 99.3% idle > > does not describe how much CPU is being used, but rather a "percentage of > time spent in each of the processor states". It's saying of the CPU cycles > that are being used, this is what it breaks down as. Since MySQL is a > userland application, you'd expect the value of user to be quite high if > that was only thing running on your system and it was under high load. > > You can infer how much CPU is being used from the line, but there are better > and more accurate methods generally of getting that information especially > with SMP systems. > Thank you for the explanation. Would you be kind enough to point me to a method so I can know for sure that it's MySQL that is taking that much CPU ?