I've got a LAMP setup running and I seem to have many CLOSE_WAIT connections for apache2 program when I netstat (several hundred). This eventually causes my apache to become unresponsive.
Bellow is the setup:
PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli) (built: Mar 11 2013 14:31:48) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
Server version: Apache/2.2.22 (Ubuntu) [running mpm-prefork]
Server version: 5.5.29-0ubuntu0.12.04.2-log (Ubuntu)
Ubuntu 12.04 LTS
Linux numerink201 3.2.0-34-virtual #53-Ubuntu SMP Thu Nov 15 11:08:40 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
I have a couple of questions:
How can I know in what point of the process I am? Obviously the client sent a FIN/RST request, but how would I know which, and if FIN how do I know if if the process has sent it's own FIN/ACK or if I'm waiting on the client ACK. Or if all was received but the process failed to close?
If it's apache failing to properly close the process how can I locate the issue?
I've currently reduce TimeOut for apache from 300s to 150s as a temporary measure. Would there be a better way of going about it?
Thanks in advance.