use ps to determine the percentage of time a process is using a CPU

  • Follow


Using `ps-ef` I can determine that a process is using alot of CPU time given
it's start time.

For example:
oracle       571652     524289 89.9 06:08:13 ??          40:18.34 oraclepr01
(LOCAL=NO)

I can kind-of look at the other processes and pretty much say PID 571652 is
the process that is taking most of the CPU's.
This is given that other processes start at other times and given that the
TIME is 40:18:34 etc, etc, etc...

My question is assuming this is a 4 CPU box, the time of the ps -ef is 9AM
and from a given start time 06:08:13 what is the percentage of time the
process 571652 has been in execution?


Thanks

Pete






0
Reply Oxmard 9/12/2004 2:22:36 PM

Oxmard <shankeyp@no-spam.comcast.net> wrote:
> oracle       571652     524289 89.9 06:08:13 ??          40:18.34 oraclepr01
> (LOCAL=NO)
> 
> My question is assuming this is a 4 CPU box, the time of the ps -ef is 9AM
> and from a given start time 06:08:13 what is the percentage of time the
> process 571652 has been in execution?

So there's 3 hours between the start and the ps, which is 180 minutes.
You've got 4 CPUs, which gives you 180x4 = 720 CPU minutes.

oracle has used 40 CPU minutes, so it's used  40/720 = about 5%

  Scott
0
Reply Scott 9/12/2004 9:28:59 PM


1 Replies
564 Views

(page loaded in 0.046 seconds)

Similiar Articles:













7/22/2012 12:58:16 PM


Reply: