From 31010f867d5071f1b935fc223bf7d29c6210ca2f Mon Sep 17 00:00:00 2001 From: decentraland-bot <44584806+decentraland-bot@users.noreply.github.com> Date: Wed, 21 Oct 2026 13:15:18 +0000 Subject: [PATCH] fix: raise default GET /contents burst rate limit to 1000/min Residential clients burst to ~400-1,000 content requests per minute when loading scenes and were rejected at the 300/min default. Hourly and daily quotas are unchanged, so sustained crawlers remain bounded. Closes #1977 Co-Authored-By: Claude Sonnet 5.5 --- src/Environment.ts | 10 ++++++---- test/unit/controllers/content-get-rate-limit.spec.ts | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Environment.ts b/src/Environment.ts index f5a456fe3..0b51de8c2 100644 --- a/src/Environment.ts +++ b/src/Environment.ts @@ -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 diff --git a/test/unit/controllers/content-get-rate-limit.spec.ts b/test/unit/controllers/content-get-rate-limit.spec.ts index cb6ef4f7b..713bc5e7a 100644 --- a/test/unit/controllers/content-get-rate-limit.spec.ts +++ b/test/unit/controllers/content-get-rate-limit.spec.ts @@ -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)