1

You can enable zram on Ubuntu systems using:
sudo apt-get install zram-config

This is nothing but a simple service script, that makes a new compressed swap partition 50% of the size of your memory.
Example: 32GB system memory results in a 16GB ZRAM partition.

Of course, you can modify this script to your liking.
The question is:
The ZRAM patchset and support is known to be "in-and-out" of the kernel. Some versions of the kernel has it enabled - in Ubuntu, some had it disabled. This was due to various bugs and issues. But time passed.

How safe, stable is zram on recent kernels?
Is it suitable for production use?
How does it handle with 32GB/48GB RAM?

Apache
  • 274
  • 6
  • 18

1 Answers1

3

I don't know about out, zram was promoted from staging in Linux 3.14. It spent quite a bit of time being proven in small memory devices including Android.

And that's the thing, many of its use cases are swapping to very slow, limited writes storage. That's not really a thing on servers. Where it is relatively cheap to add more RAM, people are rarely going to bother writing and tuning scripts to set up a zram paging space and add some CPU overhead. Up to you to evaluate whether it has enough attention to have good quality.

As always, performance depends on many variables. Kernel version, compression algorithm in use, CPU. In this case, the compression ratio you get on pages. You want to set up your own testing with something resembling your workload.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32
  • Right. This is something you use on tiny embedded devices that you simply cannot physically add more RAM to. On a normal server, you budget properly and put the right amount of RAM in it to begin with, or buy more when needed. – Michael Hampton Feb 05 '17 at 20:11