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

EPIC: Strava rate limits (Cross-project) #7

Open
obscurerichard opened this issue Dec 31, 2024 · 0 comments
Open

EPIC: Strava rate limits (Cross-project) #7

obscurerichard opened this issue Dec 31, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@obscurerichard
Copy link
Member

obscurerichard commented Dec 31, 2024

After hitting rate limit problems with freezing-sync yet again, and patching it up in a hacky way, see freezingsaddles/freezing-sync#69 and https://github.com/freezingsaddles/freezing-sync/blob/7dd8d5286e09b62c50ecae2be7c2f5e36af44607/freezing/sync/subscribe.py#L108-L109 - it's clear that we need a better solution. This has caused problems for years going back to 2016.

Towards a comprehensive solution for enforcing cross-component rate limits

While stravalib has multiple options for rate limiting built in, its implementation assumptions with the built in throttle classes are that it the throttling is done per Client, except maybe with the Sleep rate limiter that I have not tested - and given that each athlete's connection to Strava requires constructing a new Client object, and multiple Clients from different processes (freezing-nq, freezing-sync, and freezing-web) all have to cooperate, using a distributed rate limiting scheme such as a token bucket filter in conjunction with Redis or its open-source fork Valkey is likely in order.

It may even be possible to put a custom rate limiter class directly into the stravalib client constructor to handle this really smoothly.

References

@obscurerichard obscurerichard added the enhancement New feature or request label Dec 31, 2024
@obscurerichard obscurerichard changed the title EPIC: Comprehensive solution for rate limiting across components EPIC: Strava rate limits (Cross-project) Jan 5, 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
Status: To do
Development

No branches or pull requests

1 participant