strange nginx hang after ~18600 requests

gadh nginx-forum at
Tue Dec 18 15:24:59 UTC 2012

I'm developing a module that uses a handler module and header+body filter
at my handler phase (registered in the nginx rewrite phase) i stop the
request (return NGX_OK), then issue a subrequest to another server, get the
result back (hook function), then continue to the header+body filter, change
the headers + body and calls the next filters accordingly.
also, the subrequest runs thru a proxy , here's the relevant conf lines:
keepalive_timeout  65;
gzip  on;
proxy_http_version  1.1;
worker_connections  1024; 

 location / { // this location is where the ab tries to get (see below the
ab test)
        include <my module conf>
        proxy_pass http://server

        location /def1 { // this is the subrequest uri
        proxy_buffers           8 128k;
        proxy_buffer_size       128k;
        proxy_busy_buffers_size 128k;

        proxy_pass              http://server2/page.php // another nginx
runs fastcgi

all works fine, untill i run an "ab" test against my nginx (10/12 workers)
that runs on a multi-core, heavy duty linux server, and here's my ab line:
ab -c 50 -n 20000 http://...myserver...
the actual rate is ~1000 requests per second, very high...

but almost exactly after 18500-18600 reuests (that ran smoothly without any
errors, debug level INFO with printouts of my own) - the nginx hangs - not
stuck - since i see in debug level "debug" its epoll loop runing ok, but not
recv nor proceesing any other requests although they continue to come from
my ab test

any suggestions please ?



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

More information about the nginx mailing list