Questions tagged [rate-limiting]

In computer networks, rate limiting is used to control the rate of traffic sent or received on a network interface.

Filter by
Sorted by
Tagged with
1 vote
1 answer
2k views

NGINX not evaluating variables?

I have a following nginx config: http { (...) limit_conn_zone $binary_remote_addr zone=limitapinoauth:16m; limit_conn_zone $remote_user zone=limitapi:32m; map $remote_user $zone { default '...
forkie's user avatar
  • 131
3 votes
0 answers
2k views

How to configure per IP bandwidth control using TC?

Requirements: There is an arbitrary number of users per group. Bandwidth for any particular group is 1000kbps. Bandwidth for each user in a group is 70 kbps. At any time no user should not consume ...
techiek7's user avatar
1 vote
2 answers
3k views

Nginx throttle download speed based on filesize

I am using nginx/1.11.11 compiled from the source with the mp4 module and I am serving video files from 300MB size up to 8GB. I am thinking of implementing a throttle system similar to google's drive....
Allkin's user avatar
  • 111
1 vote
1 answer
1k views

Docker IOPS and Read/Write limitations not being applied

I used following command to test if the IOPS and Disk read/write limitations are being applied or not, but they are not. as soon as i run command, the disk uses 100% of IO and bandwidth. thought, i ...
Farhan's user avatar
  • 4,309
0 votes
1 answer
107 views

Are the following two iptables rules equivalent?

There are articles such as this which suggest something of the form of these iptables rules to block too many SSH connections made in a short time: -I INPUT -p tcp --dport 22 -i eth0 -m state --state ...
user avatar
2 votes
1 answer
913 views

Rate-limit nginx based on a prior request

It's not a problem, but I get a huge number of vulnerability scanners and script kiddies hitting my site, constantly. My site doesn't run WordPress, but it gets constantly scanned for WordPress ...
arrtchiu's user avatar
  • 121
2 votes
1 answer
2k views

How can I rate-limit requests sent by bots for a Nginx server?

There are many bots out there. Majestic bot is one of them. It sometimes crawls the website's pages by force, i.e. the server sometimes sends 100 requests during 1 second. Majestic bot is just an ...
Siah's user avatar
  • 123
0 votes
3 answers
5k views

Postfix: limit INCOMING rate

I have a Postfix 2.11 server listed as an MX-server for a wildcard domain, *.domain.com I need to limit the incoming rate per particular subdomain/destination address. So if someone starts sending ...
serge's user avatar
  • 123
0 votes
1 answer
2k views

Why I can't limit bandwidth with tc command

I want to limit bandwidth for interface eth1, I read command in this link. sudo tc qdisc add dev eth1 root handle 1:0 htb default 10 sudo tc class add dev eth1 parent 1:0 classid 1:10 htb rate ...
You're awesome's user avatar
2 votes
1 answer
2k views

How to limit the maximum network speed in the whole Virtual Host?

Background I have a Apache (with NginX Reverse Proxy) as web server. I have a forum and a image host service running. But as you know, image host service causes a lot of network bandwidth (Mbps). I ...
AkiEru's user avatar
  • 77
0 votes
1 answer
887 views

exim variable for domain

So i've been reading a lot about exim, however there are some variables which are showing an empty string on my server and therefore they are not working with my rate limit conditions. For instance I ...
MiguelR's user avatar
0 votes
1 answer
2k views

Download rate or Data Limitation on Mikrotik hotspot don't apply on users

I wonder to know has anyone had a problem of limitation on user in hotspot. (RB3011 - even tested on RB951G) After I config the hotspot and give permission to users based on the username and password ...
Mohammad Yousefi's user avatar
6 votes
1 answer
9k views

HAProxy rate limiting - ban abuser for 30 minutes

I have the following config, that works OK for rate limiting connections. If an abuser is authenticated and he also accesses the defined regex location more than 30 times per minute, rate limiting is ...
Tony's user avatar
  • 268
0 votes
0 answers
163 views

Gradual throttling total bandwidth

I have a server with a 30TB traffic allowance hosting (mostly) history images and would like to throttle one particular directory (the download image sizes) when necessary to avoid going over the ...
chx's user avatar
  • 1,705
1 vote
1 answer
964 views

Throttle incoming connections with iptables

I have a slightly self-inflicted DoS happening in some circumstances, and I'm trying to figure out if I can use iptables to help mitigate it. The short version is "How can I limit the rate of incoming ...
dsl101's user avatar
  • 433
4 votes
2 answers
24k views

Postfix limit total sent per hour

I'm not after services that could provide me with fancy fine-grained control like policyd, I don't need per user/domain control, I only want to: limit maximim number of emails that could be sent ...
Miloš Đakonović's user avatar
0 votes
1 answer
581 views

Simultaneous outgoing connections limit with iptables not working

I run a website that technically acts as a proxy to another website (I make HTTP requests to it), and I needed to make sure not too many simultaneous connections were made, I thus limited it to 29 ...
Alexandre Dieulot's user avatar
1 vote
2 answers
8k views

Rate Limit VLAN interface | Cisco Nexus

How to do QoS in cisco nexus for Rate limit. In cisco Routers , we will be creating a policy map and calling it in service_policy in VLAN Interface Ex: Policy-map Policy_2Mbps class class-default ...
user3162395's user avatar
4 votes
1 answer
18k views

How to do traffic shaping (rate limiting) with TC per OpenVPN client

This question is related to another question with a great answer and script from @Oliver. The goal: I want to modify/extend the script provided in this answer to suit my requirements, which are as ...
Server Programmer's user avatar
1 vote
0 answers
361 views

HTB scheduler unexpected behaviour, low priority traffic starving high priority traffic

I am working on assuring low delay for UDP traffic at the home gateway level. At this home gateway I have two types of traffic, TCP and UDP, and I assure differentiated treatment by using HTB. The ...
FasolkaPoBretonsku's user avatar
1 vote
1 answer
4k views

Limit number of incoming packets per second for a INPUT UDP port [per IP only, not globally] [Ubuntu IPTables]

I searched and I can't find a rule to limit the count of the incoming packets for a INPUT UDP port per second and per IP. I need that per all IPs that connect to my socket, not for a specific one. I'...
rez's user avatar
  • 125
0 votes
1 answer
3k views

linux tc: unstable rate using tbf qdisc

This is the first time I am experimenting with tc. What I am trying to achieve is to limit the download rate that passes through a Virtual Machine that acts as gateway. The VM has two Ethernet ...
stois21's user avatar
3 votes
1 answer
2k views

Nginx limit_req_zone ignores rate value

I have a strange behavior my config looks something like this: http { limit_req_zone $binary_remote_addr zone=nocachelimit:10m rate=120r/m; } ... location "/api" { { limit_req zone=...
gries's user avatar
  • 173
1 vote
0 answers
252 views

Does nginx consider a page request as one request or more (including static files)?

Lets say we have a configuration as below: http { limit_conn_zone $binary_remote_addr zone=conn_limit1:12m; limit_conn_zone $server_name zone=conn_limit2:24m; [...] server ...
Alireza's user avatar
  • 613
3 votes
2 answers
15k views

Nginx - Can I specify rate in limit_req_zone in requests per hour?

While limiting the number of requests from an IP, I am using limit_req_zone $binary_remote_addr zone=one:10m rate=1r/m; I can specify the rate in r/m (requests per minute) or r/s (requests per ...
Madhav Khakhar's user avatar
3 votes
1 answer
1k views

linux tc qdisc pie (aqm) configuration with limited bandwidth

I would like to configure AQM PIE by using tc-qdisc, but at the same time I would like to limit the bandwidth to 1Mb/s. I have used similar configuration with fq_codel, i.e. I have limited the ...
FasolkaPoBretonsku's user avatar
4 votes
1 answer
2k views

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....
Andrew B's user avatar
  • 33.1k
2 votes
1 answer
6k views

Nginx: Can I setup a limit_req_zone with a key with IP + URI?

I'm trying to setup Nginx limit_req module to limit the request rate that any IP can make to the same URL. I would like to define the limit_req_zone with a key that is composed by a combination of ...
El Barto's user avatar
  • 973
3 votes
4 answers
5k views

Block ANY request in Bind

I'm having trouble figuring out how to block ANY dns request on BIND to lower the changes of a DNS Amplification attacks. I've seen guides online but most of them appear to perform rate limit via ...
user avatar
0 votes
0 answers
85 views

Server can't reach more than 800mbps

I'm using wowza for streaming video and I've a server on linode (8gbps upload). I had streaming and when the server reaches 800 mbps, approximately, streaming begins to suffer lag and the upload ...
nhurf's user avatar
  • 17
0 votes
1 answer
5k views

POSTFIX: Limit outbound connections, message count, cummulative size in time window

We are sending quite large amount of email messages to our customers every month with Postfix. Big percentage of them have their email hosted with @example.com. But every month we are struggling to ...
dragularius's user avatar
1 vote
3 answers
4k views

Windows Server 2012 Policy-Based QoS

I am trying to implement Policy-based QoS on a Windows Server 2012 VM (running on Hyper-V), but for some reason it's not kicking in. The way I added the policy was by going into the Local Group Policy ...
Scott Salyer's user avatar
3 votes
1 answer
5k views

Rate limiting using haproxy per url per ip

Our servers are being hit by someone constantly. Its not DDOS. Just one ip hits one url more than 200 times a second. Currently I am blocking the user by ip tables. We are using HAproxy for load ...
Poomalairaj's user avatar
1 vote
1 answer
10k views

traffic shaping on OSX 10.10 with pfctl and dnctl

I am trying to do traffic shaping (throttling) on Mac OS X 10.10 via pfctl and dnctl. I have implemented a simple test server and client with netcat (nc) and a synthetic random payload file to verify ...
Peter Lyons's user avatar
1 vote
1 answer
191 views

Limiting xfer'd bytes per visitor with Apache

From time to time, I'm visited by "leechers" downloading an entire site (~2 GB) within a few hours, while the average visitor stays far below 50 MB. I'd like to setup a "byte-limit" per visitor (e.g. ...
Izzy's user avatar
  • 349
1 vote
1 answer
681 views

Can we prioritize devices connected to a Router

If a number of devices are connected to a router, can we prioritize them (PC - 1, Mobile - 2, Laptops - 3) by giving their MAC addresses. That way if everybody is working, depending upon their ...
user311673's user avatar
1 vote
2 answers
3k views

How to workaround a IP whitelist when consuming a 3rd-party API?

We use a service who's API will reject requests unless the source IP has been previously whitelisted. They only give us 3 slots which is a problem because we have more than 3 machines that need to use ...
Tom's user avatar
  • 4,367
0 votes
1 answer
2k views

HAPRoxy Rate Limiting - Stick-Table Entry Expiration

I've been trying to implement rate limiting for some HTTP POST requests on my website. It works great, except for one detail: the expiration of my entry in my stick-table is always reset to 30 seconds,...
liquidity's user avatar
  • 418
2 votes
2 answers
4k views

Postfix - rate limit outgoing concurrent connections to one machine/ip

I need to limit postfix outgoing connections for specific mailservers, but it seems to me that posfix's limiting is based on domains? What if there is one mailserver for more domains? I tried to find ...
xtc's user avatar
  • 19
2 votes
1 answer
11k views

Limit maximum requests / second for a specific path on HAProxy

I'm trying to achieve this scenario : On a specific path only, I receive a steady 9 requests/sec on the frontend. Everything is fine, use the regular Backend. I now receive 11 req/s, I want to reject ...
Bastien974's user avatar
  • 1,916
0 votes
1 answer
3k views

QoS/traffic-limit on internal ports in OpenVSwitch

I am currently trying to put traffic control on our OpenStack cloud and my questions in one sentence would be: is it possible at all to rate-limit particular port with type internal? The whole story ...
guoger's user avatar
  • 133
0 votes
0 answers
985 views

Rate-limit Apache per IP for a specific page

I would like Apache to redirect to an error page when the number of requests per IP to a specific page (selected with regexp) is above some threshold. What is the simplest way to do that? What module ...
flm's user avatar
  • 101
1 vote
2 answers
2k views

Rate limit misconfigured bots

We have an Nginx / PHP-FPM behind a load balancer which periodically gets scraped. Many of the scrapers hit our application's 404 page quiet hard. Is there a way in Nginx, possibly with the rate-...
rrehbein's user avatar
  • 498
8 votes
4 answers
21k views

Is there a way to rate limit connection attempts with firewalld?

On our CentOS 6 servers, I've used information from this article to reduce the brute force ssh attempts on our servers, specifically the rate limiting / logging section. Is there a way to do the same ...
palehorse's user avatar
  • 4,369
5 votes
2 answers
9k views

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 ...
palehorse's user avatar
  • 4,369
4 votes
1 answer
3k views

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. ...
sergey's user avatar
  • 41
0 votes
1 answer
508 views

Traffic shaping for upload/download speed simulation [duplicate]

I'm building a network emulator to help realize different speeds. Basically, this system would shape a given user's network metrics (such as upload speed/download speeds/packet loss/jitter etc) based ...
newserverguy's user avatar
1 vote
0 answers
825 views

Rate limiting bots (specific IPs) in NGINX

I would like to rate-limit (but not block) various crawlers. Based on other examples of similar questions, I've come up with this: http { ## 10MB zone, 5 reqs per sec limit_req_zone $limit zone=...
Steve Harris's user avatar
0 votes
0 answers
930 views

delay after 5 requests: rate limits? (and how to disable them)

I'm using the following configuration for my nginx server: upstream django { server unix:///var/www/example.com/django/ws/django.socket; } upstream io_nodes { ip_hash; server 127.0.0.1:8080; ...
basilikum's user avatar
  • 217
2 votes
1 answer
2k views

Configuring RRL on a DNS server using BIND

I'd like to configure a DNS server to use Response Rate Limiting (RRL) to mitigate DNS DDoS attacks. Whatever, I have to configure it top use RRL with the 'slip' parameter at 2. I've made some search,...
Zouba's user avatar
  • 21