.net performance counter - Process(w3wp)\% Processor Time

我们两清 提交于 2019-12-07 03:13:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!