Skip to content

perf(upload): default --concurrency to 256 - #54

Merged
v1rtl merged 1 commit into
mainfrom
perf/upload-concurrency
Nov 9, 2026
Merged

v1rtl merged 1 commit into
mainfrom
perf/upload-concurrency

Conversation

@v1rtl

@v1rtl v1rtl commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

hoverfly upload has defaulted to an 8-session pool since the first upload implementation. Every throughput improvement since then was measured with 128–256 sessions: the daemon's --pool-size 256, and bench-direct passing --concurrency 128. A plain hoverfly upload with no flags never benefited from that work.

This changes DEFAULT_UPLOAD_CONCURRENCY from 8 to 256, the same value as the daemon's --pool-size.

Why 8 is too small

Each chunk is pushed through the closest session in the pool. With only 8 sessions, most chunks go through peers that are far from their address.

The ENS portal release job runs hoverfly upload portal.tar with no flags (run):

  • 8.9 MB (5756 chunks) took 210 s, about 42 KB/s.
  • The pool stayed at 8 the whole time (pool=8 (at inflight cap=8)).
  • 53% of pushes got a shallow receipt.
  • 22 chunks were accepted shallow-only after 59 retries, which made up the last quarter of the run.

For comparison, a random 20 MiB file is 5563 chunks, about the same as the portal. The benchmarks push that in roughly 9–48 s.

Effect on small uploads and the browser

  • Small uploads: push_chunks_concurrent still sizes the pool as max(4 × chunks, 16), capped by --concurrency. A 3-chunk file opens 16 sessions, not 256.
  • Browser: wasm passes its own UPLOAD_POOL (48) to every upload call and never read this constant. Browser uploads don't change.
  • Daemon: the daemon already used 256 for raw and single-file uploads. Collection uploads go through upload_collection with the request's concurrency, so they also move from 8 to 256.

The one-shot upload pool has defaulted to 8 sessions since the first
upload code. The throughput work since then (latency-aware cap, pool and
buffer sweeps) ran through the daemon's --pool-size 256 and an explicit
--concurrency in bench-direct, so a plain `hoverfly upload` never got it.

Each chunk is routed through the closest session, so 8 sessions send most
chunks through far-away peers. The ENS portal release job runs with no
flags: 8.9 MB in 210 s, pool=8 throughout, 53% of pushes answered
shallow, and 22 chunks accepted shallow-only after 59 retries.

Small uploads are unaffected: push_chunks_concurrent still opens
max(4 per chunk, 16) sessions, capped by this value. The browser passes
its own UPLOAD_POOL (48) and never read this constant.
@v1rtl
v1rtl merged commit 22f2389 into main Nov 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant