Enable zram on OpenSUSE 15.2

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.

About Warren Post

So far: Quality Assurance crash test dummy, jungle guide, tech support monkey, entrepreneur, IT consultant, teacher, beach bum, diplomat, over-enthusiastic cyclist.
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

4 Responses to Enable zram on OpenSUSE 15.2

  1. Dániel Kovács says:

    Thanks!

  2. Ironlenny says:

    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”

Leave a comment