How come nginx is only accepting 1 connection?

Maxim Dounin mdounin at
Tue Jan 18 21:21:01 MSK 2011


On Wed, Jan 19, 2011 at 12:39:56AM +0800, He Shiming wrote:

> On Wed, Jan 19, 2011 at 12:33 AM, Roberto De Ioris <roberto at> wrote:
> >
> >
> > Are you sure you are not running pylons with debug enabled ?
> >
> > It can cause some problems with multiprocess apps
> >
> > --
> > Roberto De Ioris
> >
> >
> Hi, thank you all for your help. Eventually I came to the conclusion
> that during the uploading, nginx gets so busy with disk i/o, it can't
> process any other requests.
> It's a local testing so I'm uploading fairly large files to simulate
> the waiting. So it looks like there's no problem after all. I just
> have to figure out how to throttle upload speed to really simulate
> this.

Yep, indeed, you're right.  While reading request body nginx 
doesn't return to event loop until it's read all the data from 
socket recv buffer.  This may cause it keep calling recv() if 
uploading over fast link and client_body_buffer_size is smaller 
than socket's recv buffer.

Using bigger client_body_buffer_size (bigger than recv buffers 
used) should help.

Maxim Dounin

More information about the nginx mailing list