Why does RAM usage differ between /api/monitor/metrics (Prometheus) and Zabbix?
I built a monitoring system in Grafana using the IRIS API /api/monitor/metrics (reading with Prometheus) but I noticed that the RAM usage shown was below that shown by the operating system.
I installed the Zabbix agent and the usage values were higher, but with a line with the same highs and lows but shifted.
The metric in the API is iris_phys_mem_percent_used, described as "Percent of physical memory (RAM) currently in use", in Zabbix it is the Item tag: "component: memory" item: "Memory utilization".
Image below of the graphs in Grafana:
.png)
Using the command "free -h" the server returns:
total used free shared buff/cache available
Mem: 15Gi 8.1Gi 6.8Gi 3.2Gi 3.7Gi 7.0Gi
What exactly does the iris_phys_mem_percent_used metric return?
Would it be the use of physical memory exclusively by IRIS? If so, is there any other metric in the IRIS API that returns the total RAM usage of the server?
Comments
iris_phys_mem_percent_used in IRIS is (total - free - buff/cache) * 100 / total
Zabbix provides different memory metrics [0]. If it's "Used" then it's just (total - free) without accounting for buff/cache.
That' why you might see the difference
https://www.zabbix.com/documentation/current/en/manual/appendix/items/vm.memory.size_params
Oh, I had even done some simple calculations but the values were not 100% matching, now it makes sense.
Thank you very much!