Operating System - HP-UX
1752815 Members
5988 Online
108789 Solutions
New Discussion юеВ

Re: glance monitor confusion information

 
Unix1
Occasional Visitor

glance monitor confusion information

Hi,


I am seeing high CPU usage when running a heavy workload of reports and I am using "glance" utility to monitor resources.
My question is that when I use "top" utility to check CPU usage vs glance I am seeing a different value for CPU usage when using glance. Lets say that when using glance the CPU usage for a specific process is 40% and I have a
HPUX Itanium server with 4 CPUs but the process table header says "400% max" and this is because I have 4 CPUs. Can I state that 40% for this case means 10% if I am using 1 CPU (100% max)? or definitively if CPU% is showing me 40% of 400% max means that the process is really taking 40% of the just 1 CPU in a 4 CPU machine?

I am asking this because "top" on HPUX is showing fifferent data, meaning 10% of CPU for same process instead of 40%.

 

My guess is that that 40% of 400% is 10% consumption of 1 CPU, Am I right?

 

Sorry if the question is to naive

 

Thanks

3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: glance monitor confusion information

With top, it shows percentage of one CPU and I've seen 400% when multiple threads were busy.

I'm not sure about glance.

Bill Hassell
Honored Contributor

Re: glance monitor confusion information

top is a classic tool that lacks the special measurement interfaces that are available with Glance. If you have 4 processors and run 4 processes that do nothing but loop with no I/O, then each process will report 100% CPU usage. And in Glance, these 4 processes will add up to 400% usage. To demonstrate simple CPU usage, use this super small script:

 

while :
do
:
done

Put it into a file such as cpubusy, make it executable and then run four copies like this:

 

./cpubusy &
./cpubusy &
./cpubusy &
./cpubusy &

 These 4 processes will each consume 100% CPU and both Glance and top will report similar results. And in top, you'll see the 4 processes change priority (a higher number) as they become less important due to the continuous CPU usage. That means that other processes (like an interactive shell or login) will be unaffected by the 100% CPU processes.

 

Now it gets tricky. If a process is threaded (such as Java junk), CPU usage may be reported by Glance as more than 100%. The reason is that each thread is counted in Glance as part of the same process but its code is run independently, usually in different processor. A good example is Data Protector's rds program. The crude top code will simply show the main program but Glance will also add in the thread CPU usage. For instance, top may show rds consuming 65%, but Glance might report 95% or even 120%. Glance is correct and you can see why by typing the letter G (that's UPPERCASE G) and selecting the process ID for rds. You'll then see all the threads that are part of rds.

 

 



Bill Hassell, sysadmin
Unix1
Occasional Visitor

Re: glance monitor confusion information

Thank you very much for your feedback!