Maybe a bug in Nginx 0.6.30 x86_64

Igor Sysoev is at
Sun May 11 20:46:01 MSD 2008

On Sun, May 11, 2008 at 04:23:16PM +0000, Fran??ois Battail wrote:

> Igor Sysoev <is at ...> writes:
> > It seems that you are able to run ab/nginx in resonance:
> > 
> > 1) ab issues request, nginx gets epoll notification and sends response,
> > 2) kernel schedules ab, it gets response, sends a new request,
> > 3) kernel schedules nginx, it reads the request, sends a response,
> > 4) goto #2.
> Yes, running AB and Nginx on the same computer is insane since AB is more CPU
> hungry than Nginx ;-)
> > So nginx processes all requests after single epoll notification without
> > any blocking. This may happen only on greedy event notification methods:
> > epoll and rtsig. Also I'm not sure that it can be reproduced from remote 
> > host. I see two ways to fix it: the simplest is to limit number of 
> > keepalive requests.
> Well, I used to test a custom version of Nginx with keepalive enabled without
> any problem and with a lot of concurrent connections (content is generated
> dynamically without blocking calls for the moment, but it's completely specific
> to my case). I understand your point when you write resonance but I have still
> an issue on understanding why keepalive could be an issue triggering recursive
> calls since without keepalive it works fine.

Because after sending response and before going to keepalive state
nginx tests if there is data to read. And if data is, nginx goes to a next
request: ngx_http_keepalive_handler() calls ngx_http_init_request().

Igor Sysoev

More information about the nginx mailing list