Skip to content

Add a configurable endpoint rate-limiter - #1116

Open
Toastbrot236 wants to merge 23 commits into
LittleBigRefresh:mainfrom
Toastbrot236:rl-conf-1
Open

Add a configurable endpoint rate-limiter#1116
Toastbrot236 wants to merge 23 commits into
LittleBigRefresh:mainfrom
Toastbrot236:rl-conf-1

Conversation

@Toastbrot236

Copy link
Copy Markdown
Contributor

This ports Bunkum's RateLimiter and modifies it in a way where, instead of getting its bucket data from hard-coded constants, it instead gets the data from a config file named endpointRateLimits.json. This PR only implements and generally tests this rate-limiter, and only makes 3 endpoints use this new rate-limiter (for testing purposes), however, after this PR, I'd like to do follow-up PRs where I make all our endpoints use this new rate-limiter.

There are mainly 2 reasons why we want configurable rate-limits:

  • If our limits turn out to be too strict or too lenient somewhere again, instead of having to open a new PR and push a new release every time we want to change the constants, we would now only have to change the wanted values in the config and restart the server
  • Some instances might be able to handle more requests than others depending on their infrastructure, so instead of us having to decide constants for everyone, server owners would now be able to choose themselves how strict their rate-limits should be

Also, I'm not exactly sure how we'd want to handle migrations in the future where we want to update the default values of existing buckets. Should we just keep this one OverwriteBucketValuesIfDefaultsAreUpdated config flag, or should we have such a flag for every bucket separately?

@Toastbrot236 Toastbrot236 added the enhancement New feature or request label Aug 22, 2026
@Toastbrot236
Toastbrot236 requested a review from FeTetra August 23, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant