LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache process hangs (http://www.linuxquestions.org/questions/linux-server-73/apache-process-hangs-846494/)

imi@tux 11-25-2010 08:07 AM

Apache process hangs
 
Hello happy hackers!

I have this webserver running multiple websites as virtual hosts. I suddenly noticed (using top) that some of the apache processes hang. I can narrow down the problem to a single site with the command lsof +p PID, but I can't get any closer the problem. Is there a way to get a more detailed report of similar problems? I checked my logs but sadly can't find anything useful.

paulsm4 11-26-2010 05:35 PM

Sure - many ways.

The best/easiest is to look at the access log (e.g. /var/logs/apache2/access_log) and see what the last request was, and if it had anything to do with the "hang".

The Apache error log (e.g. "error_log") should be in the same directory. Look there, too.

Other tools might include:
* lsof: see what files/ports the process is using

* tcpdump or wireshark: take a network trace when the "hang" occurs.
Who knows - maybe you'll discover that the CLIENT might be at fault ;)

* gdb: you can attach to the live, "hung" process and get a stack traceback (of exactly where it's hanging)

* Etc

'Hope that helps .. and Good Luck!

Please post back what you find!

bmarx 11-27-2010 11:17 AM

You could also use mod_status to try to get a better insight into the problem:

http://httpd.apache.org/docs/2.0/mod/mod_status.html

imi@tux 01-07-2011 05:25 AM

Thanks for the advices!

However, wireshark was the one that hunted the problem down. A php-script that was looping and looping and looping...


All times are GMT -5. The time now is 06:35 PM.