Lots of CLOSE_WAIT sockets, nginx+php (WordPress site)

Maxim Dounin mdounin at mdounin.ru
Tue Feb 23 00:59:47 MSK 2010


On Mon, Feb 22, 2010 at 08:25:20PM +0100, Vicente Aguilar wrote:

> Hi
> > Do you also had CLOSE_WAIT sockets which 
> > fastcgi_ignore_client_abort off?
> Have changed it to off after your previous mail and still 
> haven't seen a single CLOSE_WAIT socket. Anyway the site doesn't 
> really have that much traffic and today I haven't tried to 
> stress it. Will keep and eye on it and tomorrow will try to 
> reproduce it again.
> > By "stuck" you mean sockets in CLOSE_WAIT state?  It's 
> > expected that there is no CLOSE_WAIT sockets between nginx and 
> > php.
> Well, I thought that if the CLOSE_WAIT sockets on the 
> browser-nginx end are really caused by PHP, there should be 
> another somehow blocked connection on the nginx-PHP end, but 
> that's not the case.

There will be another connection between nginx and php, but it 
will be live (in ESTABLISHED state).  It will wait for php to 
finish request processing and sending response back to nginx.  
Once php is done - nginx will close both nginx-php and 
client-nginx connections.

Maxim Dounin

More information about the nginx mailing list