Date: Wed, 24 Apr 2013 12:55:27 +1000 From luv-main-bounces@luv.asn.au Tue Apr 23 19: 5:53 2013 From: Russell Coker To: luv-main@luv.asn.au Subject: zram Reply-To: russell@coker.com.au There has been some discussion on luv-talk (which should have been on luv- main) about zram, a system that uses a compressed RAM disk for swap on Linux. I've enabled zram on one of my systems. I ran "free" on all the systems I run and found that only one had any significant swap use, that's a workstation with 8G of RAM and 512M of swap in use. I didn't bother enabling it on any other systems. I added "zram" to /etc/modules (modules that are loaded on boot on Debian). I created /etc/modprobe.d/zram.conf with the following contents: options zram num_devices=2 This gives two devices and it seems that you are expected to have one zram device for each CPU core. I'm not sure if this is really required but it doesn't seem to do any harm. To enable zram on boot I added the following to /etc/rc.local: echo 1073741824 > /sys/block/zram0/disksize echo 1073741824 > /sys/block/zram1/disksize mkswap /dev/zram0 mkswap /dev/zram1 swapon -p 100 /dev/zram0 swapon -p 100 /dev/zram1 The above sets each of the two devices to 1G of storage and enables them as swap space. I haven't yet rebooted the system to make sure that there are no errors in the above, but as it's what I types on the command-line it should work. Also I haven't tested zram extensively. Finally I'm running the Debian/Experimental 3.8 kernel. I don't know how it would work on other kernels. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/ _______________________________________________ luv-main mailing list luv-main@luv.asn.au http://lists.luv.asn.au/listinfo/luv-main :