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
17
votes
1 answer

How to rate-limit upload from docker container?

I need to prevent a long-running multiterabyte upload from eating all of my network's bandwidth, but I can only constrain its bandwidth usage on a process level (meaning that slowing down the whole machine's network interface or slowing down this…
17
votes
5 answers

Throttle JavaScript function calls, but with queuing (don't discard calls)

How can a function rate-limit its calls? The calls should not be discarded if too frequent, but rather be queued up and spaced out in time, X milliseconds apart. I've looked at throttle and debounce, but they discard calls instead of queuing them up…
Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404
17
votes
2 answers

Paging on Google Places API returns status INVALID_REQUEST

I'm using the Google Place API for place search: https://developers.google.com/places/documentation/search After the first query of the api, I'm getting the next page by setting the pagetoken. If I wait 2 seconds between requests, it works, but I…
Tom Kincaid
  • 4,887
  • 6
  • 47
  • 72
17
votes
6 answers

How to implement rate limiting based on a client token in Spring?

I am developing a simple REST API using Spring 3 + Spring MVC. Authentication will be done through OAuth 2.0 or basic auth with a client token using Spring Security. This is still under debate. All connections will be forced through an SSL…
aj.esler
  • 921
  • 1
  • 8
  • 18
16
votes
0 answers

Rate Limiting an API based on public IP addresses

I was studying the Github API and came across the following in their Rate Limiting section For unauthenticated requests, the rate limit allows for up to 60 requests per hour. Unauthenticated requests are associated with the originating IP address,…
macalaca
  • 988
  • 1
  • 13
  • 31
16
votes
4 answers

Nginx: In which order rate limiting and caching are executed?

I want to use nginx for rate limiting and caching. In which order nginx applies them? In other words, is it limiting only request to the upstream server or all requests (including cache HIT's)? How can this order be changed? I think it can be…
Anton
  • 442
  • 4
  • 19
16
votes
6 answers

Guava’s RateLimiter per minutes instead of seconds?

I'm trying to rate-limit the the number of accounts a user can create with my REST API. I would have liked to use Guava's RateLimiter to only allow an IP to create, let's say, 5 accounts within 10 minutes, but the RateLimiter.create method only…
Johny19
  • 5,364
  • 14
  • 61
  • 99
15
votes
1 answer

Rate Limiting based on URL and Path in Kubernetes

I need to implement Rate Limiting (based on URL and path) on applications deployed on Kubernetes Cluster (EKS). I'm looking for a managed way that involves least scripting and does provide an interface through which to manage rate limits for…
Talha Tariq
  • 151
  • 1
  • 1
  • 3
15
votes
1 answer

How rate limit works in twitter in search API

I want to user Search API for twitter using 1.1 version. There is a limit for 450 request per applications. But I have a doubt in this rate limiting. I thought that it means we can make 450 request in every 15 mins of request window. But I read(but…
keen
  • 3,001
  • 4
  • 34
  • 59
14
votes
5 answers

Facebook Application Rate Limit #4 - June 2018 Bug

Facebook seems to be experiencing a bug in regards to their rate-limits. The bug has been open for several days at the time of writing. I'm sure everyone is aware that this affects the client base of these developers severely. The requests limit…
Riaan van Zyl
  • 538
  • 8
  • 17
14
votes
3 answers

How can I queue up and delay retrofit requests to avoid hitting an api rate limit?

I'm using an api that implements throttling. One of the limits is 1 request/second. ugh. I have the following scenario which hits the limit right away. Check the status of the api with api/status if the api is up, get a users subscriptions load a…
Tyler Pfaff
  • 4,900
  • 9
  • 47
  • 62
14
votes
2 answers

Does nginx HttpLimitReqModule support per hour/day/week?

I seek a solution to do rate limit for HTTP API, for Nginx, there is already a module HttpLimitReqModule support this feature. But refer to the document, this module only supports per second and per minute. Any solution per hour/day?
linbo
  • 2,393
  • 3
  • 22
  • 45
13
votes
2 answers

Unable to resolve service for type 'AspNetCoreRateLimit.IProcessingStrategy' while attempting to activate 'AspNetCoreRateLimit.IpRateLimitMiddleware'

I have used the package AspNetCoreRateLimit Version="4.0.1" and I get the following exception: Unable to resolve service for type 'AspNetCoreRateLimit.IProcessingStrategy' while attempting to activate 'AspNetCoreRateLimit.IpRateLimitMiddleware' but…
13
votes
1 answer

Rate-limiting python decorator

I found this rate-limiting python decorator based on redis classes. How can I write a similar decorator that uses only what's available in the standard library that can be used as follows? def ratelimit(limit, every): # python magic…
enrico.bacis
  • 30,497
  • 10
  • 86
  • 115
12
votes
5 answers

Ratelimit in Fastapi

How to ratelimit API endpoint request in Fastapi application ? I need to ratelimit API call 5 request per second per user and exceeding that limit blocks that particular user for 60 seconds. In main.py def get_application() -> FastAPI: …
Himal Acharya
  • 836
  • 4
  • 14
  • 24
1
2
3
70 71