High CPU usage applet
persia at ubuntu.com
Fri May 8 05:42:52 UTC 2009
Mackenzie Morgan wrote:
> On Friday 08 May 2009 12:40:04 am Timo Sirainen wrote:
>> Somewhat relevant, yes, but I think people talking in that page don't
>> understand correctly the root cause of the problem. Linux scheduler is
>> good enough nowadays that even lots of processes all eating 100% CPU
>> don't make the system unusable. The problem comes from when some
>> process eats all the memory and starts forcing other processes to swap.
>> I just tested this actually. I created 100 processes running an
>> infinite loop, causing the system load on a 2 core machine to hit 100.
>> It was a bit sluggish, but still perfectly usable.
> Quick question:
> On a dual-core machine, does 100% CPU mean 100% of *both* cores or 100% of one
> and 0% of the other?
> I'm pretty sure I've seen top report 105% for a process before, so I thought
> 100% on a dual core was really only half of the processing power.
It depends on how you measure it (and different applications report
it differently), but yes, on a multicore machine, a single-threaded
runaway process consumes only a portion of the available CPU. It still
costs heat and power and component failure rate. A multithreaded
application with multiple runaway threads can consume all available CPU
power, but this is usually noticable, and the user will do something.
It's the case of the runaway process that consumes a sufficiently
small proportion of resources that the user continues to operate
blissfully unaware of the situation that would be good to monitor and
report. There exist cases where this is desired (e.g. long compilation,
data analysis, etc.), in which case the user can choose to do nothing.
In other cases, where it's not desired, the user could get a longer
battery life, or improved machine health, or just a snappier response.
In cases where this is a result of the Ubuntu code, and represents a
fixable bug, notification to the user could result in better bug
reports, and a better chance of fixing things.
More information about the Ubuntu-devel-discuss