Operating System - HP-UX
1832994 Members
2150 Online
110048 Solutions
New Discussion

Re: How to know which are the server processes taking lot of CPU usage?

 
Deepu Chakravarty
Regular Advisor

How to know which are the server processes taking lot of CPU usage?

I am running rp7420 with HPUX 11.11.
I want to know which are the processes taking lot of CPU usage. Through 'top' command I can know this fact. But I want to know only CPU% for all top 10 processes which are taking lot of CPU usage. How 'ps' command can be constructed so that I can know this fact?

Thanks in advance.
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: How to know which are the server processes taking lot of CPU usage?

Shalom,

http://www.hpux.ws/?p=8

This memory leak detector uses some ps commands you can use. This and the man page can help you identify what you seem to seek.

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
James R. Ferguson
Acclaimed Contributor

Re: How to know which are the server processes taking lot of CPU usage?

Hi:

Define "...a lot of CPU usage". Does this mean as a cumulative amount since the process instantiation? Does this mean over n-interval?

How about this:

# UNIX95= ps -e -o pid= -o time= -o pcpu= -o comm=|sort -rk2,2|head -10

Note the whitespace after the equal sign in 'UNIX95'. This keeps this option set only for the duration of the command line.

The headings are suppressed for the output and only the top ten largest CPU processes are listed.

See the 'ps' manpages for more information.

Regards!

...JRF...
Deepu Chakravarty
Regular Advisor

Re: How to know which are the server processes taking lot of CPU usage?

I need the CPU% of the following like the process which is taking 99.98% of the CPU usage. The process name is f60webmx

For your reference: I am attaching following some top processes list.
---------------------------------------------
4 ? 21634 applprod 241 20 261M 209M run 8:28 100.15 99.98 f60webmx
1 ? 26737 applprod 154 20 79988K 28044K sleep 0:14 8.49 8.48 f60webmx
4 ? 26412 applprod 154 20 74344K 21460K sleep 0:14 2.36 2.35 f60webmx
4 ? 4592 applprod 152 20 515M 182M run 2:32 2.29 2.29 java
2 ? 9479 applprod 154 20 90988K 38476K sleep 1:30 2.21 2.21 f60web
Dennis Handly
Acclaimed Contributor

Re: How to know which are the server processes taking lot of CPU usage?

>I am attaching following some top processes list.

Why not use top(1) to get this info?
top -f top.out -n 10
sed -n -e '/^CPU TTY/,$ p' top.out