Skip to content

fix(blob): scale multipart part size for uploads above 80 GiB - #1095

Open
Diwak4r wants to merge 2 commits into
vercel:mainfrom
Diwak4r:fix/multipart-part-size-scaling
Open

fix(blob): scale multipart part size for uploads above 80 GiB#1095
Diwak4r wants to merge 2 commits into
vercel:mainfrom
Diwak4r:fix/multipart-part-size-scaling

Conversation

@Diwak4r

@Diwak4r Diwak4r commented Aug 4, 2026

Copy link
Copy Markdown

Summary

Multipart uploads fail for files larger than 80 GiB because the part size is hardcoded to 8 MiB, and the Vercel Blob API enforces a maximum of 10,000 parts per upload (8 MiB × 10,000 = 80 GiB). This contradicts the advertised 5 TB support for multipart uploads.

The fix scales the part size up for bodies with a known size above 80 GiB so the part count always stays at or under 10,000, e.g. a 100 GiB body now uploads with ~10.2 MiB parts instead of failing at part 10,001.

Changes

  • packages/blob/src/multipart/upload.ts
    • Added getPartSizeInBytes(totalToLoad): returns the 8 MiB default for bodies at or under 80 GiB, otherwise Math.ceil(totalToLoad / 10_000).
    • uploadAllParts now derives the part size from totalToLoad instead of the module-level constant.
    • Decoupled the read-ahead memory bound (maxBytesInMemory) from the part size. It previously scaled with the part size (2 parts × concurrency), which would buffer gigabytes for the larger part sizes now used on big uploads; it stays at the previous 128 MiB ceiling.
  • packages/blob/src/index.node.test.ts — new tests:
    • getPartSizeInBytes keeps 8 MiB at/under the 80 GiB ceiling.
    • Part size scales above 80 GiB and keeps the part count ≤ 10,000 (including for a 5 TiB body).
    • An upload above 80 GiB produces one scaled part instead of many 8 MiB parts.
    • Small bodies still split into 8 MiB parts (no regression).

Bodies with an unknown size (streams) keep the 8 MiB default, since the total length isn't known upfront.

Tests

  • test:node — 6 suites, 176 tests, 20 snapshots ✅
  • test:edge — 1 suite, 1 test, 2 snapshots ✅
  • test:browser — 3 suites, 19 tests, 3 snapshots ✅

Fixes #1067

Copilot AI review requested due to automatic review settings August 4, 2026 08:20
@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 28f2029

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@Normanyadav is attempting to deploy a commit to the Curated Tests - Permanent E2E Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@socket-security

socket-security Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​undici@​6.28.09310010097100

View full report

@Diwak4r
Diwak4r force-pushed the fix/multipart-part-size-scaling branch from 99f06b8 to 28f2029 Compare August 5, 2026 02:20
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.

Multipart upload fails above 80 GB — hardcoded 8 MB part size hits 10,000 part limit

3 participants