LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-03-2011, 07:28 AM   #1
AchimRS
Member
 
Registered: Mar 2005
Location: Germany
Distribution: Debian Wheezy
Posts: 42

Rep: Reputation: 0
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
 
Old 11-03-2011, 08:13 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
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.
 
0 members found this post helpful.
Old 11-03-2011, 03:32 PM   #3
AchimRS
Member
 
Registered: Mar 2005
Location: Germany
Distribution: Debian Wheezy
Posts: 42

Original Poster
Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
make-kpkg fails on amd64 dual core but works on single cpu robertkey Linux - General 1 01-03-2012 07:07 AM
Confusing CPU utilization from top output sumedh.inamdar Linux - Newbie 2 01-12-2011 06:06 PM
top CPU% reported over 100% on single core system alburdet619 Linux - General 6 07-15-2010 03:24 PM
Unknown CPU usage - top and ps don't show the cause gimpy530 Linux - General 8 10-15-2009 01:32 PM
Single cpu-core used on multicore system when processes communicate with pipe merijnv Linux - Kernel 3 04-10-2009 09:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration