-
Notifications
You must be signed in to change notification settings - Fork 93
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
Include backoff period for a given rule #52
Comments
Since this hasn't get any attention, we will close this, fork it and implement on our own. |
@Brunomachadob FYI we implemented the backoff/blackout period by using another rate limiter specifically for that, such that when they go over limit on the main limiter, we increment the count for that key in the blackout limiter, which has a limit of 1. No library code changes needed, and you can package that up as desired in your local code library. |
Hey @ctoomey, yeah this is also an option and we considered it. But we would like to try to embed this into the Lua script used on Redis, as you can see on the linked PR I've opened. We will use that approach to have it everything within a single place and a single round trip to Redis. |
Hey!
We have been using the library for a while (with redis) and we would like to complement it with a backoff period on top of the sliding window algorithm. We believe this would be a nice improvement on it by giving an extra punishment to whoever is misusing our systems.
"Tokens" will be used and added back like we are used to in a sliding window algorithm, but the change is:
We could probably achieve that by populating the cache of a given key like
time:precision:bo
with the expiry of the backoff period for example, and simply return1
early in the algorithmThis would be a backwards compatible change, probably on the
RequestLimitRule
adding the possibility to have the backoff only to the rules that configured it.Do you find this interesting and would be willing to have it on the library? I can work on it and open the necessary PRs.
In case you agree, feel free to point me to any directions you may think it would be the best.
The text was updated successfully, but these errors were encountered: