Several days ago I found that there are httpd processes taking up all available cpu.
netstat -anp|grep TIME_WAIT
I found that there are 15+ TIME_WAIT connections from my IP only, after I visited my site.
Does anyone have idea why apache leaving these connections open ?
I think this could mean that you've reached the max connections and apache is queuing requests (ie, it puts a request into queue and when its available it serves it, which is usually very resource consuming).
Try a few things: 1. try changing KeepAlive from on to off. 2. Try raising the max clients (both are towards top of httpd.conf )
A TIME_WAIT is a perfectly normal thing. They will go away after, well, a little time.
Your browser is likely threaded and may have made several simultaneous connections to your server. These sockets hang around a little while and don't do any harm.
This is the advantage of HTTP 1.1 and the keep-alive option. Many more requests can be served over a single socket instead of having to do a connect() (the C function that the browser uses to connect a socket to the server, at least in the Berkeley socket library ) for every request.
I wouldn't get too freaked out about these. It's when your sockets stay in FIN_WAIT2 that there can be a problem.
I found that actually its not time_wait problem but php scripts
Once I go to my php based website and try to login to email account(created by hivemail) it hangs for several minutes and then I see that server is overloaded.
Once I restart apache and close the webiste,server start working correctly.
I guess it should be somewhere between php and mysql database which script trying to query once i click login.