Zramd vs swap partition

Hi guys

Does anyone have any experiences with better or worse performance using zramd over a traditional swap partition?

I am just about to reinstall as I have been running a different distro for a ‘bare-metal’ comparison on gaming and don’t know whether to use zramd or a swap partition. I am using BTRFS with timeshift-autosnap and have 32GB RAM.

Thanks in advance

It’s basically the same. zswap is enabled by default and does the same job as zram if you have a swap device.

You can possibly tweak zswap a little, https://wiki.archlinux.org/title/Zswap

For example, I increase the pool size so more is compressed, seems silly not to do that, and also increase vm.swappiness to 133 so the system is aware swap is faster than normal:

zswap.enabled=1 zswap.compressor=zstd zswap.max_pool_percent=80 zswap.zpool=z3fold

There’s no need to switch from zswap to zram unless you want to get rid of the disk-based swap device. The main benefit of a swap partition is that hibernation becomes much easier to enable.

1 Like

So if I create a swap partition on install, it will pretty much perform the same as installing zramd?

With everything at their defaults, yes. But, test to check performance with your setup and workload etc. etc. etc.

Excellent, thanks.