-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Make 'docker push' faster at the small expense of extra registry disk space #9060
Conversation
… space Signed-off-by: R.B. Boyer <arebee@nexusvector.net>
I'm sorry, but the gains in compression speed aren't worth it for everyone. There are a lot of users out there who will get their TCP connections dropped due to bad connectivity before they get a chance to complete the upload of a layer. Some are uploading large images for Android build environments. As you can imagine, these environments are pretty big and a single layer can exceed 5-8 GB, even when it is compressed. There are also users who have "data allowances" set by their ISPs. We should focus on improving the performance of the gzip package, instead of lowering the compression level. There's a lot of room for improvement there. I'm not saying that the gzip package from Go's stdlib hasn't had work done to it, I'm just saying it could use some more. There are some tests I need to do to propose an alternative solution. Meanwhile, please don't merge this. edit: This would also make image downloads slower and less cacheable by the CDN. NOT LGTM |
We think this needs to be configurable but needs a proposal first. This may fix your issue with CPU load because you have faster bandwidth. However, someone running docker with larger CPUs and lower bandwidth will be hurt by this change. Could you please open a proposal if you would like to have this setting configurable so that we can discuss before making code changes? Thanks! |
@crosbymichael I can open a proposal. I'm thinking about adding cli flags for
|
@bobrik Have you or are you able to create some benchmarks on the different compression algos and levels for docker images. I know the main reason why we don't use compression is because of close CPU on a few of the providers causing pulls to be extremely slow when pulling and pushing images. Maybe this is just an edge case but I'm not sure we have any real benchmarks. This may give us a better idea if we can change the default algo used with docker or if we are able to make a smart decision on what to use based on the machine. It may help by us not having to add a few of these flags to What do you think? |
I think we need to pursue the option of using cgzip or shelling out to gzip first before we attempt to add other flags. This would be far more useful than adding a ton of flags. Please keep in mind that the |
Ok let's discuss cgzip or shelling out to gzip in #10181 first. We can get back to flags later. |
👍 for compression |
Docker push currently uses default gzip settings to ship layers to the registry server. This is somewhat cpu intensive and annoying when doing frequent pushes (as you would when inserting Docker into your CI pipeline).
Instead of using the default gzip settings use
gzip.BestSpeed
which is faster but compresses less completely than the defaults. This pushes gzip closer to Google's Snappy compression library in spirit ("high speeds and reasonable compression").Timing comparision using the
google/golang
image over localhost into a sandbox registry:This is somewhat related to #7291 but that issue is locked from non-contributor comments.