Skip to content

perf: Increase remote cache upload chunk size from 8KB to 256KB#12568

Merged
anthonyshew merged 1 commit intomainfrom
shew/more-upload-bandwidth
Apr 6, 2026
Merged

perf: Increase remote cache upload chunk size from 8KB to 256KB#12568
anthonyshew merged 1 commit intomainfrom
shew/more-upload-bandwidth

Conversation

@anthonyshew
Copy link
Copy Markdown
Contributor

Summary

  • Replaces BytesCodec (8KB default) with a zero-copy chunked stream yielding 256KB slices, reducing per-chunk overhead ~32x for large artifact uploads
  • Converts Vec<u8> artifact body to Bytes (Arc-backed) before the retry closure, eliminating a full deep-copy on each retry attempt

Why

The upload path streamed in-memory artifact data through FramedRead + BytesCodec, which yields 8KB chunks by default. Each chunk acquires a mutex lock in UploadProgress and traverses the full hyper/reqwest body pipeline. For large artifacts (hundreds of MB), this creates tens of thousands of unnecessary iterations and lock acquisitions, capping throughput well below what the network can handle.

How to test

The existing turborepo-cache test suite covers the upload round-trip path (test_http_cache, test_async_cache, etc.) and all 135 tests pass. For throughput verification, upload a large cache artifact (>100MB) and observe the reported upload speed in the turbo output.

@anthonyshew anthonyshew requested a review from a team as a code owner April 6, 2026 17:20
@anthonyshew anthonyshew requested review from tknickman and removed request for a team April 6, 2026 17:20
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examples-basic-web Ready Ready Preview, Comment, Open in v0 Apr 6, 2026 5:20pm
examples-designsystem-docs Ready Ready Preview, Comment, Open in v0 Apr 6, 2026 5:20pm
examples-gatsby-web Ready Ready Preview, Comment, Open in v0 Apr 6, 2026 5:20pm
examples-kitchensink-blog Ready Ready Preview, Comment, Open in v0 Apr 6, 2026 5:20pm
examples-nonmonorepo Ready Ready Preview, Comment, Open in v0 Apr 6, 2026 5:20pm
examples-svelte-web Ready Ready Preview, Comment, Open in v0 Apr 6, 2026 5:20pm
examples-tailwind-web Ready Ready Preview, Comment, Open in v0 Apr 6, 2026 5:20pm
examples-vite-web Building Building Preview, Open in v0 Apr 6, 2026 5:20pm
turbo-site Ready Ready Preview, Comment, Open in v0 Apr 6, 2026 5:20pm
turborepo-agents Ready Ready Preview, Comment, Open in v0 Apr 6, 2026 5:20pm

@anthonyshew anthonyshew enabled auto-merge (squash) April 6, 2026 17:21
@anthonyshew anthonyshew merged commit 374f7a7 into main Apr 6, 2026
58 checks passed
@anthonyshew anthonyshew deleted the shew/more-upload-bandwidth branch April 6, 2026 17:36
github-actions Bot added a commit that referenced this pull request Apr 6, 2026
## Release v2.9.5-canary.3

Versioned docs: https://v2-9-5-canary-3.turborepo.dev

### Changes

- release(turborepo): 2.9.5-canary.2 (#12566) (`8479f02`)
- feat: Add circular package dependency detection to boundaries (#12567)
(`217d486`)
- perf: Increase remote cache upload chunk size from 8KB to 256KB
(#12568) (`374f7a7`)

Co-authored-by: Turbobot <turbobot@vercel.com>
github-actions Bot added a commit that referenced this pull request Apr 6, 2026
## Release v2.9.5-canary.4

Versioned docs: https://v2-9-5-canary-4.turborepo.dev

### Changes

- perf: Increase remote cache upload chunk size from 8KB to 256KB
(#12568) (`374f7a7`)
- release(turborepo): 2.9.5-canary.3 (#12570) (`0387bad`)
- perf: Parallelize `boundaries` checking with Rayon and cache DFS
traversals (#12569) (`7830df4`)

Co-authored-by: Turbobot <turbobot@vercel.com>
github-actions Bot added a commit that referenced this pull request Apr 7, 2026
## Release v2.9.5

Versioned docs: https://v2-9-5.turborepo.dev

### Changes

- release(turborepo): 2.9.4 (#12559) (`20dfb78`)
- feat: Replace package manager commands in scaffolded README files
(#6747) (`8f6f012`)
- release(turborepo): 2.9.5-canary.1 (#12564) (`891188e`)
- chore: Remove top issues Slack notification (#12565) (`49e484f`)
- release(turborepo): 2.9.5-canary.2 (#12566) (`8479f02`)
- feat: Add circular package dependency detection to boundaries (#12567)
(`217d486`)
- perf: Increase remote cache upload chunk size from 8KB to 256KB
(#12568) (`374f7a7`)
- release(turborepo): 2.9.5-canary.3 (#12570) (`0387bad`)
- perf: Parallelize `boundaries` checking with Rayon and cache DFS
traversals (#12569) (`7830df4`)
- release(turborepo): 2.9.5-canary.4 (#12571) (`53eb059`)
- fix: Normalize CRLF line endings in file hashing to match git (#12572)
(`1403c9e`)
- release(turborepo): 2.9.5-canary.5 (#12574) (`f0e18d2`)
- fix: Suppress telemetry alert when running on Vercel (#12576)
(`ecb1040`)

---------

Co-authored-by: Turbobot <turbobot@vercel.com>
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