Patch limit_rate_max: for your review


I have a new patch for Nginx. I use this server to stream videos. I
needed a
way to burst the rate with limit_rate_after but controlled from config,
at full throttle. Eg.: send 4Mb with 500KBps and the remaining with

This is usefull when sending mp4 that have a 2 to 6MB of index data at
beginning of the file and playback only starts after this is received.
way I can start the video playback faster not after 20 seconds or so.
However, if you have 500 new users per seconds you can choke the
so the need to control the burst speed.

I created a new config directive limit_rate_max that applies to initial
burst speed.
Another change I made is to put the limit_rate_after in server
I need this to control the burst quantity on the fly based on url param.

if ($arg_burst != ""){
    $limit_rate_after $arg_burst;

The index for each file is different and with this I control how much
we need, usefull when users seek a lot and index is recalculated on seek
each file…

If anyone can review this and find it useful, let me know, it works for

I thank to Andrei (Latzease) for his contribution to this… he made it

Posted at Nginx Forum:,232178,232178#msg-232178

I don’t see a patch anywhere for review!

I don’t know how to attach it here, should I just paste the whole diff.


Posted at Nginx Forum:,232178,232207#msg-232207

On 25 October 2012 16:07, crirus [email protected] wrote:

I don’t know how to attach it here, should I just paste the whole diff.

Perhaps join the mailing list (which the forum is cross-posted to, and
is where I’m posting from) and attach your patch to a mail?


Jonathan M. // Oxford, London, UK