[pve-devel] [RFC cluster 1/4] rrd: add free, buffer/cache and arc size to memory statistics

DERUMIER, Alexandre alexandre.derumier at groupe-cyllene.com
Tue Dec 12 08:49:27 CET 2023


Hi,

if we are going to bump the rrd version,

I think it could be great to add pressure stats too.

I have send patches 2 year ago, it can be really usefull to implement
vm balancing/scheduling/node eviction  or even simply to diplay graph
to have more information about load.


https://lists.proxmox.com/pipermail/pve-devel/2022-May/053068.html


This patch was with pressure stats in separate rrd, but if you are
bumping the main rrd version, it could be directly integrated.

I can rework the patch if you want.



-------- Message initial --------
De: Folke Gleumes <f.gleumes at proxmox.com>
Répondre à: Proxmox VE development discussion <pve-
devel at lists.proxmox.com>
À: pve-devel at lists.proxmox.com
Objet: [pve-devel] [RFC cluster 1/4] rrd: add free, buffer/cache and
arc size to memory statistics
Date: 11/12/2023 15:47:18

adding values to the rrd format break compatability with the old file.
Therfore the filename/path had to be changed as well.

Signed-off-by: Folke Gleumes <f.gleumes at proxmox.com>
---
 src/pmxcfs/status.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/pmxcfs/status.c b/src/pmxcfs/status.c
index dc44464..8834644 100644
--- a/src/pmxcfs/status.c
+++ b/src/pmxcfs/status.c
@@ -1130,7 +1130,10 @@ static const char *rrd_def_node[] = {
 	"DS:cpu:GAUGE:120:0:U",
 	"DS:iowait:GAUGE:120:0:U",
 	"DS:memtotal:GAUGE:120:0:U",
+	"DS:memfree:GAUGE:120:0:U",
 	"DS:memused:GAUGE:120:0:U",
+	"DS:membuffercache:GAUGE:120:0:U",
+	"DS:arcsize:GAUGE:120:0:U",
 	"DS:swaptotal:GAUGE:120:0:U",
 	"DS:swapused:GAUGE:120:0:U",
 	"DS:roottotal:GAUGE:120:0:U",
@@ -1252,7 +1255,7 @@ update_rrd_data(
 
 	int skip = 0;
 
-	if (strncmp(key, "pve2-node/", 10) == 0) {
+	if (strncmp(key, "pve8-node/", 10) == 0) {
 		const char *node = key + 10;
 
 		skip = 2;
@@ -1267,12 +1270,12 @@ update_rrd_data(
 
 		if (!g_file_test(filename, G_FILE_TEST_EXISTS)) {
 
-			mkdir(RRDDIR "/pve2-node", 0755);
+			mkdir(RRDDIR "/pve8-node", 0755);
 			int argcount =
sizeof(rrd_def_node)/sizeof(void*) - 1;
 			create_rrd_file(filename, argcount,
rrd_def_node);
 		}
 
-	} else if ((strncmp(key, "pve2-vm/", 8) == 0) ||
+	} else if ((strncmp(key, "pve8-vm/", 8) == 0) ||
 		   (strncmp(key, "pve2.3-vm/", 10) == 0)) {
 		const char *vmid;
 



More information about the pve-devel mailing list