My web server has a lot of apache tcp CLOSE_WAIT
's stuck at poll(found through a backtrace in gdb)
, How do I debug what in php is causing my web server to not properly close connections?
-
5This just means your PHP code is opening connections but not closing them. It's not an Apache problem. Try to track down which PHP script it is.– David SchwartzOct 26, 2012 at 23:41
1 Answer
Install/enable mod_status, configure it to allow access from your URL and access the server with <server-ip>/server-status
You should see a list of all current active client connections including vhost and path.
IIRC had this problem when a badly configured crawler hit a website that used a not properly implemented php script that handled images. It tried to access all those images as if it were links causing huge load and many open connections.