Search code examples
prometheusgrafanaprometheus-node-exporter

Wrong value on cpu usage from Node Exporter


I would like to setup monitoring with prometheus, node exporter and grafana. I'm using Node Exporter to monitor cpu/memory on server. I used the expression as below on Grafana.

100 - (avg by (instance) (rate(node_cpu_seconds_total{job="node",mode="idle"}[1m])) * 100)

However, this cpu value always has low value than expectation. Even cpu have been reached 95-98% by measure from "top" command in linux. The value show only 40-50%. Could you please give me any suggestions? How to fix this wrong value? or wrong expresstion?

enter image description here


Solution

  • The "%CPU" shown by the "top" command is the percentage of your CPU that is being used by the process. By default, top displays this as a percentage of a single CPU. On multi-core systems, you can have percentages that are greater than 100%. For example, if 3 cores are at 60% use, "top" will show a CPU use of 180%. See here for more information. You can toggle this behavior by hitting Shift+i while "top" is running to show the overall percentage of available CPUs in use.

    See more information here.