limit_conn not working

Abilio Marques abiliojr at gmail.com
Tue Dec 19 14:29:22 UTC 2017


Thanks,

I imagined to be something like that, but this is not obvious from the
documentation. Is there a way to clarify it for future readers?

On Tue, Dec 19, 2017 at 3:26 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Tue, Dec 19, 2017 at 06:36:00AM +0100, Abilio Marques wrote:
>
> > limit_conn is not working for me. I set up a test in nodejs, I'm doing
> GET
> > requests to http://localhost/, they are coming from different
> connections
> > (different origin ports), and all the connections are still open until
> the
> > very end, still, no response other than 200 is received. I double check
> > with wireshark.
> >
> > What am I missing??
> >
> > Minimal configuration I can reproduce it with: https://paste.ngx.cc/70
> > Source code for the test: https://paste.ngx.cc/6f
>
> The limit_conn limit only limits connections with active requests.
> Moreover, it only applies after reading request headers - as nginx
> needs to know requested host and URI to check limits appropriate
> for particular server and location blocks.
>
> As a result, it is almost impossible to trigger limit_conn by
> requests to small static files.  To trigger limit_conn, consider
> testing it with files large enough to fill up socket buffers,
> and/or with proxying.
>
> --
> Maxim Dounin
> http://mdounin.ru/
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20171219/9f7e4900/attachment.html>


More information about the nginx mailing list