#56 Consider turning on zram
Closed: Deferred to upstream 3 years ago by chrismurphy. Opened 5 years ago by mclasen.

Supposedly, it does a great job on low-memory systems.

zram.service is enabled by default on netinstalls since at least Fedora 28. It's not enabled on lives, and I don't understand why. Depending on oom killer in a live environment is a very bad experience [1] and totally rectified with zram.service running (I've not tested systems with less than 1500M RAM).

Since it's been enabled on netinstall with no complaints so far, and zram.service is available on live media, and the single change is to make the service enabled by default, I think it's low risk to enable it as soon as Fedora 29 lives. It's also just as easy to revert.

For production use, I've been using zswap for almost a year.[3] I can vouch for it moderating the steep performance loss when swap starts being used, which is the entire point of either zram or zswap. I'd guess that zram is better suited for cases where not more than 1.5x RAM is needed, whereas zswap is only limited by the backing swap partition (or file) size. Both can be configured to use lz4, so compression ratios are the same.

[1] bugs related to lives running out of memory in low RAM VM's

anaconda invoked oom-killer

using search to launch Terminal causes uncommanded launch of multiple apps, invokes OOM, implodes the whole environment

zram.service is not enabled on LiveOS


[3] zswap is tacked onto an existing swap partition (or swapfile) with the following boot parameters
zswap.enabled=1 zswap.max_pool_percent=25 zswap.compressor=lz4

On my F28 system, I see:

$ systemctl status zram
‚óŹ zram.service - Service enabling compressing RAM with zRam
   Loaded: loaded (/usr/lib/systemd/system/zram.service; static; vendor preset: disabled)
   Active: inactive (dead)

I have no clue why it would be enabled for netinstalls. Clearly we need to change the vendor preset if we want to enable it.

Metadata Update from @catanzaro:
- Issue tagged with: meeting

4 years ago

Vendor preset is enabled on netinstall, and disabled on live, maybe to prevent it from being enabled by default post-install. I'm not really sure about the history. It seems intended by the installer team that it be enabled for up to 2G RAM systems.

Based on
it would use 16MB of memory overhead for a system with 16GB RAM, if a 16GB zram device is created, which doesn't sound bad. But I've only tested zswap in production.

decision from the Dec 17 wg meeting: lets turn zram on for live media. Turning it on for installed systems may need more research

Metadata Update from @catanzaro:
- Issue untagged with: meeting

4 years ago

I think nobody has an action item for this. Who wants to make it happen?

Metadata Update from @chrismurphy:
- Issue assigned to chrismurphy
- Issue tagged with: meeting

3 years ago

We didn't have a quorum at this week's meeting, but Chris agreed to take the action item to follow up with Anaconda developers about implementing our previously-agreed decision to enable zram on live media.

Metadata Update from @catanzaro:
- Issue untagged with: meeting

3 years ago

This PR has been approved.

Once that lands in Rawhide and sanity tests OK, I'll make a PR for the following change to fedora-live-base.ks to remove startup of legacy swap. I've given anaconda folks a heads up.

This is in Rawhide and tests out OK.

And loosely related is cleaning up the legacy swap stuff

This is sufficiently complete to close out this issue.

Metadata Update from @chrismurphy:
- Issue close_status updated to: Deferred to upstream
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.