Hacker News new | ask | show | jobs
by oxplot 1694 days ago
As for the RAM limitation, zswap is a great way to get some more RAM at cost of some CPU cycles which on the new Pi won't be an issue.
2 comments

I've been running some tests on my regular server, where it seems that zstd offers better compression ratios than the default lzo-rle. Ratios are currently at 3.7 vs 2.6 according to netdata; I've seen them as far apart as 4 vs 2. Mostly a matrix server with a big database.

zstd could be slightly slower, although according to some benchmarks, it decompresses faster.

zram*

zram is the compress-in-memory like you have in Windows and ChromeOS and zswap is the compress-on-disk in case you want to replace SD cards.

zswap does not compress-on-disk either (I wish it did). The difference is just an implementation detail into how both plug into the kernel but the goal is the same on both.
zram is a compressed ram-disk that acts like any other block device, so you can point `mkswap` and `swapon` at it.

zswap is a compressed (memory) cache that uses the frontswap API to evict least recently used pages to a swap device. Evicted pages are not compressed.

zram is more of a general purpose component; whereas zswap is a more specialized component.

https://www.kernel.org/doc/Documentation/blockdev/zram.txt https://www.kernel.org/doc/html/latest/vm/zswap.html