Zramswap on L5?

It turned out that my /sys/block/zram0/comp_algorithm was corrupt. I purged and reinstalled zram-tools and then edited /etc/default/zramswap like this:

# Compression algorithm selection
# speed: lz4 > zstd > lzo
# compression: zstd > lzo > lz4
# This is not inclusive of all that is available in latest kernels
# See /sys/block/zram0/comp_algorithm (when zram module is loaded) to see
# what is currently set and available for your kernel[1]
# [1]  https://github.com/torvalds/linux/blob/master/Documentation/blockdev/zram.txt#L86
#ALGO=lz4
ALGO=lzo

# Specifies the amount of RAM that should be used for zram
# based on a percentage the total amount of available memory
# This takes precedence and overrides SIZE below
PERCENT=50

# Specifies a static amount of RAM that should be used for
# the ZRAM devices, this is in MiB
#SIZE=256

# Specifies the priority for the swap devices, see swapon(2)
# for more details. Higher number = higher priority
# This should probably be higher than hdd/ssd swaps.

PRIORITY=100
which gives me this:

purism@pureos:~$ swapon -status
Filename				        Type		Size	Used	Priority
/dev/zram0                      partition	1531668	0	    100

I will evaluate these settings and see if I get any performance improvements.

4 Likes