Repository navigation
Log the size, duration and throughput of artifact downloads - #3086
Merged
Merged
Conversation
marco-c
commented
Nov 25, 2026
On mozilla-central, the bot downloads ~673 coverage artifacts (~50 GiB) in ~166 s, i.e. ~300 MB/s, but the logs don't tell whether that is limited by the network, the disk or by Python streaming the files with 8 threads. Log the size, duration and throughput of each downloaded artifact, and at the end of the download phase a summary with the number of artifacts, their total size, the wall-clock duration, the aggregate throughput, the number of worker threads and the average number of downloads in flight. Artifacts which were already on disk are logged as cached and not counted in the summary. The number of download threads is now the DOWNLOAD_WORKERS constant, set to 8, which is what ThreadPoolExecutor defaulted to on the 4-vCPU workers, so the behaviour doesn't change there.
marco-c
force-pushed
the
download-measurements
branch
from
November 25, 2026 12:55
3e7e9aa to
04ec874
Compare
marco-c
marked this pull request as ready for review
November 25, 2026 13:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The mozilla-central "repo" task downloads ~673 coverage artifacts (~50 GiB:
code-coverage-grcov.zip~66 MiB on average,code-coverage-jsvm.zip~84 MiB) in ~166 s, i.e. ~300 MB/s. The task logs have no measurements, so we can't tell whether this is limited by the network, the disk, or Python streaming the files throughrequestswith 8 threads.This adds measurements to the downloads, without changing how they are done:
cached, in which casedownload_artifactskips it):concurrency, the sum of the per-artifact durations divided by the wall-clock duration, i.e. the average number of downloads in flight:(MB = 10^6 bytes. The example values come from a local run with a mocked download.)
The number of download threads is now the
DOWNLOAD_WORKERSconstant inartifacts.py. It is set to 8, which is whatThreadPoolExecutordefaulted to (min(32, os.cpu_count() + 4)) on the 4-vCPU workers, so production behaviour doesn't change.What the next production run should tell us: if the per-artifact throughput is roughly the aggregate throughput divided by 8 and
concurrencyis close to 8, the threads are busy the whole time and more of them may help, unless the per-artifact throughput drops as we add threads (then the network or disk is the limit). Ifconcurrencyis well below 8, the time goes elsewhere (e.g. the per-task artifact listing, which is in the wall-clock duration but not in the per-artifact durations). Note that the per-artifact duration includes tenacity retries and their waits, if any happen.Testing: added tests in
bot/tests/test_artifacts.pyfor the per-artifact log line, the cached case, the summary line, and the worker count (checking thatDOWNLOAD_WORKERSis passed to the executor, by monkeypatching it).test_artifacts.py,test_grcov.pyandtest_reports.pypass locally (with grcov 0.10.9), and pre-commit is clean. This has not run on Taskcluster yet.