ZRAM setup (a little non standard situation)

So… I got good advice to run ZRAM:

But before I try to go through setup, I wanna make sure I understand little details.

So. For now I have Ubuntu with vm.swappinnes set to 0 and swapfile removed (with entry from fstab). I needed this because of two reasons: SSD life prolonging (this PC is 24/6 turned on, so…) and privacy concern (do not allow forensic tools to recover swapped data)

So, to install ZRAM do I need to change something in this non-standard setup to make ZRAM work?

My hardware has Ryzen 7, 16 GB RAM

1 Like

You don’t need a disk/file swap in order to use ZRAM.

Zram is often already installed on many of the recent distro, so check first if it is. If so, just enabled it.

3 Likes

Do I need to change vm.swappinnes=0 that present now?

Also, how much RAM do you recommend to give for ZRAM?

And won’t it break mounted in RAM folders? (I have /tmp, /var/log, /var/cache/apt/archives mounted in RAM)

1 Like

Please see the article. 0 is counterproductive when swap space such as ZRAM is enabled.

Also see article.

It won’t break any of your tmpfs mounts. ZRAM is separate and only provides compressed swap. Your /tmp, /var/log, and /var/cache/apt/archives mounts will continue working exactly the same because they’re tmpfs filesystems, not swap devices. The only change is that the system will have compressed swap available instead of hitting disk swap (or in your case, no swap, which means less overall useful space in RAM in conditions where system memory runs low).

ZRAM is useful when you have low amounts of “available” system memory.

1 Like