System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Query about the top ouptut on Linux Server

jaivinder
Frequent Advisor

Query about the top ouptut on Linux Server

Hi!

I have dual CPU linux server on which a user application had run for 7 days. There is a script that takes the top results after 5 minutes during this run. Please refer to the top result , below 571 is the process id for teh application that i am monitoring for CPU usuage. From the top result, i have concluded that :

CPU% for Application ( PID : 571 ) is 107
Ideal CPU id is 98.3%

QUERY:
------

(1) Why the application's CPU% is more than 100.

(2) From the top results that i have generated for 7 days, it has been found that sometimes the CPU% is even more than 200%

Throughout the span there was no crashing of the apllication because of this increase in CPU and it ran perfectly fine for 7 days. Is this correct ???

If yes, then how is :

Total CPU = CPU used + CPU Ideal.


----------------------------
Please find the top result :
-----------------------------
top - 00:57:24 up 16 days, 6:22, 2 users, load average: 0.36, 0.33, 0.29
Tasks: 81 total, 1 running, 80 sleeping, 0 stopped, 0 zombie
Cpu(s): 1.6% us, 0.1% sy, 0.0% ni, 98.3% id, 0.1% wa, 0.0% hi, 0.0% si
Mem: 8310676k total, 2920448k used, 5390228k free, 158708k buffers
Swap: 2031608k total, 0k used, 2031608k free, 1456932k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
571 oas 15 0 3011m 1.1g 15m S 107 13.7 47:59.98 java
1 root 16 0 1992 548 472 S 0 0.0 0:02.42 init
2 root RT 0 0 0 0 S 0 0.0 0:00.21 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/0
4 root RT 0 0 0 0 S 0 0.0 0:00.32 migration/1
5 root 34 19 0 0 0 S 0 0.0 0:00.02 ksoftirqd/1
6 root RT 0 0 0 0 S 0 0.0 0:00.11 migration/2
7 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/2
8 root RT 0 0 0 0 S 0 0.0 0:00.10 migration/3
9 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/3
10 root 5 -10 0 0 0 S 0 0.0 0:00.07 events/0
2 REPLIES
Liviu I.
Frequent Advisor

Re: Query about the top ouptut on Linux Server

1)
CPU usage > 100% is because top makes a summary of the 2 processors you have (or 1 with HT).

Hit 1 when watching top output and you'll start to see the difference, then pres "f" (for choosing the columns to display, and then "j" (for displaying the processor used by each process) then

Now you should have a more accurate display.

please notice that it is not about "CPU Ideal" but CPU Idle, that's the time spent by processor for doing "nothing".

2) I don't think that CPU user (userspace programs) + CPU system (system calls) + CPU Idle, for a 2 processor set is more than 200%. I suppose you didn't compute something right.
Steven E. Protter
Exalted Contributor

Re: Query about the top ouptut on Linux Server

Shalom,

Why is cpu exceeding 100%

Because hyperthreading and dual core technology is hitting the market faster than top is changing.

translation: stop is a very crude tool and is too stupid to figure out whats going on.

For real reliable results, get a real tool.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com