Best way to use zram in Fedora 21?

Reindl Harald h.reindl at
Thu Nov 27 10:24:53 UTC 2014

Am 27.11.2014 um 11:15 schrieb Vratislav Podzimek:
> On Wed, 2014-11-26 at 16:27 -0500, Corey Sheldon wrote:
>> Juan no need    inst.zram=on on install   on first boot   modprobe
>> zram ;  systemctl start zram    voila   I use the default one in f21b
>> no issues
> For now. But the anaconda's zram.service is tailored to provide zram
> swap for the installation process. Future changes in it may make it
> unusable for general purpose usage on an installed system.
> So packaging something general-purpose it definitely the right way to
> go. Reindl's scripts look good to me, I'd just suggest adding a
> configuration option for setting the maximum RAM for the zram swap being
> created. It doesn't make much sense to use it on systems with e.g. 32
> GiB of RAM. That's by the way one of the tweaks the anaconda's version
> of the scripts+service has (hardcoded, though)

"my script" supports a "percent of total RAM config" which i don't ship 
with the RPM because it's meant for internal usage (it's BTW a result of 
Google around after face the zram module with new kernels, took existing 
snippets from several sources, made them easier, fixed some bugs and 
introduced the systemd-unit)

[root at mail-gw:~]$ cat /etc/sysconfig/zram

"It doesn't make much sense to use it on systems with e.g. 32 GiB of 
RAM" depends on the context - on a host mostly used for a lot of virtual 
machines it makes sense even with 64 GB or more - depends on the total 
count of guests and how much RAM they have assigend

instead have zram on all of the guests and to prevent danger of OOM 
events they may have all 2-3 GB RAM and while overcommit the host that 
way it can swap out most unsed guest memory without fall back to slow 
disk swapping

VMware ESXi does something similar for years to overcommit hosts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the devel mailing list