rfmoz / grafana-dashboards

Grafana dashboards
Apache License 2.0
1.17k stars 445 forks source link

RAM used Gauge misleading formula in node-exporter-full #60

Closed alecrux closed 4 years ago

alecrux commented 4 years ago

"RAM used" gauge improperly reports RAM allocation. It can make you think applications could run out of memory, which is not the case.

My proposal for the formula is the following, which aligns with the way RAM used is calculated in the "Memory basic" Panel.

(node_memory_MemTotal_bytes{instance=~"$node:$port",job=~"$job"} - node_memory_MemFree_bytes{instance=~"$node:$port",job=~"$job"} - (node_memory_Cached_bytes{instance=~"$node:$port",job=~"$job"} + node_memory_Buffers_bytes{instance=~"$node:$port",job=~"$job"})) / (node_memory_MemTotal_bytes{instance=~"$node:$port",job=~"$job"}) * 100
rfrail3 commented 4 years ago

Well... RAM used on linux tricky subject, it depends of what you want to consider free in your particular enviroment. I think that the current one covers a broader audience.

Note that the panel "RAM used" have one formula hidden, this is the one that I was using on the first releases, it's similar to the proposed, but without Cached+Buffers. Feel free to adjust it.

alecrux commented 4 years ago

@rfrail3 thanks for the feedback. I think my formula would be beneficial for other people as it excludes cached+buffer. And I've be using it against thousands of servers running in production. Would you mind adding it as a third (hidden) formula? Thanks!