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
12
votes
2 answers

NGINX rate limitting by decoded values from JWT token

I have a question regarding NGINX rate limiting. Is it possible to do rate limiting based on the decoded value of JWT token? I cannot find any information like this in the docs. Or even if there is a way of doing rate limiting by creating pure…
Marcin Majewski
  • 1,007
  • 1
  • 15
  • 30
12
votes
2 answers

Discord webhook rate limits

I'm working on a private browser extension which extracts some information from a web page and posts it into a Discord channel via a webhook. The browser extension does evaluate the x-ratelimit-... response headers to observe the rate limit…
Mario Werner
  • 1,771
  • 14
  • 24
12
votes
3 answers

AWS WAF How to rate limit path by IP below the minimum of 2000 requests/minute

I have a path (mysite.com/myapiendpoint for sake of example) that is both resource intensive to service, and very prone to bot abuse. I need to rate limit access to that specific path to something like 10 requests per minute per client IP address.…
user5071535
  • 1,312
  • 8
  • 25
  • 42
12
votes
4 answers

How to limit web services usage in Java application?

Suppose I have a Java server application, which implements a few web services. Suppose also, I can authenticate application users. Now I would like to add some limits per user to the service usage: e.g. rate limit (requests per second), maximum…
Michael
  • 41,026
  • 70
  • 193
  • 341
11
votes
2 answers

Rate limiting REST requests on Heroku

To avoid abuse I'd like to add rate limiting to the REST API in our Rails application. After doing a bit of research into this it looks like the best practice is to move this responsibility into the web server rather than checking for this in the…
xoebus
  • 812
  • 7
  • 18
11
votes
1 answer

Express-rate-limit vs NGINX in a node server

I'm currently using express-rate-limit module to block multiple requests from the same ip or logged in user account in my node server, and this is working pretty good against DoS attacks. This server is a small local business that requires only one…
Felipe Micali
  • 827
  • 1
  • 11
  • 25
11
votes
4 answers

Limit number of events per time period

I need to cap the number of events n permitted during a time period deltaT. Any approach I can think of, space is O(m), where m is the maximum number of eventrequests sent per deltaT, or O(deltaT/r), where r is an acceptable resolution. Edit: deltaT…
Martin
  • 2,956
  • 7
  • 30
  • 59
10
votes
2 answers

rate-limiting a function call in rails per user

Anyone have any idea how I might go about this? Having a pretty hard time finding information online. Best I found is the curbit it gem but I can only think of how to implement that application-wise.
Chris Bolton
  • 2,878
  • 6
  • 38
  • 57
10
votes
3 answers

Rate limiting requests and Amazon SQS

I have a question about how to slow down my api requests. For a particular third party API I am hitting allows me to make 3 requests every 2 seconds. If I go over that number I am returned status code 429 along with a wait time in milliseconds.…
AIntel
  • 1,087
  • 5
  • 14
  • 27
10
votes
3 answers

Go: Passing functions through channels

I'm trying to rate limit the functions that I call by placing them through a queue to be accessed later. Below I have a slice of requests that I have created, and the requestHandler function processes each request at a certain rate. I want it to…
tyuo9980
  • 581
  • 5
  • 14
10
votes
2 answers

Celery: Rate limit on tasks with the same parameters

I am looking for a way to restrict when a function is called, but only when the input parameters are different, that is: @app.task(rate_limit="60/s") def api_call(user): do_the_api_call() for i in range(0,100): api_call("antoine") …
Antoine Brunel
  • 1,065
  • 2
  • 14
  • 30
10
votes
4 answers

What's a good way to enforce a single rate limit on multiple machines?

I have a web service with a load balancer that maps requests to multiple machines. Each of these requests end up sending a http call to an external API, and for that reason I would like to rate limit the number of requests I send to the external…
Popcorn
  • 5,188
  • 12
  • 54
  • 87
9
votes
3 answers

How to set the rate limiter for per second in Laravel version 8

How to set the rate limiter per second in Laravel 8. I need to set the rate limiter per second instead of per minute. Rate Limiter (Laravel 8) - https://laravel.com/docs/8.x/routing#rate-limiting Right now I'm able to use Laravel's rate limiter for…
Mahe Krish
  • 141
  • 1
  • 7
9
votes
2 answers

Token bucket vs Fixed window (Traffic Burst)

I was comparing Token bucket and Fixed window rate limiting algorithm, But a bit confused with traffic bursts in both algorithm. Let's say i want to limit traffic to 10 requests/minute. In Token bucket, tokens are added at the rate of 10 tokens per…
Vip
  • 1,448
  • 2
  • 17
  • 20
9
votes
1 answer

Debugging istio rate limiting handler

I'm trying to apply rate limiting on some of our internal services (inside the mesh). I used the example from the docs and generated redis rate limiting configurations that include a (redis) handler, quota instance, quota spec, quota spec binding…
Reut Sharabani
  • 30,449
  • 6
  • 70
  • 88
1 2
3
70 71