nginx serving large files - performance issues with more than ~800-1000 connections

Tomasz Chmielewski mangoo at
Fri Jul 6 17:17:18 UTC 2012

On 07/07/2012 12:17 AM, Maxim Dounin wrote:

> On the other hand, the fact that second nginx instance running on
> different port doesn't have problems (as indicated in your
> original message) suggests there is some blocking which makes
> first instance slow.
> Try looking into what nginx processes do when this happens.
> Something like
> ps -eopid,user,args,wchan | grep nginx
> should show where it blocks.

OK, it's the time of the day when the traffic drops (Asia based 
deployment), below ~600 connections, so I no longer see this "blocking".
Will follow up tomorrow.

> Actually, this is expected behaviour for disk blocking: nginx
> worker processes are busy waiting for disk I/O and can't accept
> and handle new connections in a timely manner.  It doesn't matter
> where requested file resides as the pause is a result of nginx
> worker processes being blocked due to other requests.

OK, so, what would be the conclusion? Start hundreds of worker processes?
Say, 512 or even 1024 instead of 32 I'm running now?

Note that I don't see any blocked processes with:

# ps aux | grep D

Rarely, there will be 1-3 nginx processes there, but they disappear very 
fast (i.e. immediately after I run the next ps, they are no longer there).

Tomasz Chmielewski

More information about the nginx mailing list