[MODULE] limit traffic rate for nginx

Piotr Karbowski jabberuser at gmail.com
Tue Jan 11 13:35:56 MSK 2011


On 01/10/2011 03:31 AM, bigplum wrote:
> Hi,
>
> 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
> speed.
> For example: The limit_rate is 300KB.First downloading start with rate
> 300KBps.
> 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.

I wonder if it is good or not. Would be great if it could spare limit 
fair between all connections. Anyway I am looking forward for your 
module. Thanks.

-- Piotr.



More information about the nginx mailing list