Problems using limit_zone and limit_conn

I am trying to limit the number of connections to my server from a
single IP address using the limit_zone module as described on the wiki
[2], but nginx is not sending a 503 to the client as expected.

In the past I have used apache’s mod_limitipconn to limit the number of
simultaneous connections to 20 from a single IP address. I have tried to
duplicate that behaviour with nginx.

Attached is the output of `ab’ [2], which is what I am using to generate
the requests. When testing against apache, I see many failed requests,
which the logs show as a returned 503. However, when using nginx, all
the requests are returned with a 200. The logs show zero 503 replies
sent.

Attached is the ab output for both tests and my nginx.conf.

The configuration seems quite simple, so I am surprised that it doesn’t
work. Anybody see any errors on my part?

Thanks,
Stuart

References:
[1] http://wiki.codemongers.com/NginxHttpLimitZoneModule
[2] http://httpd.apache.org/docs/2.2/programs/ab.html

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs