Use improved compression algorithms when building DEB packages. by Ferroin · Pull Request #21310 · netdata/netdata

added 2 commits

November 17, 2025 10:35
XZ compression is the de-facto standard compression used for DEB
packages on Ubuntu prior to Ubuntu 21.10 and Debian prior to Debian 12.

Using XZ for DEB package compression incurs a nontrivial performance
hit for the installation of the packages (specifically, the process of
unpacking the packages), but provides a roughly 34% space savings for
the whole collection of packages compared to our current usage of gzip
compression (tested using Debian 13 packages) and unlike the newer zstd
compression has been supported by dpkg for long enough that we don’t
really have to worry about any given system not supporting it.
Zstd compression is supported, and used by default, in Debian and Ubuntu
starting with Debian 12 and Ubuntu 21.10.

Compared to gzip compression, zstd provides a roughly 8.6% reduction in
the total size of a full set of our packages (tested using Debian 13
packages), while at the same time reducing the overhead of unpacking the
package for installation.

Compared to the XZ compression that the previous commit enabled by
default for our packages, zstd results in roughly 38% larger packages,
but it completely removes the overhead on installation that XZ imposes,
and is thus generally considered enough of a net improvement that both
Debian and Ubuntu have pivoted from using XZ for package compression for
their distribution packages to using zstd.

@Ferroin Ferroin marked this pull request as ready for review

November 18, 2025 13:23

cubic-dev-ai[bot]

thiagoftsm

stelfrag pushed a commit to stelfrag/netdata that referenced this pull request

Dec 11, 2025
…ata#21310)

* Switch to XZ compression by default for DEB packages.

XZ compression is the de-facto standard compression used for DEB
packages on Ubuntu prior to Ubuntu 21.10 and Debian prior to Debian 12.

Using XZ for DEB package compression incurs a nontrivial performance
hit for the installation of the packages (specifically, the process of
unpacking the packages), but provides a roughly 34% space savings for
the whole collection of packages compared to our current usage of gzip
compression (tested using Debian 13 packages) and unlike the newer zstd
compression has been supported by dpkg for long enough that we don’t
really have to worry about any given system not supporting it.

* Enable zstd compression for DEB packages on platforms that support it.

Zstd compression is supported, and used by default, in Debian and Ubuntu
starting with Debian 12 and Ubuntu 21.10.

Compared to gzip compression, zstd provides a roughly 8.6% reduction in
the total size of a full set of our packages (tested using Debian 13
packages), while at the same time reducing the overhead of unpacking the
package for installation.

Compared to the XZ compression that the previous commit enabled by
default for our packages, zstd results in roughly 38% larger packages,
but it completely removes the overhead on installation that XZ imposes,
and is thus generally considered enough of a net improvement that both
Debian and Ubuntu have pivoted from using XZ for package compression for
their distribution packages to using zstd.

(cherry picked from commit 908e30b)

Ferroin added a commit that referenced this pull request

Dec 15, 2025
* Switch to XZ compression by default for DEB packages.

XZ compression is the de-facto standard compression used for DEB
packages on Ubuntu prior to Ubuntu 21.10 and Debian prior to Debian 12.

Using XZ for DEB package compression incurs a nontrivial performance
hit for the installation of the packages (specifically, the process of
unpacking the packages), but provides a roughly 34% space savings for
the whole collection of packages compared to our current usage of gzip
compression (tested using Debian 13 packages) and unlike the newer zstd
compression has been supported by dpkg for long enough that we don’t
really have to worry about any given system not supporting it.

* Enable zstd compression for DEB packages on platforms that support it.

Zstd compression is supported, and used by default, in Debian and Ubuntu
starting with Debian 12 and Ubuntu 21.10.

Compared to gzip compression, zstd provides a roughly 8.6% reduction in
the total size of a full set of our packages (tested using Debian 13
packages), while at the same time reducing the overhead of unpacking the
package for installation.

Compared to the XZ compression that the previous commit enabled by
default for our packages, zstd results in roughly 38% larger packages,
but it completely removes the overhead on installation that XZ imposes,
and is thus generally considered enough of a net improvement that both
Debian and Ubuntu have pivoted from using XZ for package compression for
their distribution packages to using zstd.

(cherry picked from commit 908e30b)