Questions tagged [rate-limiting]

In computer networks, 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).

240 questions
6
votes
2 answers

How soon does nginx's token bucket replenish when limiting at requests per minute?

We've decided that we want to experiment and limit requests per minute instead of requests per second on our sites. However, I am confused by the burst parameter in this context. I am under the impression that when you use the 'nodelay' flag, the…
Michael Gorsuch
  • 2,358
  • 1
  • 21
  • 24
6
votes
2 answers

Apache2: Limit simultaneous requests & throttle bandwidth per IP/client?

I want to limit simultaneous requests & throttle bandwidth per IP/Client on a single apache vhost. In other words, I want to ensure that this site, which hosts large media files, doesn't get hammered by someone trying to download everything all at…
xentek
  • 351
  • 1
  • 2
  • 7
5
votes
2 answers

Is there a way to rate limit connections with HAProxy using multiple thresholds

I've implemented simple rate limiting using HaProxy in a similar fashion to the way StackExchange does it with HaProxy. I'm trying to make it a bit more advanced so that there are multiple thresholds of rate limiting. For example, limit clients that…
palehorse
  • 4,179
  • 5
  • 28
  • 27
5
votes
2 answers

Nginx: How to limit request rate based on user agent

Trying to get the following behavior working in nginx A default rate limit of 1r/s for each ip when using a browser. A rate limit of 10r/s for bing and google spiders. Reject bad bots. Unfortunately google doesn't publish ip addresses for googlebot…
Ali W
  • 277
  • 1
  • 4
  • 7
5
votes
2 answers

How to rate limit outgoing SMTP connections for Postfix

I have a postfix instance running on a VM. The VM provider shuts us down if we exceed a threshold of SMTP connections per minute - something like 10. In a typical day we might send 1000 messages, so 10 is fine. However it is a mailman server so…
Russell Stuart
  • 444
  • 1
  • 4
  • 7
5
votes
1 answer

nginx 301'ing limit_req rate limited requests instead of error page

I have a bulk search form on apache servers behind nginx. I'd like to protect that location so that the second request in a 10 minute period gets 301'd to a "Would you like to use our API" page instead with something like: http { limit_req_zone…
mogmismo
  • 53
  • 1
  • 3
5
votes
1 answer

VLAN based rate limiting using tc

I have been trying to perform VLAN based rate limiting on an academic project I am working on. The project uses Openflow (with Beacon controller) and the network is emulated using Mininet. The network is made up of OpenVSwitches. For my project I…
user1449265
  • 151
  • 1
  • 2
5
votes
1 answer

Mysterious bandwidth limit

For some unknown reason, our server box running Windows Server 2008 R2 has a per connection bandwidth limit of 0.2 MB/s. Meaning, while one TCP connection can pull at max 0.2 MB/s, 60 parallel connections can pull 12 MB/s. We first noticed this when…
5
votes
1 answer

postfix rate limiting

I did add a new slow transport to my Postfix configuration but this doesn't looks to work. Messages pass correctly in the slow transport but they aren't rate-limited. Currently, I've been setting this up in my master.cf: slow unix - - …
4
votes
2 answers

Throttle outgoing mail by domain in exim

I am using exim to deliver mail generated by a web app. The gmx.net, gmx.de and web.de domains are asking me to throttle the amount of mail I send but I have trouble in getting that configured in exim. The scenario goes like this: my web app…
Lucas
  • 173
  • 8
4
votes
1 answer

Nginx rate limiting, using multiple rate rules

Using nginx rate limiting, using this rule as an example: limit_req_zone $request_limiting_zone_key zone=request_limiting_search:20m rate=30r/m; This will set 30 requests per minute. However what if I wanted to stack a second rule, so the logic is…
emmdee
  • 1,935
  • 9
  • 35
  • 56
4
votes
1 answer

Nginx: Limit request based on response status code

I'm trying to limit requests with nginx based on response status code. I'd like to slow down requests with too many 4xx or 5xx responses. I have this code block in my config file: map $status $bad_guy { ~^[23] ""; default…
Viet Pham
  • 41
  • 3
4
votes
2 answers

How to limit TCP connections with nginx for HTTP/2?

I want to use nginx as a https frontend and I'm looking for a way to limit TCP connections. These limits should be based on the remote IP addresses and work for HTTP/1.1 as well as HTTP 2. For HTTP/1.1 I thought I would be fine around 15 concurrent…
Brutus
  • 171
  • 1
  • 8
4
votes
1 answer

What rate limiting options are provided by ISC BIND?

This is a Canonical Question about rate limiting in the ISC BIND nameserver software. Recently I've heard of BIND's rate limiting features. DNS RRL in particular seems to be becoming more commonplace. I'm a little bit confused. Some of the…
Andrew B
  • 31,858
  • 12
  • 90
  • 128
4
votes
1 answer

Common back pressure strategies for services under sustained high load

I'm wondering what are the common backpressure strategies people use for their web services? Imagine your service operates under heavy load, and at some point the load reaches 120% of your capacity. How do you deal with this? The most sound…
sergey
  • 41
  • 1
  • 3
1
2
3
15 16