I have seen this being done on Android devices and wondered why it is being used so rarely in other areas (Desktops/Servers).
I have seen this being done on Android devices and wondered why it is being used so rarely in other areas (Desktops/Servers).
There's a lot of institutional knowledge, and mythology, around swap. Less so around zram/zswap, and that is going to compete with other competing capabilities and lore.
I've been wranging boxen since the late 1990s, and using Unix since at least the late 1980s. I'd only run across references to zswap / zram a few weeks ago when attempting to compile OpenWRT, and didn't look into it until seeing your comment (one reason for writing copiously footnoted HN comments -- I might accidentally learn something).
zswap might very well be The Answer We've All Been Looking for, but, well, All Of Us Realising that is another stage in the Hierarchy of Failures in Problem Resolution.[3]
________________________________
Notes:
1. https://en.m.wikipedia.org/wiki/Zram
2. https://en.m.wikipedia.org/wiki/Zswap
3. https://old.reddit.com/r/dredmorbius/comments/2fsr0g/hierarc...
Institutional knowledge, mindshare, and documentation are all Things.
Debian's documentation (Debian Administrator's Handbook, Debian Installation Guide, Debian FAQ) do not appear to mention either zram or zswap at all. DAH/DIG do mention swap configuration, but only in terms of traditional swap patterns.
There is mention on the Debian Wiki: https://wiki.debian.org/ZRam But not under the Swap topic: https://wiki.debian.org/Swap
"As easy as" really doesn't mean much if the information isn't accessible. It's also harder to to advocate if it's not at least mentioned in standard documentation.
If you're aware of any standard Linux documentation mentioning zram/zswap as options, please let me know.
Again: this is not an argument against the technical merits or advisibility of zram or zswap. It's an argument that knowledge of these options is not widely disseminated or assimilated. I'd commented recently on the matter of intergenerational knowledge transfer, both general and specific (https://news.ycombinator.com/item?id=20617656). This would be a case of that.
https://wiki.archlinux.org/index.php/Improving_performance#Z...
If you want to use the systemd solution you can do it like:
pacman -S systemd-swap
vim /etc/systemd/swap.conf # disable zswap, enable zram
systemctl start systemd-swap.service
systemctl enable systemd-swap.servicezram and zswap are also a lifesaver on low memory devices like chromebooks, especially if they have anything slower than nvme storage.