Skip to content

Replace interval rate limiter with token bucket algorithm#8

Merged
gnurizen merged 1 commit intomainfrom
rolling-limit
Jan 26, 2026
Merged

Replace interval rate limiter with token bucket algorithm#8
gnurizen merged 1 commit intomainfrom
rolling-limit

Conversation

@gnurizen
Copy link
Contributor

Summary

  • Replace simple 500μs interval-based rate limiter with a token bucket algorithm
  • Allow N samples per second (default: 100) using a rolling window approach
  • Make rate limit configurable via PARCAGPU_RATE_LIMIT environment variable
  • Remove PARCAGPU_LIMITER_DISABLE (use high rate limit value instead)
  • Remove special case for graph launches (all calls rate limited uniformly)

Test plan

  • Build and verify library compiles for both architectures
  • Test with PARCAGPU_DEBUG=1 to verify rate limiting behavior
  • Test with different PARCAGPU_RATE_LIMIT values

🤖 Generated with Claude Code

Replace simple interval-based rate limiter with a token bucket algorithm
that allows N samples per second. Configurable via PARCAGPU_RATE_LIMIT
environment variable (default: 200 samples/sec).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gnurizen gnurizen requested review from brancz and umanwizard January 26, 2026 21:59
@gnurizen gnurizen merged commit 1f208d4 into main Jan 26, 2026
3 checks passed
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