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

Excessive amount of image pulls #125

Open
awptechnologies opened this issue Jan 22, 2024 · 7 comments
Open

Excessive amount of image pulls #125

awptechnologies opened this issue Jan 22, 2024 · 7 comments

Comments

@awptechnologies
Copy link

i have 50 containers running. 28 stacks but of course being docker swarm i have some containers replicated.
Shepherd is going through all 200 of my pulls before its able to update them all.
Is there any way to tone this down?? i have multiple stacks that rely on the same image. For example mariadb. but it still tries to pull a new image for every service even if they are running same image.

@moschlar
Copy link
Collaborator

Hm.

I suppose we could optimize that by aggregating the used images to eliminate duplicates - but the actual docker swarm service update will be individually per service, I think.

@shizunge
Copy link

shizunge commented Jan 25, 2024

What is your top concern?

  1. hit the docker hub rate limit https://docs.docker.com/docker-hub/download-rate-limit/ ?
  2. or image download uses too much internet bandwidth / server resources ?

The former one is due to

  1. Both docker manifest inspect and docker service update contributes to the dockerhub rate usage.
  2. Shepherd runs docker manifest inspect on all services, even they have the same image before updating. We do need to check whether there is an update on all services, but we can cache the results.
    As a result, today, Shepherd would consume at least dockerhub rate 56 for your 28 stacks.
    But it seems shepherd does more than I understand, and consumes more than 200 dockerhub rate. Maybe the commands use more than 1 rate.

For later one, I guess (no proof) docker service update https://docs.docker.com/engine/reference/commandline/service_update/ would use the local image if available. But I don't think it accepts the digest of the image to avoid querying the register.

@shizunge
Copy link

shizunge commented Jan 25, 2024

Run a quick experiment: 2 docker manifest inspect commands consume 1 dockerhub rate.

@moschlar
Copy link
Collaborator

moschlar commented Jan 31, 2024

FWIW: See the workaround to use a registry mirror at #73 (comment)

@shizunge
Copy link

FWIW: See the workaround to use a registry mirror at #73 (comment)

Registry mirroring is also one thing I did. You may use this as a template to setup your own repo https://github.com/shizunge/dockerhub-mirror

@awptechnologies
Copy link
Author

Im not 100% up to date on this stuff. What exactly would the registry mirroring do and how would it help in my situation?

@martadinata666
Copy link

martadinata666 commented Mar 13, 2024

essentially pull images from docker registry to your github registry. Then deploy the image from github registry, as github registry doesn't have a stupid rate limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants