Operating System - HP-UX
1820254 Members
2566 Online
109622 Solutions
New Discussion юеВ

cpu utilization by top command

 
SOLVED
Go to solution
Shivkumar
Super Advisor

cpu utilization by top command

Dear Sirs;

We noticed cpu utilization 95%. When we ran top command; found below resultS:

Load averages: 1.78, 1.81, 1.83

458 processes: 371 sleeping, 87 running

Cpu states:

CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS

0 1.69 3.6% 0.0% 96.4% 0.0% 0.0% 0.0% 0.0% 0.0%

1 1.67 6.9% 0.0% 93.1% 0.0% 0.0% 0.0% 0.0% 0.0%

2 1.98 7.9% 0.0% 89.9% 2.2% 0.0% 0.0% 0.0% 0.0%

3 1.79 44.0% 0.0% 56.0% 0.0% 0.0% 0.0% 0.0% 0.0%

--- ---- - - - - - - - -----

avg 1.78 15.5% 0.0% 83.9% 0.6% 0.0% 0.0% 0.0% 0.0%


Memory: 4027608K (2679716K) real, 18058048K (7612636K) virtual, 1414296K free Page# 1/10



CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND

2 ? 18399 weblogic 152 20 1391M 278M run 526:28 238.44 238.02 java

2 ? 19591 weblogic 152 20 1391M 257M run 280:18 90.80 90.64 java


How come %CPU utilization for java can be 238% ? Also what does CPU 2 signifies?

Is above output of the top command pointing out at some unusual condition ?

Thanks,
Shiv
17 REPLIES 17
Alex Lavrov.
Honored Contributor

Re: cpu utilization by top command

Hey,

You have 4 CPU's, so it's 400% of CPU. If java takes 238%, it means it utilizes 2.4 cpu's.

Maybe there is some heave operation in progress or maybe something went wrong. You should check deeper to see if you can find an explanation for this high utilization.

Alex.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Muthukumar_5
Honored Contributor

Re: cpu utilization by top command

CPU gives the cpu number where application is running.

%CPU is the raw cpu percentage calculated for that top display.

what you are getting for,

# UNIX95= ps -ef -o cpu,pcpu,pid,comm

Top display may be sometimes is not relavent.

hth.
Easy to suggest when don't know about the problem!
morganelan
Trusted Contributor

Re: cpu utilization by top command

I think 1 cpu max 100% utilization can not more than 100%, your top command report wrong utilization.
Kamal Mirdad
Raj D.
Honored Contributor

Re: cpu utilization by top command

Hi Shiv ,

You are having 4 processor hence java showing 238.02 ,

You can check

# sar -u -M 5 5

for cpu utilisation for all the processor.

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Alex Lavrov.
Honored Contributor

Re: cpu utilization by top command

Java process probably spawns and that's how it can utilize more than one CPU. So 238% make sence.

Alex.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Victor BERRIDGE
Honored Contributor

Re: cpu utilization by top command

Hi Shiv,
what does CPU 2 signifies? That process is running on CPU 2...
I would add after the previous replies, you have 4 CPU they all report a max sys load ( OK no nice...) the 2 process you show run by the same CPU, what is run by the 3 others?

About unusual condition, you are the one who can answer, you only can tell us how it "normally" behaves and if this is the case or not...


All the best
Victor
Raj D.
Honored Contributor

Re: cpu utilization by top command

Hi Shiv,

You can check with glance also ,

It will say "CPU Utilisation 400% MAX" in the heading as you are having 4 cpu.

Also check this script , cpu and memory report can be found in 15 seconds interval , and stores in a file cpumem.log

Cheers,
Raj.

" If u think u can , If u think u cannot , - You are always Right . "
Mahesh Kumar Malik
Honored Contributor
Solution

Re: cpu utilization by top command

Hi Shiv

1. Generally CPU utilisation should not be this high. Check the process which is eating up CPU utilisation.

2. Suggest to go far "Work Load Manager" from HP in order to allocate resources to CPUs.

3. CPU 2 shows that java process is running on it.

Regards
Mahesh

Joseph Loo
Honored Contributor

Re: cpu utilization by top command

hi,

