Monday, April 1, 2013

ZRAM: Make Ubuntu ultra-fast

There is now a package available in the official Ubuntu 12.04 and newer repositories. Install it using:
sudo apt-get install zram-config




The service daemon will activate instantly upon install. You can verify this by typing in a terminal:
cat /proc/swaps
There should be some /dev/XXX entry (given you have a swap partition/file active) and two entries with "swap" in their name. If not, try rebooting and type in the command again.
There are no further actions neccessary.



Like Sergey "Shnatsel" Davidoff was quoted in that blog post, this package installs a script to run it as a service. The script automatically configures itself and the service starts up automatically. There is no further configuration needed. The service can be manually controlled via:
sudo service zramswap start|stop|status|restart|reload|force-reload

If you open the deb package with file roller you can see that only two files are installed:
/etc/init/zramswap.conf
/etc/init.d/zramswap
Along with some documentation files. The DEBIAN directory contains package meta data and commands to initialize the service. Thats all there is in the package. The corresponding devices are named after this scheme: /dev/zram[0-9]

Make sure to reboot Ubuntu and check if Zram started during boot. Follow the instructions as noted earlier to check by cat /proc/swaps

If you don't see your zram swap devices listed, (in my case too) then do this :

sudo su
update-rc.d zramswap defaults
This will list zram as a startup service...
To remove [type the following]:
sudo dpkg --purge zramswap-enabler
sudo dpkg --purge zram-config
http://askubuntu.com/questions/174579/how-do-i-use-zram

No comments:

Post a Comment