LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-20-2008, 05:24 PM   #1
jr8rdt
LQ Newbie
 
Registered: Oct 2006
Posts: 17

Rep: Reputation: 0
CPU usage from top


I have Quad single processor machine (RH AS4).
and running a single threaded application.
how come , using top, the individual proc usage was more than 100%?
can anybody interpret this?
thanks




top - 00:09:01 up 35 min, 3 users, load average: 1.35, 1.27, 0.72

Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie

Cpu(s): 16.7% us, 16.9% sy, 0.0% ni, 65.9% id, 0.0% wa, 0.5% hi, 0.0% si

Mem: 8310676k total, 1731672k used, 6579004k free, 17412k buffers

Swap: 2031608k total, 0k used, 2031608k free, 130268k cached



PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

4918 root 20 0 1640m 1.3g 4424 S 106 16.5 10:29.28 get_update
 
Old 05-20-2008, 05:25 PM   #2
jr8rdt
LQ Newbie
 
Registered: Oct 2006
Posts: 17

Original Poster
Rep: Reputation: 0
and what does it mean? how it's calculated ?

Cpu(s): 16.7% us,
 
Old 05-20-2008, 07:09 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
If you run top, then type '1', you'll see each individual core separately accounted for.
 
Old 05-20-2008, 07:12 PM   #4
rlhartmann
Member
 
Registered: Mar 2008
Posts: 73

Rep: Reputation: 16
If you have a quad core processor, you really have four processors, if you press a "1" (at least in my version of top) it will give you a breakdown per processor.

Cpu0 : 5.3% us, 1.3% sy, 0.0% ni, 93.0% id, 0.0% wa, 0.3% hi, 0.0% si
Cpu1 : 1.0% us, 0.3% sy, 0.0% ni, 98.7% id, 0.0% wa, 0.0% hi, 0.0% si

Processes work in either userspace US, or system (kernel space)SY. Actually I believe
kernel spaces is only device driver calls and other kernel processes. NI referces to
niceness. There are commands nice and renice which can change the base priority of a
process. I.e. a nice process runs at a lower priority. ID is idle, WA is wait state,
waiting for some physical device RAM, harddrive, etc. Not sure about the HI and SI
values.
 
Old 05-20-2008, 08:18 PM   #5
eggixyz
Member
 
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Hey There,

Some versions will show you multiple processor stats if you type capital "I" when your in interactive mode. To switch back to your old view, just type the capital "I" again.

Best wishes,

Mike
 
Old 05-22-2008, 05:29 PM   #6
jr8rdt
LQ Newbie
 
Registered: Oct 2006
Posts: 17

Original Poster
Rep: Reputation: 0
I only have the output file from this Top batch. so I can not press "1" or "I". So the txt file is all I got.

How do I interpret this stats??


I suspect that the "CPU(s)" number is the average of all 4?? is that right ?

and what does 106 cpu usage mean?

I need help interpreting the ouput.


----
top - 00:09:01 up 35 min, 3 users, load average: 1.35, 1.27, 0.72

Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie

Cpu(s): 16.7% us, 16.9% sy, 0.0% ni, 65.9% id, 0.0% wa, 0.5% hi, 0.0% si

Mem: 8310676k total, 1731672k used, 6579004k free, 17412k buffers

Swap: 2031608k total, 0k used, 2031608k free, 130268k cached



PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

4918 root 20 0 1640m 1.3g 4424 S 106 16.5 10:29.28 get_update
 
Old 05-22-2008, 10:32 PM   #7
eggixyz
Member
 
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Hey There,

Yes, you're correct. By default on a multiprocessor system, if you just run top straight up, it's supposed to be the total of all four.


Check the man pages for your distro if you want to see less generic numbers, even with the 106% cpus. You just need to pass the flag so that top will show what cpu the process is running on and it should be under or equal to 100%

Best wishes,

Mike
 
Old 05-22-2008, 10:35 PM   #8
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,382

Rep: Reputation: 55
It is greater than 100 because it is using power from 2 cpus, ex 100 from 1 and 6 from another, or 53 from one 53 from another. On a quad core server you have a total of 400% that can be used.
 
Old 06-24-2009, 11:11 AM   #9
sunw75
LQ Newbie
 
Registered: Nov 2005
Posts: 1

Rep: Reputation: 0
cpu % from top

Yes abefroman is correct. 8 cores = 800% max cpu usage
Compare the numbers in bold.

Cpu0 : 45.8%us, 0.3%sy, 0.0%ni, 52.2%id, 0.0%wa, 0.0%hi, 1.7%si, 0.0%st
Cpu1 : 4.0%us, 0.3%sy, 0.0%ni, 95.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu2 : 60.7%us, 0.0%sy, 0.0%ni, 39.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 20.3%us, 0.3%sy, 0.0%ni, 79.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu4 :100.0%us, 0.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu5 :100.0%us, 0.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu6 : 41.7%us, 0.0%sy, 0.0%ni, 58.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu7 : 87.0%us, 0.0%sy, 0.0%ni, 13.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st

9265 proc1 17 0 4091m 2.5g 29m S 184 8.1 56:13.22 engine
8200 proc2 17 0 2520m 1.7g 29m S 108 5.3 40:17.16 engine
8432 proc3 17 0 2527m 1.9g 29m S 108 5.9 40:42.22 engine
29346 proc4 16 0 987m 596m 28m S 31 1.9 78:07.67 engine
8266 proc5 19 0 2566m 1.5g 29m S 19 4.9 38:46.66 engine
6987 proc6 17 0 798m 309m 29m S 9 1.0 3:53.40 engine
29353 proc7 17 0 722m 242m 29m S 2 0.8 4:32.30 engine
1928 proc8 18 0 141m 2636 1036 S 0 0.0 0:30.34 ticc
4718 proc9 15 0 1673m 643m 26m S 0 2.0 0:59.79 agent
18322 proc9 16 0 5656 1300 884 S 0 0.0 0:08.89 top
29340 proc9 17 0 676m 160m 25m S 0 0.5 2:06.29 engine
 
Old 06-24-2009, 01:15 PM   #10
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
In the original post, you see one number in red that is obviously the average of contributions from four cores and one number in red that is obviously the sum of contributions from four cores.

I look at a lot of different performance data from top and other tools. Usually it is just a minor annoyance that I can't remember which numbers represent average of cores vs. sum of cores. Sometimes it leads to real confusion.
 
Old 08-17-2011, 06:46 AM   #11
jainprithviraj
LQ Newbie
 
Registered: Aug 2011
Posts: 1

Rep: Reputation: Disabled
Hello Friends,

Is it possible to get the splitted cpu consumption (eg: CPU1 : 10%, CPU : 20% and so on...) for a particular process. Can this be done in non-interative mode.

~Prithvi
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Other than top command which cmd is used to find the cpu usage and disk space sathish80 Linux - Newbie 2 11-15-2006 12:43 AM
"top" cpu usage edgjerp Mandriva 2 11-12-2005 05:21 AM
Top CPU usage explanation penguinco Fedora 3 11-30-2004 01:01 PM
need top clone- to measure CPU usage pao Linux - Software 4 10-07-2004 09:46 AM
Individual CPU usage not showing in ps/top hulli Linux - General 2 08-24-2004 02:44 AM


All times are GMT -5. The time now is 10:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration