Operating System - HP-UX
1753726 Members
4315 Online
108799 Solutions
New Discussion юеВ

Re: the CPU time of each process

 
SOLVED
Go to solution
lucashuang
New Member

the CPU time of each process

How to get the CPU time of each process.
7 REPLIES 7
Bill Hassell
Honored Contributor
Solution

Re: the CPU time of each process

Type this command line as shown:

UNIX95=1 ps -eo pcpu,pid,args | sort -rn

The processes consuming the most CPU percentage are shown at the top of the list. The top command will show you a similar metric.


Bill Hassell, sysadmin
lucashuang
New Member

Re: the CPU time of each process

Dear Bill,
Appreciate your reply.
I had tried your suggestion.

UNIX95=1 ps -eo pcpu,pid,args | sort -rn

you say pcpu is the same with "top" command.
What does this colume mapping ? "%WCPU" or "%CPU" ?

May I do some explain for these cases?

Case A
UNIX95=1 ps -eo pcpu,pid,args | sort -rn |grep 10957
4.82 10957 fglrun /u/tiptop/csf/4gi41/csfra01

Explain A: pid:10957 use 4.82% of last cpu time interval.
If cpu time interval is 60 sec then this pid use 60*4.82% secs.


Case B
ps -ef|head -n 1 ;ps -ef | grep 10957
UID PID PPID C STIME TTY TIME COMMAND
s0486 10957 10956 30 14:41:28 pts/tKb 0:53 fglrun /u/tiptop/csf/4gi41/csfra01

Explain B:the pid:10957 use total CPU time is 53 min.


Lucas
Sajjad Sahir
Honored Contributor

Re: the CPU time of each process

u can use top command
Aashique
Honored Contributor

Re: the CPU time of each process

HI lucashuang,

Ya from TOP command you can see.
Also you can use the "kmeminfo" script which will tell you the details of each process of cpu usage and memory usage.

Thanks & Regards

Aashique
Bill Hassell
Honored Contributor

Re: the CPU time of each process

Take a look at this link:

http://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=57634&admit=109447627+1207582693776+28353475

However, top is a crude measure of system performance and becomes quite difficult to interpret with multiple processors. Also, CPU time is misleading except for processes that use almost 100% CPU time. You can have 4 processes running at the same time, each consuming 100% CPU while it is running. But like most multiprocessing systems, these CPU-cbound processes will be interrupted and timeshared with other processes. Thus, logins and vi editing, etc, seems to run at full speed even though more than 100% of CPU time is required.

If you want accurate measurements, get a copy of Glance from HP.


Bill Hassell, sysadmin
Lethuillier
Frequent Advisor

Re: the CPU time of each process

Hi,

An interresting alternative to the use of top :

http://i1.dk/download/isjtop

regards,
Il faut avoir la foi et non les foies - Il faut avoir la forme et non les formes - Il faut faire la paix et non des pets
YAQUB_1
Respected Contributor

Re: the CPU time of each process

Hi Lucashuang,

U can also check the below URL link:-

http://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=1220246

Thanks--Yaqub
HP Support!!!