Skip to content
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

Pushing with kaniko is slow #2751

Open
suleimi opened this issue Sep 18, 2023 · 5 comments
Open

Pushing with kaniko is slow #2751

suleimi opened this issue Sep 18, 2023 · 5 comments
Labels
area/performance issues related to kaniko performance enhancement issue/http2 kind/friction priority/p2 High impact feature/bug. Will get a lot of users happy

Comments

@suleimi
Copy link

suleimi commented Sep 18, 2023

Actual behavior
Pushing large images (e.g 5Gb) with kaniko to some https registries (e.g ecr, quay or gitlab contianer registry) has been identified to be quite slow when using kaniko . After some preliminary investigation (in https://gitlab.com/gitlab-org/gitlab/-/issues/241996 )it appears the slowness comes from the issue mentioned in golang/go#47840 and is related to the http/2 implementation of net/http

Because of the slowness caused by golang/go#47840 docker and buildx registry clients have opted to only push on http/1.1 connection. see: moby/buildkit#1420

A few issues have been raised on (go-containerregistry) which kaniko uses that alludes to a similar http2 bottleneck:

Expected behavior

Pushing a 5Gb layer using kaniko to gitlab contianer registry, ecr or quay should not take > 30mins on arguably fast internet connections

To Reproduce
Steps to reproduce the behavior:

  1. Push a random 5Gb image to gitlab container registry
  2. Push a random 5Gb image to gitlab container registry with http 2 disabled (by setting GODEBUG="http2client=0")
  3. Observe it takes almost > 40mins with http 2 enabled

Additional Information

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
@aaron-prindle aaron-prindle added area/performance issues related to kaniko performance enhancement priority/p2 High impact feature/bug. Will get a lot of users happy kind/friction issue/http2 labels Sep 20, 2023
@slamer59
Copy link

slamer59 commented Sep 22, 2023

From 40 minutes to 2 minutes with workaround... Thanks !

@stocktondr
Copy link

From 40 minutes to 2 minutes with workaround... Thanks !

We are having the same problem.
The workaround also worked for us.

@zijiwork
Copy link

How to solve the problem of slow push in tekton kaniko

@keepdying
Copy link

We also saw improvements on builds while pushing caches and image to gcr and gar. From 13 mins to 7 mins.
Thanks for workaround!

@psarka
Copy link

psarka commented Nov 17, 2023

In my case it went from 38min to 2min. @zijiwork this is how you do it in gitlab:

build-ci-image:
    stage: build-ci-image
    variables:
         GODEBUG: "http2client=0"
    image:
        name: gcr.io/kaniko-project/executor:v1.9.0-debug
        entrypoint: [ "" ]
    script:
        - /kaniko/executor
            --context ...
            --dockerfile ...
            --destination ...

danielschemmel added a commit to srg-imperial/norman that referenced this issue Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/performance issues related to kaniko performance enhancement issue/http2 kind/friction priority/p2 High impact feature/bug. Will get a lot of users happy
Projects
None yet
Development

No branches or pull requests

7 participants