On Tue, Apr 29, 2008 at 11:57:44AM +0400, Maxim Dounin wrote:
It looks like there is some misunderstanding regarding to what limit_conn
actually limits. It limits concurrent connections *processed* by nginx
(not keep-alive ones), and only after header has been received (and thus
configuration for request has been
determined).
Since nginx is event-based, with one worker process you shouldn't expect
requests to hit limit_conn unless they block at some stage (i.e. responses
bigger than socket buffers if sendfile off, replies bigger than
sendfile_max_chunk if sendfile on, proxy_pass ...). With many workers
limit_conn may be hit without blocking, but this generally requires _very_
high concurrency for small requests.
Maxim,
Thanks for the clarification. I ran another test, using a large test
file and multiple workers and saw that nearly all the requests received
a 503 response.
This makes sense; I wasn't taking into account the way I was running the
test.
Thanks,
Stuart