util/resolver/limited: make registry concurrency configurable via BUILDKIT_MAX_REGISTRY_CONCURRENCY#6517
Conversation
… var Add BUILDKIT_MAX_REGISTRY_CONCURRENCY environment variable to allow users to override the default max concurrency of 4 connections per registry. Users with high-bandwidth networks pulling large images are bottlenecked by the hardcoded limit. Signed-off-by: omerXfaruq <omerXfaruq@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
hi @tonistiigi @AkihiroSuda who would be the right person to review this PR? never contributed to buildkit before :) |
tonistiigi
left a comment
There was a problem hiding this comment.
I'd prefer if this would be in the buildkitd toml config instead of env.
|
(Drive-by comment) I know on the dockerd daemon we have options to limit concurrent push/pulls, but ISTR there were some issues with the containerd image store integrations that still needed work; maybe it was that it didn't limit the total (but only per operation 🤔) (but perhaps was resolved); |
@tonistiigi yup, i was hesitant about that part as well, since it'd be easier to build it with i took that path. open to alternative solutions. my previous discussion regarding this with claude: |
|
Still prefer config. |
Summary
BUILDKIT_MAX_REGISTRY_CONCURRENCYenvironment variable to allow overriding the default max concurrency of 4 connections per registrydocker buildx create --driver-opt env.BUILDKIT_MAX_REGISTRY_CONCURRENCY=20, Kubernetes pod env, etc.)Relates to #6123
Changes
util/resolver/limited/group.go: Replace hardcodedDefaultMaxConcurrency int64 = 4with agetMaxConcurrency()function that reads the env var at init time, falling back to 4 if unset/invalidutil/resolver/limited/group_test.go: Add table-driven test forgetMaxConcurrency()covering valid values, zero, negative, and non-numeric inputTest plan
BUILDKIT_MAX_REGISTRY_CONCURRENCY=20and verify increased parallelism on large image pulls🤖 Generated with Claude Code