I’ve been thinking that zram could be useful on a VPS (or especially dedicated), in order to avoid swapping to the SSD. I’ve actually used it with success on a 1GB VPS and the basic installation is trivial on Ubuntu:
sudo apt-get install zram-config
The zram-config however always allocates 50% of RAM to a number of virtual swap volumes, based on the number of CPU cores. So on a 1GB single-core box it utilizes 1x512MB virtual swap partition for zram. But on a 4GB dual-core configuration the result is 2x1024MB - not ideal.
What I would like to try is to allocate 512mb (2x256) to zram. The compression ratio is typically around 1:3, so this would give about +1GB headroom, thus reducing the need for SSD swapping. This would also be beneficial on laptops or workstations to reduce SSD/HD wear and tear.
But the problem is that sane zram settings documentation is nowhere to be found! I’ve Googled a lot. Anyone familiar with it?