问题
During performance testing, I found that the values of Process(w3wp)\% Processor Time
are greater than 100. Some values are
237.1436486
312.5338052
341.2373994
264.4097661
191.6237736
I thought this value represents the CPU usage by w3wp process. I don't understand why the value is greater than 100%.
回答1:
If you have multiple cores it can go over 100, it's the sum of the processor usage for each processor (core, or virtual core) so over 100 is normal (100*numberOfCores
is the nax).
Use the Process(w3wp_Total)
version of the counter if you want the overall CPU %, this caps out at 100.
回答2:
As Nick Craver already said, it is the combined value of all processors (logical or physical). To get a value between 0% and 100% simply divide it by the numbers of processors (e.g. Environment.ProcessorCount
, assuming that you want to do it in .NET code).
来源:https://stackoverflow.com/questions/3712782/net-performance-counter-processw3wp-processor-time