%WCPU is just a 'forecast' value for the process. It really has no real world value. It's value is totally controlled by the scheduler. refer to this:

http://www1.itrc.hp.com/service/cki/search.do?category=c0&prevQueryString=cpu+AND+top+AND+100+AND+more&mode=id&searchString=UCMDSKBRC00009042&searchCrit=allwords&docType=Security&docType=Patch&docType=EngineerNotes&docType=BugReports&docType=Hardware&docType=ReferenceMaterials&docType=ThirdParty&dateRange=all&search.x=33&search.y=15


refer to this KB which recommends Glance for in-depth look at CPU statistic rather than top command:

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000071337163

regards.
what you do not see does not mean you should not believe
Yogeeraj_1
Honored Contributor

Re: cpu utilization by top command

hi,

if you run Glance, the output wwill bemuch clearer:

e.g. on a 2 CPU system, the CPU util column will look like...

CPU Util
( 200% max)
------------
59.5/13.9
13.0/ 3.1
9.5/ 0.2
9.2/ 0.1
8.1/ 0.6
6.7/ 4.3
5.8/ 1.8
5.2/ 0.4
2.9/ 0.6
2.3/ 0.4
2.3/ 0.2


hope this helps

regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
George Neill
Trusted Contributor

Re: cpu utilization by top command

As others have noted glance is a good tool to use to help with this. A process can have sub-processes known as threads. Each thread can run on a different CPU and the thread total CPU usage is displayed as the CPU useage for the process. As noted, with 4 CPUs you would have a potential total 400% utilization. With glance you can easlily see how many threads a process has and then get a display of the performance of each thread. I just checked a system we have running java and it does have many threads.

Regards,

George
Tim D Fulford
Honored Contributor

Re: cpu utilization by top command

Hi

I'm concerned about the high sys CPU, only 15.5% of the CPU is concerned with user.. and a whapping 83.9% is sys CPU. This implies something is doing too much sys calls (usulally IO related), but there could be spinning processes too.

Check withing glance what process 18399 is doing as far as threads, I'm guessing there may be two spinning threads.

Regards

Tiom
-
Shivkumar
Super Advisor

Re: cpu utilization by top command

What are the spinning processes and threads ? Thanks.
Yogeeraj_1
Honored Contributor

Re: cpu utilization by top command

hi shiva,

from what i can recall, spinning threads and threads do useful work must compete for logical processors. Thus, spinning threads can impact the performance of multithreaded applications to a greater extent on Threaded systems.

Depending on the architecture, the spinning can cause a high load on the system bus, eventually slowing down all other processors.

hope this helps!
regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Yogeeraj_1
Honored Contributor

Re: cpu utilization by top command

hi again,

read also: http://h21007.www2.hp.com/dspp/files/unprotected/hpux/MXN.pdf

regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Stuart Whitby
Trusted Contributor

Re: cpu utilization by top command

There's nothing wrong with a system which is sitting at that kind of load. In fact, I'd say that it's a well spec'd system if you can keep this up on a regular basis. It's not maxed out, still has plenty of room for other processes to run, and you're making good use of all those processors that you paid good money for.

However, this isn't to say that your application isn't having problems at the moment. (If that's the case, then HP's money-men are laughing at you ;p ) Get tusc and lsof on there and take a look at the processes involved, see if they're looping constantly. If they're doing all sorts of different things, then I wouldn't worry - it's just a busy app. Given the amount of time in system calls though, I'd guess that something is requesting a lot of I/O. I always find that easier to check with top - if it's showing a high percentage of time in kernel mode, then it's likely that something's hammering disk or tape drives.
A sysadmin should never cross his fingers in the hope commands will work. Makes for a lot of mistakes while typing.
Bill Hassell
Honored Contributor

Re: cpu utilization by top command

top is not very smart about threads so it is accumulating CPU time from all the separate threads that are running. Glance is much better in accounting for thread usage. A lot of Java code is probably out of your control (Java libraries, jar packages, etc. System overhead can be quite high in a poorly written application but you can only fix what you have written yourself. For instance, a simple program might ask the time of day in a loop and generate almost 90% system overhead. The system is working fine but the application is wasting a valuable resource.


Bill Hassell, sysadmin