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

Limit to X requests/sec PER CUSTOMER using LocalRateLimit #23351

Open
skbergam opened this issue Oct 3, 2022 · 9 comments · May be fixed by #36623
Open

Limit to X requests/sec PER CUSTOMER using LocalRateLimit #23351

skbergam opened this issue Oct 3, 2022 · 9 comments · May be fixed by #36623
Assignees

Comments

@skbergam
Copy link

skbergam commented Oct 3, 2022

Title: Limit to X requests/sec PER CUSTOMER using LocalRateLimit

Description:

I have a few thousand customers calling my API. I want to limit them (with 429s) to 10 requests/sec each. On each HTTP request I have a "X-Customer-ID" header to uniquely identify them (and it has to match the auth token so I can trust the values in the "X-Customer-ID" header). I understand that with "RateLimit" configs you can specify a rate limit criteria like "CustomerID=*" which would effectively give each customer their own limit, but you also have to deploy the RateLimitService which uses Redis to make it work. I would prefer to not have to worry about a Redis cluster, so I was thinking of using the "LocalRateLimit" instead but it looks like it would only work for pre-specified values of CustomerID, i.e. I couldn't have a blanket limit to apply to all customers, I would have to specify a limit for every single customer.

Can we add support to the LocalRateLimit feature for specifying a blanket limit for each customer in this way? In my case, I can trust round robin load balancing to evenly distribute, so I'm fine just dividing my limit by the number of nodes and calling it good.

@skbergam skbergam added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Oct 3, 2022
@ggreenway ggreenway added area/ratelimit and removed triage Issue requires triage labels Oct 3, 2022
@ggreenway
Copy link
Contributor

cc @mattklein123 @wbpcode

@kyessenov
Copy link
Contributor

This is an often-requested feature for local rate limiting, an ability to specify a "wildcard" bucket instead of "literal" values, e.g. #19895.

@mattklein123 mattklein123 added help wanted Needs help! and removed enhancement Feature requests. Not bugs or questions. labels Oct 5, 2022
@vikaschoudhary16
Copy link
Contributor

I would like to work on it.

@skbergam
Copy link
Author

skbergam commented Oct 7, 2022

@vikaschoudhary16 I'm interested as well. Is the LocalRateLimit extension written in C++? Do you have a link to the source?

I'd be happy to collaborate.

@vikaschoudhary16
Copy link
Contributor

@vikaschoudhary16 I'm interested as well. Is the LocalRateLimit extension written in C++? Do you have a link to the source?

I'd be happy to collaborate.

sure. Not able to find you on envoy slack channel. What is your slack id?

@skbergam
Copy link
Author

skbergam commented Oct 7, 2022

Can you invite me? Last time I tried I couldn't find it. @sean Bergam

@therealaditigupta
Copy link

Interested in learning about the progress made on this feature. Would be really valuable to my use case!

@vikaschoudhary16
Copy link
Contributor

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants