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
6
votes
0 answers

Android TelephonyManager requestCellInfoUpdate returning stale data on API 29

I've been encountering a problem for some time using Android's TelephonyManager. We use the TelephonyManager for phone signal live surveying purposes but in an attempt to move up to targeting API 29 it has become a problem. On API 28 and under, we…
6
votes
0 answers

How to rate-limit parallel API requests in R/future/furrr

I have to retrieve a large dataset from a web API (NCBI entrez) that limits me to a certain number of requests per second, say 10 (the example code will limit you to three without an API key). I'm using furrr's future_* functions to parallelize the…
6
votes
1 answer

Client-side request rate-limiting

I'm designing a .NET client application for an external API. It's going to have two main responsibilities: Synchronization - making a batch of requests to API and saving responses to my database periodically. Client - a pass-through for requests to…
AstroPiotr
  • 127
  • 1
  • 2
  • 10
6
votes
3 answers

Active profile in SpringBootTest based on system variable

As the host of Redis is different in local and CI, my @Tests can pass locally, they can't pass in CI. Firstly, I tried to mock the RedisTemplate like this: RedisTemplate redisTemplate = mock(RedisTemplate.class); ValueOperations valueOperations =…
6
votes
1 answer

What is the correct client reaction to a HTTP 429 when the client is multi-threaded?

The HTTP status code 429 tells the client making the request to back off and retry the request after a period specified in the response's Retry-After header. In a single-threaded client, it is obvious that the thread getting the 429 should wait as…
Harald
  • 4,575
  • 5
  • 33
  • 72
6
votes
1 answer

Get last Twitter mention from API with Tweepy avoiding rate limit

I used to have some good working python that did auto-replies on the Tweepy stream listener, but due to changes in the Twitter API in August it no longer works. I am re-building it by getting my most recent mention every 10 seconds (ideally it'd be…
the_t_test_1
  • 1,193
  • 1
  • 12
  • 28
6
votes
2 answers

Nginx Rate Limiting count for a whole subnet, not just per IP

I have a defined zone in Nginx for limiting requests, it's plain straight forward as described in their documentation: limit_req_zone $binary_remote_addr zone=leash:10m rate=18r/s; So far so good. It works great with clients who act offensively, but…
Istvan Prosinger
  • 145
  • 2
  • 11
6
votes
1 answer

Laravel: different api rate limits for different paths

I need to setup different rate limits for different paths. Foe example: On path /users I want to have rate limit of 60 requests per minute, while for path /stats I want to have rate limit of only 5 requests per minute. I tried with next…
Sufi
  • 63
  • 1
  • 5
6
votes
3 answers

Node js Rate Limit

I am trying to set API rate limit on my app using express-rate-limit. It works if it is from the same IP address. I have an error message once it reaches a max of 5. However, it fails when it is tried from different IP address/computer. Any idea how…
Mihir Patel
  • 2,202
  • 3
  • 23
  • 36
6
votes
1 answer

Distributed rate limiting algorithm

I am working on a pricing platform on wich I have to implement a distributed rate limiting algorithm. I have k gateways that provide x services. Any gateway can provide any service (via a load balancer). A customer buy a number of call per second to…
Lambdacrash
  • 201
  • 2
  • 10
5
votes
2 answers

Limiting concurrency and rate for Python threads

Given a number threads I want to limit the rate of calls to the worker function to a rate of say one per second. My idea was to keep track of the last time a call was made across all threads and compare this to the current time in each thread. Then…
OG Dude
  • 936
  • 2
  • 12
  • 22
5
votes
2 answers

Go rate limit http.client via RoundTrip exceeds limit and produces fatal panic

My goal: is to set a rate limit of 600 requests per minute, which is reset at the next minute. My intend was to do this via the http.client setting a RoundTrip with a limit.wait(). So that I can set different limits for different http.clients() and…
Rien
  • 398
  • 2
  • 12
  • 37
5
votes
4 answers

Laravel Rate Limiter Limits Access Wrongly After Only One Attempt

I'm working with Laravel 5.8 and I wanted to set up a Rate Limiter that limits accessing to route by per minute and also IP address. So I added this to RouteServiceProvider.php: protected function configureRateLimiting() { …
Pouya
  • 114
  • 1
  • 8
  • 36
5
votes
2 answers

ExecutionContext with RateLimiter

Suppose I have an HTTP client to call a server with a request rate limit, e.g. 1000 requests/ sec. I implemented a rate limiter in ExecutionContext like this: Created a bounded blocking queue with RateLimiter of Guava class…
Michael
  • 41,026
  • 70
  • 193
  • 341
5
votes
3 answers

express-rate-limit blocking requests from all users

I'm using express-rate-limit npm package, I deployed my backend on AWS (t2 micro ec2 instance), while limiter is on, requests are blocked from ALL users who try to interact with my API, it works for a couple of minutes and stops for about 10…
Omar Zahir
  • 195
  • 1
  • 3
  • 14