#177 enable transparent compression by default
Closed: Fixed 3 years ago by ngompa. Opened 3 years ago by chrismurphy.

An optional feature for Fedora 33 Btrfs by default proposal is transparent compression.

Summary of benefits:
- saves space
- reduces write amplification -> increases flash lifespan
- can increase read and write performance

Summary of ways to enable compression:
- mount option -o compress=zstd:1 enables it on the entire file system
- per directory (xattr to enable, nocompress flag to disable)
- can be used separately or in combination

Example 1:
- Facebook is using mount option -o compress=zstd:1across the board wherever they use Btrfs, no exceptions.

Example 2:
- Installer sets mount option -o compress=zstd:1
- Installer sets NOCOMPRESS on /home
- user enables it per directory or file using an xattr, via btrfs property set or exposed by desktop integration in the GUI

A call for testing could be useful in helping to make decisions, and provide some "how to" documentation to encourage it.

The generic issue and technical concerns of actually implementing this across Fedora, are in fedora-btrfs / project: enable compression on btrfs installs

This issue for Workstation Edition, to discuss UI/UX and integration related issues.

Proposal: default to compress=zstd:1 for F34

Metadata Update from @chrismurphy:
- Issue assigned to chrismurphy

3 years ago

Metadata Update from @chrismurphy:
- Issue tagged with: meeting-request

3 years ago

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

3 years ago

WG is happy with this proposal. It is pending FESCo approval in https://pagure.io/fesco/issue/2538.

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

3 years ago

This change is approved by FESCo. Was it successfully implemented yet?

Working on it this week, sorry for the late update!

I guess the easy part is adding this option to the autopart line in every desktop kickstart file? From my reading of the doc and prior conversation with Anaconda folks, is that this will use the specified mount option for the installation as well as adding it to /etc/fstab.

--fsoptions compress=zstd:1

Harder is figuring out which kickstart files to modify. I think the following three?

$ grep autopart *.ks
fedora-cloud-base.ks:autopart --noboot --nohome --noswap --nolvm
fedora-container-common.ks:autopart --noboot --nohome --noswap --nolvm
fedora-disk-minimal.ks:autopart --type=plain --noswap
fedora-disk-server.ks:autopart --noswap
fedora-disk-workstation.ks:autopart --type=plain --noswap
fedora-disk-xfce.ks:autopart --type=plain --noswap
fedora-iot.ks:autopart --nohome --noswap --type=plain
fedora-modular-disk-minimal.ks:autopart --type=plain

(It's a bit off topic but I'm confused about --type=plain)

And hardest is how to change it with the two ARM desktop images.

  • compress=zstd:1 at image creation time and fstab; prevents the subsequent xz operation from doing much of anything, resulting in a much larger image size.
  • compress=zstd:15 at image creation time but zstd:1 in fstab; it'll still be a bit bigger than the xz image we have now but then the xz step (and also the user unxz step) can be skipped. Possibly zstd:11 is the best bang for the buck, small detail.
  • compress=zstd:1 only to the /etc/fstab; the resulting installation starts with uncompressed Btrfs, but all subsequent writes will be compressed, and over time most everything will become compressed.

No matter which of the three, if it's possible to add an fstrim before the final umount, there will be a net reduction in the image. Right now, there's no fstrim for either ARM image, and there's a bunch of stale deleted packages left in the image. It's really suboptimal.

This is done now, so I'm closing this.

Metadata Update from @ngompa:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

3 years ago

Log in to comment on this ticket.

Boards 1
Btrfs Status: Done