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

CPU Utilization in UNIX

sathis kumar
Frequent Advisor

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.

2 REPLIES
Highlighted
James R. Ferguson
Acclaimed Contributor

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...

Dennis Handly
Acclaimed Contributor

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.