From owner-freebsd-current@FreeBSD.ORG Tue Feb 26 18:25:30 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 500311065673 for ; Tue, 26 Feb 2008 18:25:30 +0000 (UTC) (envelope-from barney_cordoba@yahoo.com) Received: from web63911.mail.re1.yahoo.com (web63911.mail.re1.yahoo.com [69.147.97.126]) by mx1.freebsd.org (Postfix) with SMTP id F188213C457 for ; Tue, 26 Feb 2008 18:25:29 +0000 (UTC) (envelope-from barney_cordoba@yahoo.com) Received: (qmail 85367 invoked by uid 60001); 26 Feb 2008 18:25:29 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=6PHSlkfKhcCMA2xtBvE7CiS1RN+VYdXZVJdCVAggbsHuZbIxSYjhGZPbI9nhJa/HUY9LFJYKKse4netgOfroIA3qET0/Jh/P5TEIXDRm+tIEeTlllXTWExeaeB645yYZw2gtc3upEKxeoxsmGAstirPBwJSa9JiOP/3rpj17RVw=; X-YMail-OSG: 972DLdkVM1kaFey3XbwIA_JIqVxsxPCXy_7TC_4NYL40pdI1GdivnG7JtMhRCDN7O5vwCurVTJv.IwjqyMpFamuJTMkoeG6tUFQ8QZCZORwGCrp6BsU- Received: from [98.203.28.38] by web63911.mail.re1.yahoo.com via HTTP; Tue, 26 Feb 2008 10:25:28 PST Date: Tue, 26 Feb 2008 10:25:28 -0800 (PST) From: Barney Cordoba To: current@freebsd.org In-Reply-To: <20080224223903.Q920@desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <119186.84635.qm@web63911.mail.re1.yahoo.com> Cc: Subject: Re: Re[2]: cpu usage in 7.0 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2008 18:25:30 -0000 --- Jeff Roberson wrote: > On Mon, 25 Feb 2008, Daniel Gerzo wrote: > > > Hello Jeff, > > > > Sunday, February 24, 2008, 11:47:39 PM, you wrote: > > > >>> So how does a multithreaded process get 458% CPU > on a quad-core machine? :) > >>> (Really, I want to know; I thought thread CPU > accounting was fixed in 7.x. > >>> Unless I'm mistaken, 4 CPU-intensive threads in > a single process should > >>> account as 4 CPU-intensive single-thread > processes; i.e. each could only take > >>> up to 100% of a core/CPU, accounting for > NCPU*100% total). > >>> > >>> > > > >> It is possible for the sum of all threads in the > system to exceed 100% > >> cpu. This is because the decay function is not > precise. 15% over is a > >> bit more than I would expect but I suppose it's > possible. We also inhert > >> pcpu information from the parent on fork/thread > creation so the child > >> isn't created with a priority as if it had been > idle. So for a moment the > >> utilization is duplicated. > > > > I have a box running mysqld, which sometimes > exeeds 130%, what about > > this? ;) > > > > Also the mysqld is alsmost all the time in the > "ucond" state, what > > does it mean? I've been told that it is probably > waiting for I/O, but > > then, I have another box which is currently > completely idle, but > > running mysql shows that it is "ucond" as well. > > You should switch top to display threads. 'H' is > the key to do it. > Otherwise you only get the wait channel for one of > the threads. Others > may be busy doing things. > > 'ucond' means the thread is waiting on a userland > condition variable. > This is a type of synchronization point in userland > accessed via the > pthread_cond_*(3) api. It may indicate a thread > that is waiting for work > but other threads may be busy. > > Do you only have one CPU? If you're seeing 130% on > a single cpu system we > may need to take some steps to improve the > reporting. > > > > > > -- > > Best regards, > > Daniel > mailto:danger@FreeBSD.org I'd like to note that I find it confusing and inconsistent to have Top average the cpu usage as the main usage figure, but use a different formula for the processes themselves. Barney ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping