fix: add global process-level rate limit bucket above per-connection checks (PILOT-317)#30
fix: add global process-level rate limit bucket above per-connection checks (PILOT-317)#30matthew-pilot wants to merge 1 commit into
Conversation
…nection checks (PILOT-317) The rate limiter in accept.go is per-IP only. A botnet with 256 IPs at 100 req/s each can push 25.6k req/s — well above expected normal load. The existing per-connection rate check (500 req/s ceiling per connection) doesn't bound the aggregate. Add a globalRateBucket (1000 req/s process-wide) checked in both handleJSONConn and handleBinaryConn after the 5-second grace period. If total request rate across all connections exceeds the global ceiling, the connection is closed with a warning log. Closes PILOT-317
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📊 PR Status — #30 PILOT-317
CI Checks (2/2 passing)
Authormatthew-pilot (bot) Created: 2026-05-31 00:11 UTC |
🔍 Canary & Ticket Status UpdateCanary: 🟡 queued — Run #26698606660 (dispatched 00:11 UTC, awaiting runner) Jira PILOT-317:
|
🔍 PR Explanation — #30 PILOT-317What this doesAdds a process-wide global rate-limit bucket (1000 req/s) that sits above the existing per-connection rate checks in The problemThe existing rate limiter is per-IP only. A distributed botnet with 256 IPs at 100 req/s each can push 25.6k req/s — well above expected normal load. The per-connection ceiling (500 req/s) doesn't bound the aggregate across all connections. The fix1. New
2.
3. Global check in
4. Global check in
Scope
|
📊 PR Status Update — #30 PILOT-317
|
What failed
The rate limiter in accept.go is per-IP only. A botnet with 256 IPs at 100 req/s each can push 25.6k req/s — well above expected normal load. The existing per-connection rate check (500 req/s ceiling per connection) doesn't bound the aggregate.
Why this fix
Add a
globalRateBucket(1000 req/s process-wide) checked in bothhandleJSONConnandhandleBinaryConnafter the 5-second grace period. If total request rate across all connections exceeds the global ceiling, the connection is closed with a warning log.Verification
go build ./...✅go vet ./...✅go test ./...✅ (18/18 packages)Closes PILOT-317