zram provides a compressed RAM cache. I use it to improve performance on an elderly computer with limited RAM that otherwise slows to a crawl when it needs to use swap.
First, note what your current swap setup is:
warren@puccini:~> cat /proc/swaps
Filename Type Size Used Priority
/dev/sda1 partition 4200444 0 -2
Install zram:
sudo zypper install systemd-zram-service zramcfg
Launch YaST and open System – Services Manager. Select the zramswap service and press “Start Mode: On boot”. Then press “Apply”. Check your work, then close YaST.
Reboot and check your swap setup again. It should now have at least one entry for zram and be of higher priority than the original entry. For example:
warren@puccini:~> cat /proc/swaps
Filename Type Size Used Priority
/dev/sda1 partition 4200444 0 -2
/dev/zram0 partition 2005148 0 100
/dev/zram1 partition 2005148 0 100
Done.
Thanks!
Thanks brother :)
zram an zswap are two seperate things. zram is a ram disk that you use as a swap device. zswap is a kernel subsystem that works as a compressed cache for a swap device. So you should change your title from “Enable zswap on OpenSUSE 15.2” to “Enable zram on OpenSUSE 15.2”
Ooh, thanks for catching that! I’ve fixed that.