Skip to content

[TON-370] By recipient rate limiting - #198

Open
g3co wants to merge 6 commits into
masterfrom
feature/TON-370_byrecipient-ratelimit
Open

[TON-370] By recipient rate limiting#198
g3co wants to merge 6 commits into
masterfrom
feature/TON-370_byrecipient-ratelimit

Conversation

@g3co

@g3co g3co commented Mar 24, 2026

Copy link
Copy Markdown
Contributor
  • Per-recipient rate limit on /bridge/message — prevents flooding a single to address
  • Leaky bucket: 1 msg per interval (default 10s), configurable via RECIPIENT_RATE_LIMIT_INTERVAL, 0 to disable
  • Implemented as Echo middleware, applied to both v1 and v3 bridge apps
  • Bypass token (RATE_LIMITS_BY_PASS_TOKEN) is respected
  • Returns 429 when limit is hit

@github-actions

github-actions Bot commented Mar 24, 2026

Copy link
Copy Markdown

📊 Performance Metrics

Performance Metrics (memory storage)

  • CPU: 0.74s (4 cores) • Goroutines: 8 • Threads: 7
  • Memory: 21.7MB heap • 48.0MB RAM • 38.6MB total • 240604 allocs
  • GC: 9 cycles (0.55ms avg)
  • FDs: 9/65536 (0.0%)

@github-actions

github-actions Bot commented Mar 24, 2026

Copy link
Copy Markdown

📊 Performance Metrics

Performance Metrics (postgres storage)

  • CPU: 0.88s (4 cores) • Goroutines: 10 • Threads: 9
  • Memory: 16.0MB heap • 56.8MB RAM • 40.2MB total • 267331 allocs
  • GC: 10 cycles (0.23ms avg)
  • FDs: 35/65536 (0.1%)

@github-actions

github-actions Bot commented Mar 24, 2026

Copy link
Copy Markdown

📊 Performance Metrics

Performance Metrics (cluster-valkey storage)

  • CPU: 0.68s (4 cores) • Goroutines: 11 • Threads: 8
  • Memory: 17.1MB heap • 62.9MB RAM • 38.2MB total • 303017 allocs
  • GC: 9 cycles (0.38ms avg)
  • FDs: 71/65536 (0.1%)

@github-actions

github-actions Bot commented Mar 24, 2026

Copy link
Copy Markdown

📊 Performance Metrics

Performance Metrics (dnsmasq storage)

  • CPU: 0.43s (4 cores) • Goroutines: 11 • Threads: 11
  • Memory: 13.9MB heap • 46.2MB RAM • 23.3MB total • 148692 allocs
  • GC: 7 cycles (0.62ms avg)
  • FDs: 71/65536 (0.1%)

@github-actions

github-actions Bot commented Mar 24, 2026

Copy link
Copy Markdown

📊 Performance Metrics

Performance Metrics (nginx storage)

  • CPU: 0.10s (4 cores) • Goroutines: 6 • Threads: 6
  • Memory: 1.2MB heap • 23.0MB RAM • 1.2MB total • 6459 allocs
  • GC: 0 cycles (0ms avg)
  • FDs: 15/65536 (0.0%)

@g3co
g3co requested a review from TrueCarry March 25, 2026 09:28
Comment thread internal/middleware/recipient_ratelimit.go Outdated
Comment thread internal/config/config.go Outdated
Comment thread internal/config/config.go
@g3co
g3co requested a review from TrueCarry March 30, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants