Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle rate limiting with leaky bucket instead of only backoff #320

Open
oyarsa opened this issue Jan 15, 2025 · 0 comments
Open

Handle rate limiting with leaky bucket instead of only backoff #320

oyarsa opened this issue Jan 15, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@oyarsa
Copy link

oyarsa commented Jan 15, 2025

If I understand the code correctly, the current mechanism used for dealing with rate limits relies on exponential backoff to try again until it succeeds or it runs out of time.

This works for a small number of requests, but when running lots of them all at once (I'm talking about thousands in a batch), this doesn't work very well. What I found to be useful is using a leaky bucket–based rate limiter for both requests per minute and tokens per minute, which handles this better. The Python package openlimit implements this.

@64bit 64bit added the enhancement New feature or request label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants