Skip to content

Conversation

@vicb
Copy link
Contributor

@vicb vicb commented Nov 20, 2025

r2 bulk put is based on the Cloudflare API which is rate limited

Make sure we do not exceed the limit when bulk uploading to R2


  • Tests
    • Tests included
    • Tests not necessary because: validated locally by bulk putting 5000 files
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: experimental command
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: not in v3

@vicb vicb requested a review from a team as a code owner November 20, 2025 17:10
@vicb vicb added wrangler Relating to the Wrangler CLI tool r2 Relating to R2 labels Nov 20, 2025
@changeset-bot
Copy link

changeset-bot bot commented Nov 20, 2025

🦋 Changeset detected

Latest commit: 9a2a516

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@github-actions
Copy link
Contributor

Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the v3-maintenance branch with your changes. Thank you for helping us keep Wrangler v3 supported!

Depending on your changes, running git rebase --onto v3-maintenance main vicb/r2-rate-limit might be a good starting point.

Notes:

  • your PR branch should be named v3-backport-11367
  • add the skip-v3-pr label to the current PR to stop this workflow from failing

@vicb vicb added the skip-v3-pr Skip validation of presence of a v3 backport PR label Nov 20, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 20, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@11367

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@11367

miniflare

npm i https://pkg.pr.new/miniflare@11367

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@11367

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@11367

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@11367

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@11367

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@11367

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@11367

wrangler

npm i https://pkg.pr.new/wrangler@11367

commit: 9a2a516

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Nice solution.
Does this mean, though, that this approach is fundamentally constrained to be blocked for 5 mins on scenarios where there are more than 5000 files to be cached?

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Nov 21, 2025
@vicb
Copy link
Contributor Author

vicb commented Nov 21, 2025

Does this mean, though, that this approach is fundamentally constrained to be blocked for 5 mins on scenarios where there are more than 5000 files to be cached?

yes, more than 1200 remote objects actually, unfortunately

(edit: still faster than 1 object/s without bulking but we probably need to improve that)

@vicb vicb force-pushed the vicb/r2-rate-limit branch from 7920ba0 to 9a2a516 Compare November 21, 2025 14:45
@vicb vicb merged commit e496280 into main Nov 21, 2025
35 of 36 checks passed
@vicb vicb deleted the vicb/r2-rate-limit branch November 21, 2025 16:51
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r2 Relating to R2 skip-v3-pr Skip validation of presence of a v3 backport PR wrangler Relating to the Wrangler CLI tool

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants