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

How to rate limit API calls? #18

Open
satyavh opened this issue Mar 10, 2015 · 3 comments
Open

How to rate limit API calls? #18

satyavh opened this issue Mar 10, 2015 · 3 comments

Comments

@satyavh
Copy link

satyavh commented Mar 10, 2015

Is there a way to rate limit API calls? I couldn't find a build-in method, so how would you suggest to solve this?

@kahmali
Copy link
Owner

kahmali commented Mar 10, 2015

I have thought about this for my own API, too. Currently there is no feature in Restivus to assist with making this DRY. You would have to place some sort of function in each of your manually overridden endpoints. Terrible. The only planned feature I have now that would help with this is the hooks that run before each endpoint is executed. You would still have to write the function yourself to make the rate limit check, but at least you would only have to add it once for all endpoints. This is actually a super simple feature to add that will greatly improve the flexibility of Restivus, so this feature will become the top priority, as soon as I add a few more tests. I've moved it to the top of the roadmap. I will keep you posted on any progress here.

@xanatas
Copy link

xanatas commented Apr 15, 2015

Normally i would advise to rate limit with Nginx and HAprox to catch some DOS attakcs/abuses.

@kahmali
Copy link
Owner

kahmali commented Apr 15, 2015

That's a great suggestion @xanatas! I was unaware that this could be done at the nginx level. Here's a good article on it: https://lincolnloop.com/blog/rate-limiting-nginx/. Seems like a very effective method for rate limiting.

Thank you so much for passing that information along!

This was referenced Apr 28, 2015
@kahmali kahmali mentioned this issue May 2, 2015
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants