From 1cec542e41999ee07d9c5236978bc4fb7cd5b030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hromada?= Date: Thu, 21 Apr 2022 14:03:13 +0200 Subject: [PATCH] Include SReclaimable memory in Cache+Buffer memory By default the `SReclaimable` memory is counted into the `Used` memory, which is not correct (and is a reason why the default output differs from `free`). Some references / sources: https://stackoverflow.com/a/66644946 https://www.logicmonitor.com/blog/right-way-to-monitor-linux-memory-again --- prometheus/node-exporter-full.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prometheus/node-exporter-full.json b/prometheus/node-exporter-full.json index 9ed9d46..be4130e 100644 --- a/prometheus/node-exporter-full.json +++ b/prometheus/node-exporter-full.json @@ -1311,7 +1311,7 @@ "step": 240 }, { - "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"} - (node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"} + node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"})", + "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"} - (node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"} + node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"} + node_memory_SReclaimable_bytes{instance=\"$node\",job=\"$job\"})", "format": "time_series", "hide": false, "intervalFactor": 1, @@ -1320,7 +1320,7 @@ "step": 240 }, { - "expr": "node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"} + node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"}", + "expr": "node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"} + node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"} + node_memory_SReclaimable_bytes{instance=\"$node\",job=\"$job\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "RAM Cache + Buffer",