Repository navigation
Description
Parallelize OCI layer fetching during OSTree image imports (follow-up to ostree-rs-ext#365)
Description
When rebasing between Bazzite stable and testing, I've noticed that the OSTree container importer appears to fetch and import OCI layers sequentially, resulting in significantly longer download times compared to Skopeo's concurrent layer downloads.
This appears related to the original issue:
Since ostree-rs-ext has been merged into bootc and the original repository is archived, I'm opening this as a follow-up with reproducible benchmarks and debug logs.
Environment
OS: Bazzite, Fedora 44
rpm-ostree: 2026.3-2.fc44
OSTree: 2026.4-1.fc44
bootc: 1.16.13-1.fc44
Skopeo: 1.22.3
Image:
ghcr.io/ublue-os/bazzite:stableImage layers: 128
Reported download size: 5.1 GB
Internet connection: 2 Gbps downstream
Benchmark results
I tested the same Bazzite image using three different download methods.
Method | Real time | User CPU | System CPU -- | -- | -- | -- Skopeo (1 concurrent layer) | 57.673s | 19.708s | 11.826s Skopeo (8 concurrent layers) | 38.486s | 26.165s | 21.951s OSTree container image pull | 206.820s | 1.745s | 6.092sSkopeo with eight concurrent layers completed approximately 33% faster than Skopeo with one.
The OSTree pull took approximately 5.37 times as long as the eight-layer Skopeo test.
These are single-run measurements, not repeated statistical benchmarks. The Skopeo dir: transport and OSTree repository import also perform different amounts of work, so the entire difference cannot be attributed to download concurrency alone.
Reproduction
Skopeo, single concurrent layer:
mkdir -p /var/tmp/bazzite-skopeo-serial
time skopeo copy
--image-parallel-copies 1
docker://ghcr.io/ublue-os/bazzite:stable
dir:/var/tmp/bazzite-skopeo-serial
Skopeo, eight concurrent layers:
mkdir -p /var/tmp/bazzite-skopeo-parallel
time skopeo copy
--image-parallel-copies 8
docker://ghcr.io/ublue-os/bazzite:stable
dir:/var/tmp/bazzite-skopeo-parallel
OSTree container image pull using a separate, clean repository:
sudo mkdir -p /var/tmp/bazzite-pull-testsudo ostree
--repo=/var/tmp/bazzite-pull-test
init --mode=bare-user
time sudo ostree container image pull
/var/tmp/bazzite-pull-test
ostree-unverified-registry:ghcr.io/ublue-os/bazzite:stable
The standalone OSTree test used an unverified registry reference only to isolate the import behavior without configuring image-signature verification.
Debug findings
I repeated the OSTree pull with:
sudo env
RUST_LOG=ostree_ext=trace,containers_image_proxy=debug
ostree container image pull
/var/tmp/bazzite-pull-test
ostree-unverified-registry:ghcr.io/ublue-os/bazzite:stable
2>&1 | tee /var/tmp/ostree-pull-debug.logThe log repeatedly shows the following sequence:
DEBUG fetching sha256:<digest A>
DEBUG get_blob: fetching blob
DEBUG finish_pipe: closing pipe
DEBUG Imported ... content objects
DEBUG Wrote ostree/container/blob/...
DEBUG fetching sha256:<digest B>
DEBUG get_blob: fetching blob
DEBUG finish_pipe: closing pipe
DEBUG Imported ... content objects
DEBUG Wrote ostree/container/blob/...
The next layer's fetch is not logged until the preceding layer's import and reference write have completed.
This is consistent with sequential fetch/import processing, although the log alone does not conclusively rule out internal prefetching.
Network monitoring also showed fewer Skopeo TCP connections during the OSTree pull than during a direct Skopeo copy with eight concurrent transfers.
Proposed improvement
Would it be possible to decouple OCI blob fetching from sequential OSTree layer importing?
For example:
Fetch a bounded number of OCI blobs concurrently (perhaps 2–4 initially).
Buffer or stage completed downloads as needed.
Continue importing layers in their required order.
Overlap network fetching with the import of previously downloaded layers.
Preserve integrity verification, memory limits, and proper error handling.
An optional configuration to control download concurrency could also be useful, particularly on faster connections.
The original issue mentioned concurrent fetching/unpacking and possible concurrency changes to containers-image-proxy-rs:
I'd be interested to know whether that work is still planned, whether any architectural limitations remain, or whether the current bootc implementation has an alternative parallel download path.
I'm happy to provide additional logs, repeat benchmarks, or help test potential changes.
Activity
MMagTech commentedon Nov 1, 2026
Another data point, from a Bazzite-based image on ghcr.io (2026-11-01). The update needed 75 layers, 3.54 GB.
bootc upgradeheld one connection to pkg-containers.githubusercontent.com and averaged about 0.3 MB/s, while the same network did 17 to 43 MB/s from other hosts at the same time. From another machine on that network, one ghcr.io blob got 0.21 to 0.27 MB/s on each of the four 185.199.108-111.154 addresses. 4 concurrent requests got about 1 MB/s together, and 12 concurrent range requests 2.84 MB/s (0.24 MB/s each). So when the CDN limits each connection, as it did that evening, the time is set by the per-connection rate, and fetching layers in parallel (#1424) would cut it by roughly the number of connections.