LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   TOP output Cpu(s) and %CPU don't fit on single core (https://www.linuxquestions.org/questions/linux-general-1/top-output-cpu-s-and-cpu-dont-fit-on-single-core-911635/)

AchimRS 11-03-2011 07:28 AM

TOP output Cpu(s) and %CPU don't fit on single core
 
Code:

Tasks:  51 total,  2 running,  49 sleeping,  0 stopped,  0 zombie
Cpu(s): 57.0%us, 29.9%sy,  0.0%ni, 12.8%id,  0.0%wa,  0.0%hi,  0.3%si,  0.0%st
Mem:    61540k total,    58304k used,    3236k free,        0k buffers
Swap:        0k total,        0k used,        0k free,    30872k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
26260 root      14  -6 18032 3348 2524 R  7.9  5.4  0:00.27 php
23258 root      20  0 28648 1280  864 S  3.5  2.1  20:21.67 rsyslogd
  676 root      14  -6 11692 1260  920 S  2.6  2.0 127:45.52 theLogic
26174 root      20  0  2532 1120  908 R  2.1  1.8  0:00.52 top
  672 root      14  -6 45224 1088  780 S  0.9  1.8 387:29.52 theServer
26259 root      14  -6  1660  476  424 S  0.6  0.8  0:00.02 sh
  118 root      20  0    0    0    0 S  0.3  0.0  6:23.65 pdflush
    1 root      20  0  2016  144  52 S  0.0  0.2  0:45.72 init
    2 root      15  -5    0    0    0 S  0.0  0.0  0:00.00 kthreadd

This is the top output of a small embedded single core ARM machine. So independent of pressing "1" to show CPU0 in the summary line or not, it shows the same.
I can't understand the "Cpu(s)" line in the overview in relation to the "%CPU" column showing the processes. So it looks like the CPU is close to 90% utilized, but the processes consume less than 20%.
  • How to check what is right, the Cpu(s) line or the %CPU column?
  • How to find the process needing so much CPU (ps auxf is closer to %CPU)?
  • What the hell needs 30% system CPU, I think it's much too much??
Thanks
Achim

syg00 11-03-2011 08:13 AM

top vs ps is apples vs oranges.
You need to know what is being measured to know what is being reported. Read the respective manpages - very carefully. How (exactly) did you get that top report ?.

As for the %sy, best bet would be a dodgy driver - or maybe interrupt handler. Which may indeed be the same thing of course. But I don't know ARM.

AchimRS 11-03-2011 03:32 PM

according the man entry of ps command, the %CPU is the allover percentage during lifetime of the processes, so it is not a snapshot like done with top.
But at the end, I'm talking about a server with more or less constant load over all processes. So the allover percentage should not so much away from the actual percentage. And basically it is similiar to top's column.

Still I don't know why the Cpu(s) load (sum of user & system) from top differs so much from the %CPU column from top. Any idea?

BTW: I'm using EmDebian Squeeze


All times are GMT -5. The time now is 01:21 AM.