[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#648249: RFP: zramswap-enabler -- Start/Stop swapping to zram



Hi,

I also like using zram with a script to enable it and some configuration files to fine
tune it. I have even been using it since several years in different distributions, when it
was available only as a compcache package provided with rzscontrol and ramzswap.

Zram provides an additional amount of RAM by compressing a part of it. It can avoid
somehow, swapping to disk, if it is setup to have a higher priority on swapping than the
swap to disk. This is the website of the original project, to understand better what it
does:
http://code.google.com/p/compcache/

«This project creates RAM based block device (named zram) which acts as swap disk. Pages
swapped to this disk are compressed and stored in memory itself.

Compressing pages and keeping them in RAM virtually increases its capacity. This allows
more applications to fit in given amount of memory. »

Since a few months Debian has been delivering kernels with zram enabled as module, which
is nice because until recently it was not default compiled in the kernels provided in the
current repositories. 

The zram module is very good to use in machines with low ram specs, embedded systems, or
even in modern machines having from 1 GB to much more, when we need to use several
resource hungry programs at same time. 

The script I am using for Debian is this one:
http://meets.free.fr/Downloads/Debian/zramconfig/zram/etc/init.d/zram

«Adapted from systemd scripts at https://github.com/mystilleef/FedoraZram(...)», along
with a default configuration file:
http://meets.free.fr/Downloads/Debian/zramconfig/zram/etc/default/zram

and a post-install start script:
http://meets.free.fr/Downloads/Debian/zramconfig/zram/post-install

It has an additional setup which allows using it with either "zram_num_devices" or
"num_devices" option (some kernels came with one, some other kernels came with the other,
anyhow the start-up script contains comments about it to explain).

I have used it some time in Wheezy where it worked fine. I have not tried it in Jessie
yet but will soon.

It's all in a tarball:
http://meets.free.fr/Downloads/Debian/zramconfig/zram.tar.gz

and is waiting for some people to test further and package it. 

Of course, when Debian Jessie will have switched completely to systemd it might need to
be modified, as it has been for Archlinux some time ago when the init system changed
(zramswap at Archlinux can be visited here: https://aur.archlinux.org/packages/zramswap/
and the script created for the Fedora systemd can be found here:
https://github.com/mystilleef/FedoraZram).

Thanks for considering this request.
Regards,
Mélodie


Reply to: