Is the limit_rate per tcp session or per HTTP request?

Stefan Hellkvist hellkvist at gmail.com
Mon Dec 21 10:00:09 UTC 2015


Hi,

>From reading the code and the docs I have gotten the impression that
limit_rate (and limit_rate_after) is per ngx_connection which (I think)
means that it is per HTTP request and not per socket. Am I right in this
conclusion or is the limit actually per socket/TCP connection?

What we are observing is that the limit we configure does only kick in for
requests to files that are larger than the limit_rate_after when the
request is done in one GET request but not when the request is done in
chunks using byte offset parameters (that is - using many GET requests for
the file). So clients can easily avoid the limitations by downloading the
file chunk by chunk rather than in one request.

If our conclusion are right - that the limit is per HTTP request and not
per socket so that a chunked download would not be limited - does anyone
have any suggestion how we would go about to introduce a limit also on
socket level? I don't mind hacking away at the code, but perhaps someone
out there has already looked into this?

/Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20151221/d60d83f7/attachment.html>


More information about the nginx-devel mailing list