Skip to content

fix: stream upload to S3#905

Merged
fenos merged 3 commits into
masterfrom
storage/improve-upload-performance
Mar 23, 2026
Merged

fix: stream upload to S3#905
fenos merged 3 commits into
masterfrom
storage/improve-upload-performance

Conversation

@fenos

@fenos fenos commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Improvement

What is the current behavior?

Currently, we upload to S3 using the Upload class form the @aws-sdk/lib-storage.
This library seems to be buffering in memory each chunk before uploading them to S3, (that's because it needs to calculate the size of the stream)

What is the new behavior?

We do know the content length in most cases, so we can simply pipe the body into the PutObject method so that we stream it all at once

@fenos fenos requested a review from a team as a code owner March 12, 2026 09:32
@ferhatelmas ferhatelmas force-pushed the storage/improve-upload-performance branch 3 times, most recently from cfb19de to 057f446 Compare March 13, 2026 12:09
Comment thread src/storage/backend/s3/adapter.ts
Comment thread src/storage/backend/s3/adapter.ts
Comment thread src/storage/uploader.ts
fenos and others added 3 commits March 16, 2026 12:44
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
@ferhatelmas ferhatelmas force-pushed the storage/improve-upload-performance branch from 057f446 to a0125fb Compare March 16, 2026 11:44
@fenos fenos merged commit 3e22a42 into master Mar 23, 2026
3 checks passed
@fenos fenos deleted the storage/improve-upload-performance branch March 23, 2026 16:01
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.

4 participants