-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
distribution: Set default compression to zstd/fastest #48328
base: master
Are you sure you want to change the base?
Conversation
gzip compression is notoriously slow. The compression on skylake happens at 7MiB/s. The push rate is not sustainable for large multi-gigabyte images. zstd/fastest runs at 81 MiB/s for the same image. That gives tenfold push speedup with default flags. Resolves: moby#1266 See also: moby#48106 Signed-off-by: Roman Bolshakov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zstd support is not as universal as gzip. That definitely can't be the default.
If you're interested in building and pushing zstd images, you can do so natively in Docker with the containerd image store integration enabled, see: https://docs.docker.com/engine/storage/containerd/.
@vvoland what do you think if default compression method and compression level is specified via I wanted to try the suggested approach but I don't see any migration path for the running containers:
In order to test properly it should have a migration path, at least disruptive for the starter. Do you know how I can migrate my containers and images to containerd to test the feature? With regards to universality... zstd was open-sourced in 2016 and it's pretty much being adopted everywhere. The adoption is still in progress. The fix works pretty well in production environment without the need to change tooling and I haven't seen an issue with |
Personally speaking (can't speak for other maintainers though), it would be fine to have an optional setting (possibly a However, please do note that:
There's no official migration process. It's advised to just re-pull/rebuild all the images in the new store. Technically you can transfer your images via
While we might consider having some kind of a "best-effort" image migration, I don't think it will be able feasible to migrate running containers. In general, it's advised to treat your containers with the "cattle not pets" rule in mind. |
While zstd itself is quite widespread now, its support is not a MUST in the OCI spec:
|
FWIW I did a bit of research into widespread versions of popular runtimes and their support for zstd in docker-library/official-images#17720 - it's a little grim, especially around Debian Stable/Oldstable (Bookworm/Bullseye), which are both on Docker 20.10 (and thus have no zstd support), so IMO we can't reasonably change the default just yet, but making it possible to use zstd compression via configuration seems really sane. |
gzip compression is notoriously slow. The compression on skylake happens at 7MiB/s. The push rate is not sustainable for large multi-gigabyte images.
zstd/fastest runs at 81 MiB/s for the same image. That gives tenfold push speedup with default flags.
Resolves: #1266
See also: #48106
- How to verify it
Use
docker push
with built-indocker
buildkit driver- Description for the changelog