Repository navigation
feat: dedicated data-plane rate-limit bucket - #699
Merged
Merged
Conversation
data.nemar.org re-enters api.fetch and so passes through the rateLimiter; anonymous clients were capped at 500/60s per IP. A parallel downloader (nemar-py --jobs 16) on the HTTPS backend, which 302s every file through the Worker, tripped that on large datasets (Bruno's data.nemar.org 429 reports). Add a dedicated data-ip bucket at 10000/60s for /data and /nemar/data paths, IP-keyed and isolated from the API/auth buckets. The data plane is read-only, CDN-cached, and 302s bytes to S3/GitHub (nothing streams through the Worker), so a high cap is safe; a bounded floor still backstops runaway loops. Anchored so /datasets (write API) is untouched. Tested: 9 selector tests pass; sibling rate-limit suite green.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR699Version: 🤖 Updated on each push. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
data.nemar.orgrewrites to/data/*and re-entersapi.fetch(index.ts:210), so every anonymous data-plane GET passes throughrateLimiter(index.ts:82) at 500/60s per IP. A parallel downloader (e.g.nemar-py --jobs 16) on its HTTPS backend, which 302s every file through the Worker, trips that on any large dataset. This is the source of Bruno'sdata.nemar.org429 reports.Change
Add a dedicated
data-ipbucket at 10000/60s for/dataand/nemar/datapaths, IP-keyed and isolated from the API/auth buckets.^/(nemar/)?data(/|$)) so the write API at/datasets/*keeps the standard cap.Tested
__selectBucketselector tests pass (incl. new data-plane +/datasets-is-not-data-plane cases)rate-limit-retrysuite green (21 pass)tsc --noEmitclean (pre-commit)If you'd prefer a full exemption over the 10000/60s floor, it's a one-line change.