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
This commit is contained in:
Tomáš Hromada 2022-04-21 14:03:13 +02:00 committed by GitHub
parent 10f9abba16
commit 1cec542e41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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",