Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/Environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ export const DEFAULT_POST_ENTITIES_DAILY_QUOTA_MAX = 300
// ~38 GB) over several hours: nginx's `limit_req` zones on `/content/*` are keyed on `$uri`, so a
// bootstrap-style client requesting a different hash every time never repeats a key and never
// trips them — see the note on `DEFAULT_POST_ENTITIES_RATE_LIMIT_MAX` above, which is the same
// gap for POST. 300 req/min is well above any single legitimate client's steady fetch rate
// (comparable to `POST_ENTITIES_RATE_LIMIT_MAX`'s headroom) and far below the ~1,000-2,700 req/min
// sustained by that incident's traffic. Tune per node if it hosts an unusually large catch-up load.
export const DEFAULT_CONTENT_GET_RATE_LIMIT_MAX = 300
// gap for POST. The burst budget was raised from 300 to 1000 req/min after a review of 429s across the
// `peer*` hosts showed regular residential and mobile-ISP clients reaching ~400-1,000 content requests in
// a single minute while loading scenes. Bulk scripts sit well above that (~1.9k-8k req/min), and the hourly
// and daily quotas below still bound any sustained crawler such as the 2026-10-04 incident (~1,000-2,700
// req/min), so only the short burst allowance grows. Tune per node if it hosts an unusually large catch-up load.
export const DEFAULT_CONTENT_GET_RATE_LIMIT_MAX = 1000
export const DEFAULT_CONTENT_GET_RATE_LIMIT_WINDOW_SECONDS = 60

// Hourly and daily quotas for GET/HEAD /contents/:hashId, independent buckets layered on top of the
Expand Down
2 changes: 1 addition & 1 deletion test/unit/controllers/content-get-rate-limit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('when reading the GET /contents rate limit configuration', () => {
env = await new EnvironmentBuilder().build()
})

it('should default to 300 requests per 60 second window', () => {
it('should default to 1000 requests per 60 second window', () => {
expect([
env.getConfig(EnvironmentConfig.CONTENT_GET_RATE_LIMIT_MAX),
env.getConfig(EnvironmentConfig.CONTENT_GET_RATE_LIMIT_WINDOW_SECONDS)
Expand Down
Loading