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

User-based Rate Limiting? #13

Closed
Manas73 opened this issue Jun 19, 2021 · 3 comments
Closed

User-based Rate Limiting? #13

Manas73 opened this issue Jun 19, 2021 · 3 comments

Comments

@Manas73
Copy link

Manas73 commented Jun 19, 2021

How do I enable different rates for each user? I know I can have a rate-limit for each user eg: 5 requests per 10 seconds. However, if I want each user to have their own rate limit eg:

  • user-1: 5 requests per 10 seconds.
  • user-2: 10 requests per 10 seconds.

How do I do achieve different rate limits per user/ip?

@Manas73
Copy link
Author

Manas73 commented Jun 20, 2021

I just edited the default Lua Script (will have to store each user's custom limit into Redis and access that as limit).

@Manas73 Manas73 closed this as completed Jun 20, 2021
@long2ice
Copy link
Owner

That's a way

@arthurio
Copy link

@Manas73 That seems like a good option and was thinking about using a similar approach, would you be able to share your solution by any chance?
Also @long2ice , I couldn't find anywhere the reasoning behind using a LUA script to access redis vs. just using python? Is it a performance concern since it seats in the frontline? Did you do any benchmarking?
Thank you both for your time!

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

No branches or pull requests

3 participants