From owner-freebsd-questions@FreeBSD.ORG Thu Oct 14 20:46:11 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 A76D2106566C for ; Thu, 14 Oct 2010 20:46:11 +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 8481A8FC17 for ; Thu, 14 Oct 2010 20:46:11 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=ISO-8859-1; format=flowed Received: from [69.69.69.193] ([69.70.93.206]) by VL-MO-MR005.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 32bit)) with ESMTP id <0LAA00L1SPKT0JF0@VL-MO-MR005.ip.videotron.ca> for freebsd-questions@freebsd.org; Thu, 14 Oct 2010 15:46:05 -0400 (EDT) Message-id: <4CB75E05.4070207@optiksecurite.com> Date: Thu, 14 Oct 2010 15:46:13 -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: freebsd-questions@freebsd.org Subject: 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: Thu, 14 Oct 2010 20:46:11 -0000 Hi list! I did a strange observation yesterday night. The CPU usage reported by top doesn't match what is indicated under it. I was seeing around 80-90% user, 5% system, 1% interrupt and 10% idle. But the process details under it doesn't match. mysqld was taking around 250% (WCPU) with a few httpd processes at 1-2%. The system is running GENERIC 8.0-REL on a Xeon E5630 (quad core with hyperthreading so 8 CPUs). MySQL and Apache each have their own jail (I don't think it will matter but just in case) I understand why the mysqld process take more than 100% but how can I know what's taking the rest? Why doesn't the total user CPU usage match the total of the CPU usage of each process? Is there a link with hyperthreading? There sure is a logical answer and I would really like to know it :) Thanks in advance, Martin