Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to interpret CPU time vs CPU percentage

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%

like image 869
Faiz Mohamed Haneef Avatar asked Jan 30 '15 17:01

Faiz Mohamed Haneef


1 Answers

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.

like image 176
Nachiket Kate Avatar answered Sep 22 '22 15:09

Nachiket Kate