How to interpret CPU time vs CPU percentage

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 01:57:29

问题


When I check azure monitoring tool, CPU usages are shown in CPU time

min: 4.69s  
max: 2008.08 s  
avg : 207.63 s

I am familiar with CPU% which makes sense as in application requiring cpu cycles.

how does the above time correspond to percentage? What would be the max in seconds which corresponds to 70 or 100% cpu usage?

note : cpu is 4 cores

On a different instance, I noticed in a 60 second window

min: 0
max : 133.83
avg : 19.61

Based on below answers (see Nachiket's explanation in comments as well) 133.83 is a product of cpu time multiplied by cores ( in my case 4 cores)

Cpu utilization in this case is 133.83/(60*4) = 54.1%


回答1:


Some cloud monitoring tools give resource usage in standard time measures. (seconds, hours, days etc.)

If you have usage in seconds like,

min: 4.69s  
max: 2008.08 s  
avg : 207.63 s

Then you can find out usage in % from above using definition of %.

% utilization = (resource used time / total resource availability time)

ex: if cpu was available for 100 seconds and out of that 80 seconds it was used then

% utilization = 80/100 = 80% CPU utilization

From your given time, total available time is missing. Find that out and use above formula.

% utilization = avg. usage/total availability

no. of cores shouldn't matter as that is present in both cases.

% utilization = ( (no. of cores * avg util)/(no. of core * total availability))  

I am not sure about azure cloud monitoring but if it is providing same then you can use it.



来源:https://stackoverflow.com/questions/28240978/how-to-interpret-cpu-time-vs-cpu-percentage

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