fix: increase HTTP rate limit shard headroom (#3432)

This commit is contained in:
Patrick Erichsen
2026-08-06 12:04:18 -07:00
committed by GitHub
parent 871e430ef6
commit 788ee762a0
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -278,7 +278,7 @@ describe("applyRateLimit headers", () => {
});
});
it("configures component-backed HTTP limits with 16 shards", async () => {
it("configures high-volume component-backed HTTP limits with 32 shards", async () => {
vi.spyOn(Date, "now").mockReturnValue(2_600_000);
const ctx = makeRateLimitCtx({
ip: {
@@ -305,7 +305,7 @@ describe("applyRateLimit headers", () => {
rate: RATE_LIMITS.download.ip,
period: 60_000,
start: 0,
shards: 16,
shards: 32,
}),
});
});
+1 -1
View File
@@ -14,7 +14,7 @@ export const RATE_LIMITS = {
} as const;
const RATE_LIMIT_WINDOW_MS = 60_000;
const HTTP_RATE_LIMIT_SHARDS = 16;
const HTTP_RATE_LIMIT_SHARDS = 32;
const HTTP_RATE_LIMIT_MIN_SHARD_CAPACITY = 10;
const HTTP_RATE_LIMIT_KEY_TTL_MS = 24 * 60 * 60 * 1000;