LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ps not sum all CPU usage (https://www.linuxquestions.org/questions/linux-newbie-8/ps-not-sum-all-cpu-usage-799652/)

Rodnower 04-02-2010 03:25 PM

ps not sum all CPU usage
 
Hello,
I run CentOS 5 on VMware 7.0.1, and when Firefox is up, computer's CPU (both on host and guest) is 99%~100% use. I watch this in GUI System Monitor In Linux, but when I open Processes tab (or respectively use ps aux command) that what I see
0.1 /usr/sbin/vmtoo
2.8 /usr/bin/Xorg :
0.1 metacity --sm-c
0.2 nautilus --no-d
0.1 /usr/lib/vmware
0.3 gnome-terminal
28.5 /usr/lib/firefo
13.4 gnome-system-mo
(names are cut)
sum: 45.5
all other is 0.0

In resources tab I see 99% CPU use. When I close Firefox CPU usage become be ~10%.

Some one can tell me how I can see more realistic image of CPU like it is in Windows for example?

Thank you for ahead.

rweaver 04-02-2010 03:36 PM

Actually that is probably fairly accurate in reality. You can get a better running idea by using 'top'.

Rodnower 04-02-2010 04:11 PM

Thank you for replay.

Well, my problem isn't so deterministic...
Now I running Firefox again and it not use too much CPU.
Top actualy display the same (I mean sum of CPU usage) information like ps aux or System Monitor (but it is clear that top is more useful).

So, I gues, that in every case there is some processes that not dispalyed or "CPU leakage" if it is possible...

Mr-Bisquit 04-02-2010 04:45 PM

Run ps with the different options in the man page. Compare each with the output of top.

syg00 04-02-2010 07:38 PM

Lies, damn lies and statistics. You can do anything you like with numbers - and it's even worse when you are using sampled data.
But in your case I suspect you are merely missing the "sys" component.

A cpu is considered 100% busy if there is no time when it is not busy. Sounds the same but isn't necessarily - especially with sampled data. And if (for example) kernel mode code is running half the time, only 50% is available to userland. But it's still 100% busy.
Maybe.

Short answer, don't try to be too exact.

Rodnower 05-12-2010 03:24 PM

Thank you all, I will try run ps with different options and be less exact...


All times are GMT -5. The time now is 04:16 AM.