Re: CPU Utilization in UNIX (398 Views)
Reply
Frequent Advisor
sathis kumar
Posts: 56
Registered: ‎08-21-2006
Message 1 of 3 (414 Views)

CPU Utilization in UNIX

Hello,

 

We need to track the CPU utilization in UNIX system [find out any process affects the performance of the system] and for that can you provide the commands that can be used? FYI - vmstat/top/glance does not work in the UNIX system that we use.

 

Also, can you tell about the use of 'ps -e -o pcpu -o pid -o user -o args' & sar command? what do we interpret from 'ps -e -o pcpu -o pid -o user -o args'  command? For eg. if we have three different processes having the below usage:

33%   <process 1>

33%   <process 2>

33%   <process 3>

what does it indicate?

 

Thanks in advance.

Acclaimed Contributor
James R. Ferguson
Posts: 21,184
Registered: ‎07-06-2000
Message 2 of 3 (408 Views)

Re: CPU Utilization in UNIX

Hi:

 

> FYI - vmstat/top/glance does not work in the UNIX system that we use.

 

That is not descriptive at all.  I think you mean that whatever data you are examining from these tools doesn't lead you to the answer you want.

 

> what do we interpret from 'ps -e -o pcpu -o pid -o user -o args'  command?

 

This is UNIX95 (XPG4) behavior.  If you are truly running HP-UX you will need to set UNIX95.  The safe way to do this is only for the duratation of the command line needing it:

 

# UNIX95= ps -e -o pcpu -o pid -o user -o args

 

Notice the whitespace after the "=" and before the 'ps' command.

 

The manpages are your friend.  Read them.  The 'ps' command above says to look at every process ('-e') and return the 'pcpu', 'pid', 'user' and 'args' for that process as columns in the output.  THis is known as creating a custom output format.  Read the manpages!

 

Regards!

 

...JRF...

Acclaimed Contributor
Dennis Handly
Posts: 25,067
Registered: ‎03-06-2006
Message 3 of 3 (398 Views)

Re: CPU Utilization in UNIX

>if we have three different processes having the below usage, what does it indicate?

 

It could indicate you only have one CPU and the same/similar process is running and getting equal shares.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.