Re: [opensuse] How can I use 1705% of the cpu?!



On Sun, 2012-02-12 at 11:48 +1030, Rodney Baker wrote:
On Fri, 10 Feb 2012 17:14:44 Basil Chupin wrote:
On 10/02/12 03:21, Adam Tauno Williams wrote:
On Thu, 2012-02-09 at 16:36 +1100, Basil Chupin wrote:
I thought that I would be really smart earlier today and decided (which
I have never done before) to open an RSS feed in "All Tabs" in Firefox
10.0. As a result there were something like 250+ tabs opened.
I then ran the System Monitor to see how much RAM I was using. 1.4GB.
OK. No hassles. 2.6GB left.
But then I looked at the cpu usage. It showed that I was using around
1,705% of cpu. Repeat, 1,705% of cpu.
Now, I ask you, this is an AMD 32-bit, single core, AMD Athlon XP 3200+.
Because the number doesn't really mean what you are assuming it means.
It is just a metric, useful in relation to itself, higher just means
higher, lower means lower, other than that it doesn't actually mean much
of anything [it certainly doesn't mean what percentage of your CPUs
registers are in use, transistors in use, or "capacity" (whatever that
means) is in use]. %-of-CPU is actually a pretty crappy metric. If you
are interested in system load pay attention to load-average, a metric
that actually has a practical meaning.
Which then makes one wonder why somebody would waste their time in
writing a program which gives meaningless crap.
Sorry, I'm actually replying to Adam but I had deleted that mail before I got
to this point. Load average is no more useful for determining actual CPU load
than % CPU Load.
Why?

Because of exactly what I said - "CPU load" doesn't actually define a
value the necessarily means anything. You can be on a host with 99% CPU
load where the applications are responsive and you can be on a host with
<1% CPU load that is panting like an overheated dog. As a value it can
also jump about crazily, up and down, so unless you are looking at a
graph you have no idea if the value is representative of a "normal"
state.

Because the load average is simply a count of the average number of processes
in the wait queue of the last minute, 5 minutes and 15 minutes (hence the 3
numbers).

Simply because the load average is an over-time value it is more useful.
Relative values are only meaningful in relation to themselves and load
average always gives you three. CPU utilization gives you one. Also
load average is influenced by the performance of the I/O subsystem -
which in real-life is where more performance constraints come from than
from CPU or CPU+Memory-Throughput

It is also clearly documented what load average is measuring. CPU % is
not.

The problem is that this does not acutally reflect how many processes are
actually waiting because process in "uninterruptible sleep" are counted as
well.

Yep. I didn't say Load Average was perfect. Just that if you want a
benchmark to stare at it is dramatically better than CPU Utilization %.

I only found this out in the last week because I was trying to figure
out how my load average could be constantly sitting around or just over 2 when
the system was sitting there otherwise idle.

See - it told you something useful! :)

Sure enough, there are 2 processess in an uninterruptible sleep state. You
can't terminate processes in this state either - the only way to get rid of
them is to reboot the machine.

This isn't true. You can usually identify why they are sleeping and
typically resetting or destroying that resource will allow the process
to abend or continue.

Since I usually only do that after a) a power
failure, b) going away for a holiday or c) after a kernel update, I guess the
load average will be sitting around 2 for a fair while yet. At least now I
know why. :-)

--
System & Network Administrator [ LPI & NCLA ]
<http://www.whitemiceconsulting.com>
OpenGroupware Developer <http://www.opengroupware.us>
Adam Tauno Williams

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx



Relevant Pages