[MODULE] limit traffic rate for nginx

bigplum nginx-forum at nginx.us
Fri May 31 09:37:04 UTC 2013


Hi guys,

Some days ago, one of this module users complaint about the unfair speed for
multi-connections. So I have some time to realize a new method to limit
download rate.

In the new code, if last second speed is lager than max rate, the timer is
added in this module, and the body filter will return. 
So nothing will be sent to client, and do not use the r->limit_rate in
write_filter to limit sendfile size. 

And clcf->sendfile_max_chunk also is modified by the maximum rate.

I am not sure, is there any side-effect about this method?

https://github.com/bigplum/Nginx-limit-traffic-rate-module/blob/v1.0/ngx_http_limit_traffic_rate_filter_module.c

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



More information about the nginx mailing list