Questions tagged [rate-limiting]

Rate limiting is used to control the rate of traffic sent or received on a network interface.

Traffic that is less than or equal to the specified rate is sent, whereas traffic that exceeds the rate is dropped or delayed. Rate limiting is performed by policing (discarding excess packets), queuing (delaying packets in transit) or congestion control (manipulating the protocol’s congestion mechanism). Policing and queuing can be applied to any network protocol. Congestion control can only be applied to protocols with congestion control mechanisms, such as the transmission control protocol (TCP).

1053 questions
98
votes
2 answers

Examples of HTTP API Rate Limiting HTTP Response headers

One of the Additional HTTP Status Codes (RFC6585) is 429 Too Many Requests Where can I find examples of HTTP / REST API Rate-Limiting HTTP response headers useful with this HTTP response status?
M8R-1jmw5r
  • 4,896
  • 2
  • 18
  • 26
59
votes
5 answers

How To Rate-Limit An API

What is the best way to limit requests for an API? Basically, we want to limit users to 360 API requests an hour (a request every 10 seconds). What comes to mind is tracking every API request and storing: ip-address hourly-requests …
Justin
  • 42,716
  • 77
  • 201
  • 296
47
votes
4 answers

Firebase rate limiting in security rules?

I launched my first open repository project, EphChat, and people promptly started flooding it with requests. Does Firebase have a way to rate limit requests in the security rules? I assume there's a way to do it using the time of the request and…
31
votes
6 answers

What is the best way to implement a rate-limiting algorithm for web requests?

Possible/partial duplicates: What’s a good rate limiting algorithm? Throttling method calls to M requests in N seconds Best way to implement request throttling in ASP.NET MVC? I am looking for the best way to implement a moving time window rate…
Lamar
  • 9,769
  • 4
  • 30
  • 18
28
votes
5 answers

Limiting/throttling the rate of HTTP requests in GRequests

I'm writing a small script in Python 2.7.3 with GRequests and lxml that will allow me to gather some collectible card prices from various websites and compare them. Problem is one of the websites limits the number of requests and sends back HTTP…
Bartłomiej Siwek
  • 1,447
  • 2
  • 17
  • 26
27
votes
3 answers

AWS Lambda TooManyRequestsException: Rate Exceeded

When attempting to execute an Amazon Web Services (AWS) Lambda function (many times) we were seeing the error: AWS Lambda TooManyRequestsException: Rate Exceeded How do we resolve this?
nelsonic
  • 31,111
  • 21
  • 89
  • 120
25
votes
7 answers

How to limit rate of requests to web services in Python?

I'm working on a Python library that interfaces with a web service API. Like many web services I've encountered, this one requests limiting the rate of requests. I would like to provide an optional parameter, limit, to the class instantiation that,…
gotgenes
  • 38,661
  • 28
  • 100
  • 128
25
votes
11 answers

How to implement rate limiting using Redis

I use INCR and EXPIRE to implement rate limiting, e.g., 5 requests per minute: if EXISTS counter count = INCR counter else EXPIRE counter 60 count = INCR counter if count > 5 print "Exceeded the limit" However, 5 requests can…
luin
  • 2,077
  • 2
  • 20
  • 23
24
votes
1 answer

Rate limit in nginx based on http header

Maybe I am asking a poor question but I want to apply rate limit in nginx based on custom http header rather than IP based. My IP based configuration is working but I am not able to get around using custom http header. What I want is that if a…
Pulkit
  • 3,953
  • 6
  • 31
  • 55
23
votes
3 answers

How can I rate limit network traffic on a docker container

I want to setup a docker container for a peer 2 peer app. This app doesn't have app level rate limiting so I'm attempting to set a limit at the container level. I would like to rate limit outgoing and incoming connections on all ports but the one…
Myers Carpenter
  • 939
  • 1
  • 9
  • 12
20
votes
3 answers

How do I implement rate limiting in an ASP.NET MVC site?

I'm building an ASP.NET MVC site where I want to limit how often authenticated users can use some functions of the site. Although I understand how rate-limiting works fundamentally, I can't visualize how to implement it programatically without…
Maxim Zaslavsky
  • 17,787
  • 30
  • 107
  • 173
19
votes
6 answers

Python API Rate Limiting - How to Limit API Calls Globally

I'm trying to restrict the API calls in my code. I already found a nice python library ratelimiter==1.0.2.post0 https://pypi.python.org/pypi/ratelimiter However, this library can only limit the rate in local scope. i.e) in function and loops #…
gyoho
  • 799
  • 2
  • 9
  • 25
19
votes
5 answers

How to implement distributed rate limiter?

Let's say, I have P processes running some business logic on N physical machines. These processes call some web service S, say. I want to ensure that not more than X calls are made to the service S per second by all the P processes combined. How can…
18
votes
2 answers

Rate limiting for Google/Firebase cloud functions?

I am using Firebase to develop an app that uses Cloud Functions as a REST API internally. My question is, is there an easy way to implement per-IP/per-user rate-limiting similar to what slack uses, except on a per-IP and per-user basis, rather than…
18
votes
3 answers

iTunes Search API rate limit

Am planning to use iTunes Search API to get App related information - http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html Wanted to know if there is any pre-defined Rate/Throttle Limit on the API…
Vivek Kondur
  • 181
  • 1
  • 1
  • 4
1
2 3
70 71