-
Notifications
You must be signed in to change notification settings - Fork 6
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
ratelimit ability to not count ratelimited requests for specific descriptors #10613
Comments
@sam-heilbron @nfuden updated diagram. Thanks @huzlak |
Whats the use case for not being able to define both the rate limits in the same config? https://docs.solo.io/gloo-edge/latest/guides/security/rate_limiting/set/#rule-priority |
With regular setup in one config if first(integrator) rule matches, the other(organization) rule counter is not incremented. It should be incremented, but only for the requests that were not ratelimited by integrator's limit as these should count in whole organization limit because requests to upstream happened. The ones ratelimited by integrator limit should not be counted as they were ratelimited already and did not go to the upstream. If we would apply alwaysApply then the organization rule would be always applied even if the first was too and also for ratelimited requests. Customer needs a way to not count requests ratelimited by integrator config. As all the headers come from extauth stage, they can not split into early and regular ratelimitconfigs. Adding example test results for better clarification:
With AlwaysApply:
Used ratelimit config:
Desired behavior:
|
So, if we look at the application policy for RL, we currently have "alwaysApply=true" and "alwaysApply=false". Now, say we have RL1 and RL2 in one config (pseudo code):
The current behaviour is that either 1 rule is applied (alwaysApply=false) where the integrators are only rate-limited per integrator, and never as a group of integrators belonging to the same organization. Here every integrator has its own RL1 bucket. So that means, even if you want to rate limit on organization, every integrator will always be able to do 5 requests per minute, even if they, as a group, should be blocked at 10. And the other option (alwaysApply=true) means that both rules always apply. And that means that a request will always be counted in both buckets, RL1 and RL2, even if RL1 has already rate-limited the request. So, if Integrator-1 starts sending hundreds of requests per second, they will be counted in both in Integrator-1's own RL1 bucket, but ALSO in the RL2 bucket for the organization. And this means that all of the other Integrators will be blocked as well by RL2. So as I see it, the ask is to add an additional mode, say Something like this:
You could argue that it would make sense to introduce something like a |
Do we forsee the applyIfNotRateLimited use case ever being extended to a larger nested tree? For example we say we have a place where you have the following rate limits
For example
|
Zendesk ticket #4472 has been linked to this issue. |
Zendesk ticket #4932 has been linked to this issue. |
@akhilaj Sorry for the slow response here it is my understanding that this is being picked up by solo now |
Migrated from OSS kgateway-dev#8699
Gloo Edge Product
Enterprise
Gloo Edge Version
v1.14.7
Is your feature request related to a problem? Please describe.
Customer would like to define 2 levels of ratelimits, first based on org and package, the second based on org and integrator. For example limit of 5 requests/min for Integrator and 10 requests/min for Org. Currently if Integrator1 does 8 requests he gets 429 after request 5 for the last 3 requests. If in the same minute Integrator 2 tries to do 5 requests he starts getting 429 after 2 requests as also the ratelimited requests are counted for the package level ratelimit.
Example ratelimitconfigs:
Describe the solution you'd like
A flag for specific descriptor that would tell that requests ratelimited based on this descriptor should not increase any counters.
Describe alternatives you've considered
Using envoy ratelimit API instead of the set-style with nested descriptors and weight on the integrator descriptor:
This does not server the purpose as any number of integrators can do 5 requests regardless of their package as only counter for the descriptor with non-zero weight is increased.
Additional Context
No response
The text was updated successfully, but these errors were encountered: