Process-level CPU Utilization

I need to determine CPU consumption of several groups of processes (from about a thousand running on the box). Trying to use ps, have a several questions:

1) For what interval of time ps actually reports results?

2) Is there any difference in accuracy between ps, /usr/ucb/ps, prstat, etc?

3) Any options that allow us to define the monitoring interval or accuracy?

4) Any difference in overheads between ps, /usr/ucb/ps, prstat, etc?

Any other way to trace down process-level CPU consumptions?

Thanks!

Alex

[557 byte] By [apodelko] at [2007-11-26 10:50:14]
# 1

> I need to determine CPU consumption of several groups

> of processes (from about a thousand running on the

> box). Trying to use ps, have a several questions:

>

> 1) For what interval of time ps actually reports

> results?

It's not an interval. It's a single value kept by the kernel.

You could use 'prstat -m' instead. That will show values over the chosen interval (normally 5 seconds).

> 2) Is there any difference in accuracy between ps,

> /usr/ucb/ps, prstat, etc?

'prstat -m' calculates its own values with very high accuracy. 'ps' and 'prstat' with no arguments (as well as 'top' if you have it installed) are simply reading some simple performance stats kept by the kernel. The things that they calculate are different and are kept with different accuracy.Unless you are using microstate accounting, there are several ways that the accuracy could be off.

> 3) Any options that allow us to define the monitoring

> interval or accuracy?

No. Use 'prstat' and microstate accounting or write your own program to gather information directly.

> 4) Any difference in overheads between ps,

> /usr/ucb/ps, prstat, etc?

I'm not sure.

> Any other way to trace down process-level CPU

> consumptions?

Run through /proc yourself? Take a look at the proc(4) man page.

--

Darren

Darren_Dunham at 2007-7-7 3:02:47 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 2
Thank you very much! Any way to instruct prstat to show all existing processes?
apodelko at 2007-7-7 3:02:47 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 3
I'd try 'psrstat -cm -n 600 2 2'. It's not "all" processes, but it's 600. You could make that number as big as you need.-- Darren
Darren_Dunham at 2007-7-7 3:02:47 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...