@natty It's not anything magic that hooks into memory management and does some compression or anything, it's really "just" a memory backed sparse block device that also compresses the data, which is then used as regular swap, so the regular swapping mechanism applies.
You could even enable it at runtime to test it.
modprobe zram
tee /sys/class/block/zram0/comp_algorithm <<<zstd
tee /sys/class/block/zram0/disksize <<<5Gi
mkswap /dev/zram0
swapon /dev/zram0
(all commands work with a regular sudo prefix too if you don't feel like opening a root shell)
@natty And if you check /proc/pressure/memory (i.e. cat the file) you'll see how much load is generated from memory pressure. The avg values tell you approximately how much CPU time the kernel is wasting by doing memory stuff (paging magic).
Edit: the total value is an absolute value in microseconds wasted, so if you have monitoring that can do diffs, it's enough to pull that one (it's what node exporter does for instance), you can then calculate the per-second value from that and if it approaches 1 million you're spending 100% of the CPU on paging, if it's at 100k you're spending 10% of the CPU on paging.