# How to calc average Cpu utilization by process's "%processor time" counter with CPU affinity

### Frage

• Hi All,

Now i'm working on a windows project and encountered below problem.

Details

System are with 32 Cpus. And for my process "aaa",  i made Cpu affinty on it with CPU0,1.

Then running some script stress on process "aaa".

I record the counter data for process "aaa"'s "%processor time" for about 1 min by every 30/sec

%processor time

190

199

Then i calculate the average Cpu utilization for process "aaa" as (190+199)/2 /2 = 97.25

So i thought the average Cpu utilization for Cpu0 and Cpu1 is about 97.25% (For process "aaa" there was only 2 Cpu System)

But some person in my team said my calculation is wrong and should be (190+199)/2 / 32 = 6.0

6.0 is the total Cpu utilization of process "aaa"

So here is the problem which one is correct?

Thanks for helping on this!

Best Regards

Martin Liao

• Bearbeitet Montag, 27. Februar 2012 04:05
Montag, 27. Februar 2012 04:04

### Alle Antworten

• This is not an easy value to get out of perfmon.  This is the way it has been explained to me.

Assume 1 CPU here.

First you need to know Processor\% User Time\_total value.

The amount of CPU you are using is (Processor\% User Time\_total)*(Process\% Processor time\(your application))

For example Processor\% User Time\_total averaged 25%

Process\% Processor time\(your application) = 50%

The max value for (Process\% Processor time\(your application)  is 400% (100% * number of processor)

So this would be the equation for multi processor box.

(Processor\% User Time\_total)*((Process\% Processor time\(your application)/Number of CPU))

Dienstag, 28. Februar 2012 19:32
• Hello Bruce,

I had an little problem with "Process -- "% Processor Time" Its like hitting the value of 799" and the device is having 8 CPU's which are showing as normal in graphs and CPU utilization in the device is normal as well.

I did not get any information in the  resource monitor as well and they too event values are normal. I event installed  process explorer tool to analyse which process is causing the "%processor Time" high.

Give me a possible solution for this i was remote NOC support guy to one of the  client and this issue is related to client server.

Hoping from you a good reply

Freitag, 12. Mai 2017 23:55