Skip to content

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

@oyarsa

Description

@oyarsa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions