Skip to content

perf: add 8 MiB buffered reader to S3 upload pipe#216

Merged
joshfriend merged 1 commit intomainfrom
jfriend/buffered-upload-pipe
Mar 23, 2026
Merged

perf: add 8 MiB buffered reader to S3 upload pipe#216
joshfriend merged 1 commit intomainfrom
jfriend/buffered-upload-pipe

Conversation

@joshfriend
Copy link
Copy Markdown
Contributor

The save path streams tar|zstd output through an io.Pipe into the multipart uploader. The pipe has zero internal buffer — when all upload workers are busy sending parts to S3, the reader goroutine blocks, which blocks the pipe, which stalls the archive process.

Adding an 8 MiB bufio wrapper lets the archive keep producing data while workers are busy, smoothing out the stalls. Benchmarked on r8id.metal-48xlarge with a 2.4 GB compressed cache bundle.

The save path streams tar|zstd output through an io.Pipe into the
multipart uploader. The pipe has zero internal buffer — when all upload
workers are busy sending parts to S3, the reader goroutine blocks,
which blocks the pipe, which stalls the archive process.

Adding an 8 MiB bufio wrapper lets the archive keep producing data
while workers are busy, smoothing out the stalls. Benchmarked on
r8id.metal-48xlarge with a 2.4 GB compressed cache bundle.
@joshfriend joshfriend requested a review from a team as a code owner March 23, 2026 18:19
@joshfriend joshfriend requested review from alecthomas and removed request for a team March 23, 2026 18:19
@alecthomas
Copy link
Copy Markdown
Collaborator

Nice!

@joshfriend joshfriend merged commit 19b6bc9 into main Mar 23, 2026
7 checks passed
@joshfriend joshfriend deleted the jfriend/buffered-upload-pipe branch March 23, 2026 21:06
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.

2 participants