Push image faster by using pigz to compress #44007
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- What I did
The gzip compression used in the docker push has poor performance. I changed it to using pigz for compression.
I noticed that docker used pigz to decompress the pull image for better performance (#35697), so I think the performance of docker push can be improved in the same way.
- How I did it
Similar to #35697, this change switches to trying to use pigz for gzip compression. If it isn't available, it'll fall back to the default. This code path can also be disabled by environment variable.
- How to verify it
Performance improvement verification: after the manual push test of some images (from 19.2 MB to 28.2 GB) , the time consumed by pushing images is reduced by 47.9%~74.7%. In fact, I have noticed that some issues have discussed and verified the performance improvement brought by this.
Correctness verification: There are existing tests for this codepath to ensure correctness of this implementation.
- Description for the changelog
Push image faster by using pigz to compress