Menu

zswap metrics with Telegraf

A couple of weeks ago I discover zswap. zswap is a Linux kernel a compressed write-back cache for swapped pages. I activated this on my VPS.

Active zswap runtime

echo 1 > /sys/module/zswap/parameters/enabled

or reboot persistent, add the following line to /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="zswap.enabled=1"

With a system that is running pretty normal you won't notice this effect right away. So we need some stats about zswap to see what it is doing. These stats about zswap are available in the kernel. You can find them in /sys/kernel/debug/zswap

As I love stats, I want to add these to Grafana. Normaly I use telegraf to collect statistics and insert them to influxDB. So I created a small plugin to collect these stats. All that is needed is on my GitHub page.