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

c8d/list: Generate image summary concurrently #47580

Merged
merged 2 commits into from Mar 19, 2024

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Mar 18, 2024

- What I did

Add Images benchmark

Added a small benchmark that calls Images with image store containing 10, 100 and 1000 random images. Currently the images are single-platform only.

The images are generated randomly, but a fixed seed is used so the actual testing data will be the same across different executions.

Because the content store is not a real containerd image store but a local implementation, a small delay (500us) is added to each content store method call. This is to simulate a real-world usage where each containerd client call requires a gRPC call.

Generate image summary concurrently

Run imageSummary concurrently to avoid being IO blocked on the containerd gRPC.

- How I did it

- How to verify it

$ go test -bench=. -benchtime 5s -run BenchmarkImageList
goos: linux
goarch: arm64
pkg: github.com/docker/docker/daemon/containerd
-BenchmarkImageList/10-images-6                16         367278667 ns/op
-BenchmarkImageList/100-images-6                8         688544167 ns/op
-BenchmarkImageList/1000-images-6               4        1337588918 ns/op
+BenchmarkImageList/10-images-6               140          42308378 ns/op
+BenchmarkImageList/100-images-6               81          68406268 ns/op
+BenchmarkImageList/1000-images-6              81          90511519 ns/op
PASS

- Description for the changelog

containerd image store: Improve `docker images` performance

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

@vvoland vvoland added status/2-code-review kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. impact/changelog area/performance area/images containerd-integration Issues and PRs related to containerd integration labels Mar 18, 2024
@vvoland vvoland added this to the 26.0.0 milestone Mar 18, 2024
@vvoland vvoland self-assigned this Mar 18, 2024
Benchmark the `Images` implementation (image list) against an image
store with 10, 100 and 1000 random images. Currently the images are
single-platform only.

The images are generated randomly, but a fixed seed is used so the
actual testing data will be the same across different executions.

Because the content store is not a real containerd image store but a
local implementation, a small delay (500us) is added to each content
store method call. This is to simulate a real-world usage where each
containerd client call requires a gRPC call.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Run `imageSummary` concurrently to avoid being IO blocked on the
containerd gRPC.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland merged commit 4531a37 into moby:master Mar 19, 2024
138 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/images area/performance containerd-integration Issues and PRs related to containerd integration impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants