Date: Thu, 17 Aug 2006 09:41:11 -0500 From: Dan Nelson <dnelson@allantgroup.com> To: Bill LeFebvre <bill@lefebvre.org> Cc: freebsd-stable@freebsd.org Subject: Re: TOP shows above 100% WCPU usage Message-ID: <20060817144110.GB88424@dan.emsphone.com> In-Reply-To: <44E3FE61.6060800@lefebvre.org> References: <44E1F796.5070105@rogers.com> <20060815172728.GB88051@dan.emsphone.com> <44E204C0.60806@rogers.com> <44E3FE61.6060800@lefebvre.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Aug 17), Bill LeFebvre said: > Mike Jakubik wrote: > >Dan Nelson wrote: > >>>How can mysql use 160%? Is this a reporting bug in top because mysql > >>>is threaded? > >>You have multiple CPUs, so a threaded process can theoretically reach > >>100*ncpus cpu usage. > > > >Ahh, thats makes sense, thanks. > > Actually it doesn't. IMO, %CPU should be biased for all available > cpu, not just a single cpu. In other words, a single-threaded > process running on a two processor box should never see more than 50% > cpu. That's how top computes it for SunOS. But for freebsd top only > displays whats in the proc structure and I don't know off-hand how > the kernel records it. One problem is that method doesn't scale to lots of CPUs. On a Sun T2000 a non-threaded process consuming all of one CPU would only report 3.12 %CPU in that case (100/32). I just built top-3.6 on such a system, though, and it does report a simple "main(){for(;;);}" process as consuming 100 %CPU. Maybe you're thinking of Solaris's own prstat command? -- Dan Nelson dnelson@allantgroup.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060817144110.GB88424>