Skip to content

Conversation

@vvoland
Copy link
Collaborator

@vvoland vvoland commented Sep 28, 2022

Respect the maximum concurrent downloads/upload daemon configuration.

Signed-off-by: Paweł Gronowski [email protected]

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Comment on lines +63 to +64
// TODO(vvoland): use the i.downloadLimiter directly
opts = append(opts, containerd.WithMaxConcurrentDownloads(i.limits.MaxConcurrentDownloads))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For pulls, the maximum downloads is currently respected across one pull - not the whole engine. Pull creates its own semaphore.Weighted inside the private fetch function which makes it impossible to share one limiter for all pulls.
Possibly at some point we would need to have our own implementation of Pull anyway, so maybe it's fine for now? I also have a quick patch PoC for containerd that would allow to pass the semaphore.Weighted directly. So I could try to clean it up a bit and make a it PR for it upstream, WDYT?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, from the help: Set the max concurrent downloads for each pull (default 3)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help text is misleading then - limit is per whole engine.

opts = i.applySnapshotterOpts(opts, ref)

if i.limits.MaxConcurrentDownloads > 0 {
// TODO(vvoland): use the i.downloadLimiter directly
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this TODO means?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intent here is to use the same semaphore.Weighted for all pulls - to limit the downloads across whole engine and not one pull.

@vvoland vvoland force-pushed the c8d branch 2 times, most recently from 5e88685 to ac7a31e Compare October 21, 2022 15:01
@vvoland vvoland force-pushed the c8d branch 2 times, most recently from 13b2b08 to ff5b724 Compare November 8, 2022 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Won't Upstream

Development

Successfully merging this pull request may close these issues.

4 participants