From owner-freebsd-questions@FreeBSD.ORG Fri Oct 15 07:17:22 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 A5C27106566B for ; Fri, 15 Oct 2010 07:17:22 +0000 (UTC) (envelope-from b.smeelen@ose.nl) Received: from mail.ose.nl (mail.ose.nl [212.178.134.164]) by mx1.freebsd.org (Postfix) with ESMTP id 1D3978FC08 for ; Fri, 15 Oct 2010 07:17:21 +0000 (UTC) Received: from localhost ([127.0.0.1]) by mail.ose.nl for freebsd-questions@freebsd.org; Fri, 15 Oct 2010 09:17:19 +0200 From: "Bas Smeelen" To: freebsd-questions@freebsd.org Message-ID: <20101015071719.1536f19e@mail.ose.nl> Date: Fri, 15 Oct 2010 09:17:19 +0200 X-User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Ubuntu/10.10 Chromium/6.0.472.63 Chrome/6.0.472.63 Safari/534.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: Fri, 15 Oct 2010 07:17:22 -0000 From=3A Martin Turgeon =5Bmailto=3Afreebsd=40optiksecurite=2Ecom=5D To=3A freebsd-questions=40freebsd=2Eorg Sent=3A Thu=2C 14 Oct 2010 21=3A46=3A13 +0200 Subject=3A How is CPU usage calculated=3F Hi list! =20 I did a strange observation yesterday night=2E The CPU usage reported by= =20 top doesn=27t match what is indicated under it=2E I was seeing around 80-= 90=25=20 user=2C 5=25 system=2C 1=25 interrupt and 10=25 idle=2E But the process d= etails=20 under it doesn=27t match=2E mysqld was taking around 250=25 =28WCPU=29 wi= th a few=20 httpd processes at 1-2=25=2E The system is running GENERIC 8=2E0-REL on a= Xeon=20 E5630 =28quad core with hyperthreading so 8 CPUs=29=2E MySQL and Apache e= ach=20 have their own jail =28I don=27t think it will matter but just in case=29= =20 I understand why the mysqld process take more than 100=25 but how can I= =20 know what=27s taking the rest=3F Why doesn=27t the total user CPU usage m= atch=20 the total of the CPU usage of each process=3F Is there a link with=20 hyperthreading=3F =20 There sure is a logical answer and I would really like to know it =3A=29= Yes if you have multiple cpu=27s=2C cores or hyperthreading than each unit= can be used up to 100=25 Mysql has multiple threads=2C you can check with top -P to see the multiple= cores and when top is running give the command H =28capital H=29 to see th= e threads of each process =20 DISCLAIMER=3A This e-mail is for the intended recipient=28s=29 only=2E Acce= ss=2C disclosure=2C copying=2C distribution or reliance on any of it by anyone else is prohibited=2E If yo= u have received it by mistake please let us know by reply and then delete it from your system= =2E