[MODULE] limit traffic rate for nginx

bigplum nginx-forum at nginx.us
Mon Jan 10 05:31:24 MSK 2011


I modify the calculation method. Now all the connections with same $vara

defined by "limit_traffic_rate_zone" will be record in a queue. Number
of the 
sent byte will be summarized in every cycle to get the last_rate of
all "same $vara" connections.

for the single connection, rate = (limit - last_rate)/conn + last_rate

So that, the first downloading will not be paused, but it will get a max
For example: The limit_rate is 300KB.First downloading start with rate
After the second, third downloading issued, first will get 250KBps+
rate, and the second, third will get 10~20KBps until the first finish
its downloading.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,159398,164999#msg-164999

More information about the nginx mailing list