A customer wants to know how the cpu util averages (avg1/5/15) are calculated when specified in the template.
Note that I'm asking about cpu util (cpu idle vs cpu busy) and NOT cpu load (number of cpu processes in queue).
So like for avg1, which is suppose to be the average from the last 1 minute, they want to know how many samples are taken to calculate the average, but I'm not sure if the averages are calculated that way.
I know that for cpu load, which is very different from cpu util, the linux os actually provides the cpu load average for avg1/avg5/avg15 based on some complicate form of weighted average using exponential math.
But for cpu util, whch is probably calculated from /proc/stat, I don't think the os provides those avg1/5/15 averages. I'm guessing zabbix collects the /proc/stat data and calculates the average internally. But again, how are those cpu util averages calculated?
Does cpu util averages use the same exponential math like cpu load averages?
Does zabbix calculate cpu util at fixed intervals and the averages are calculated from that data? If yes, then how many samples? I almost convinced myself that the sampling is based on the linux quantum time, which is about 10 ms.
I've seen articles that say only two samples are needed calculate cpu util between two time periods:
Is this it? Then that means:
avg1: two samples from /proc/stat 1 minute apart
avg5: two samples from /proc/stat 5 minutes apart
avg15: two samples from /proc/stat 15 minutes apart
This all started when the customer saw that azure graphs are able to provide max, average, and min values and we're trying to figure out if zabbix can show similar values.
Thanks!
Note that I'm asking about cpu util (cpu idle vs cpu busy) and NOT cpu load (number of cpu processes in queue).
So like for avg1, which is suppose to be the average from the last 1 minute, they want to know how many samples are taken to calculate the average, but I'm not sure if the averages are calculated that way.
I know that for cpu load, which is very different from cpu util, the linux os actually provides the cpu load average for avg1/avg5/avg15 based on some complicate form of weighted average using exponential math.
But for cpu util, whch is probably calculated from /proc/stat, I don't think the os provides those avg1/5/15 averages. I'm guessing zabbix collects the /proc/stat data and calculates the average internally. But again, how are those cpu util averages calculated?
Does cpu util averages use the same exponential math like cpu load averages?
Does zabbix calculate cpu util at fixed intervals and the averages are calculated from that data? If yes, then how many samples? I almost convinced myself that the sampling is based on the linux quantum time, which is about 10 ms.
I've seen articles that say only two samples are needed calculate cpu util between two time periods:
Code:
(total_cputime_now - total_cputime_prev) - (idletime_now - idletime_prev)
------------------------------------------------------------------------- x 100
(total_cputime_now - total_cputime_prev)
avg1: two samples from /proc/stat 1 minute apart
avg5: two samples from /proc/stat 5 minutes apart
avg15: two samples from /proc/stat 15 minutes apart
This all started when the customer saw that azure graphs are able to provide max, average, and min values and we're trying to figure out if zabbix can show similar values.
Thanks!
Comment