1753534 Members
5508 Online
108795 Solutions
New Discussion юеВ

CPU usage (top output)

 
surya_3
Occasional Contributor

CPU usage (top output)

I am pasting the output of top -h from my HP_UX 11.11 server. It shows the process using 150% of cpu .. But the sar output is showing there is 22% idle time .
Can any one give some idea or suggest the links where i can find the related docs ..

Load averages: 2.88, 2.60, 2.54
212 processes: 198 sleeping, 14 running
Cpu states: (avg)
LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
2.88 70.9% 0.0% 13.5% 15.6% 0.0% 0.0% 0.0% 0.0%

Memory: 1187820K (741656K) real, 2203156K (1551420K) virtual, 24816K free Page# 1/8

CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
0 ? 3902 root 152 20 18492K 83796K run 613:44 144.62 144.37 java
0 ? 1191 root 168 10 599M 453M sleep 11182:07 7.42 7.41 diagmond
1 ? 28797 root 152 20 43068K 97304K run 39:06 0.72 0.72 java
0 ? 0 root 127 20 0K 0K sleep 131:26 0.40 0.40 swapper
0 ? 34 root 152 20 0K 6464K run 92:02 0.33 0.33 vxfsd
0 ? 976 root 178 20 1780K 560K run 28:33 0.26 0.26 snmpdm
1 ? 14435 root 152 20 148M 4188K run 306:46 0.25 0.25 mad


sar output
00:20:07 %usr %sys %wio %idle
00:20:12 70 6 1 22
00:20:17 67 6 1 26
00:20:22 71 7 2 21
00:20:27 68 7 2 23
00:20:32 70 3 1 25

Average 69 6 1 23

Thanks in advance ,
spv
7 REPLIES 7
Ken Hubnik_2
Honored Contributor

Re: CPU usage (top output)

Information from TOP cannot be trusted. It is an old utility. Put your trust in glance or sar.
S.K. Chan
Honored Contributor

Re: CPU usage (top output)

What about the these number from glance ? If you have glance find out what the number for %idle is. The tool top is like a "snapshot" and it's not as dynamic, that would explain the difference you see.
Adam J Markiewicz
Trusted Contributor

Re: CPU usage (top output)

Hi

To be the most precise top gets mad in multithreaded processes. It calculates the percentage by summarizing time for every thread that was ready (not meaning they were runnung) and divides it by the total elapsed time.

So if you have pure busy-loop, if you start it in two threads you'll receive 200%. In 3 threads - 300%... Perfect hardware accelerator ain't it? ;)

Good luck

Adam

I do everything perfectly, except from my mistakes
Helen French
Honored Contributor

Re: CPU usage (top output)

Actually from the average listing from the 'top' command, the IDLE % is almost same as that of the sar output (15.6%)? The 150% usage is at the %CPU listing. How many CPUs you have? In a multiple CPU system, this can be the CPU usage from more that one CPU (more than 100%).

You may have to consider using GlancePlus to find out the usage/CPU and then recalculate the total system usage, IDLE time etc.
Life is a promise, fulfill it!
Steven E. Protter
Exalted Contributor

Re: CPU usage (top output)

Performance data collection script attached. It runs background, any time period you set in the script.

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
John Bolene
Honored Contributor

Re: CPU usage (top output)

You have 2 processors showing in the top listing, the total utilization can go to 200%.

The java must be multi-threaded, otherwise it can only go to 100%, or using all of one processor.

We run java and it is a pig (spelled PIG) in both memory and cpu usage.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
surya_3
Occasional Contributor

Re: CPU usage (top output)

Hi all ,

There is 2 processers in the server .
I will see the options u suggested ,

thankx ,
spv