Limiting rate by given variables(like $request_uri, $remote_addr, etc..).
Limiting rate by given variables(like $request_uri, $remote_addr, etc..).
To install, compile nginx with this ./configure option:
--add-module=path/to/this/directoryNginx directive limit_rate could limit connection's speed, and limit_conn could limit connection number by given variable. If the client is a browser, it only open one connection to the server. The speed will be limited to limit_rate, unless the client is a multi-thread download tool.
Limit_traffic_rate module provides a method to limit the total download rate by client IP or download URL, even there are several connections. The limit condition could be defined by the following directive.
The limit_traffic_rate module need to use a share memory pool. Directive syntax is same to limit_zone.
http {
#limit_traffic_rate_zone rate $request_uri 32m;
limit_traffic_rate_zone rate $remote_addr 32m;
server {
location /download/ {
limit_traffic_rate rate 20k;
}
}
}Changelogs v0.2 * modify algorithm, rate = (limit - last_rate)/conn + last_rate v0.1 * first release
Same as nginx:
/*
No open issues yet, or sync has not completed.