Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Im trying to debug why an app server of ours all of its apache children lockup and stop serving requests. These are mod_perl app servers.

The problem is that to find out what the current requests are you need to make a http request to find out the server-status (using mod_status).

share|improve this question

3 Answers 3

You could hook into one of the earlier phases in the mod_perl lifecycle and dump the requests at that point. Add a hook at the end to mark a particular request as completed (maybe add the response headers), and now you know what's currently running.

share|improve this answer
    
we ended up finding out that the problem is being caused by Apache::DBI to keep persistent db handles between requests –  Brendan Jun 17 '09 at 6:13

Not what you're lookng for exactly, but you could restart Apache, script fetching the status every (N seconds/minutes) until it crashes, and then look at the most recent?

share|improve this answer
    
not going to achieve whats required as you lose what requests the children are doing, and you cant use the logs because logging is done at the end of the request –  Brendan Jun 15 '09 at 3:10

I've since found out that one possible route is to stop incoming traffic to this website (iptables rule on the local box would be easy enough) then get a pid list of the apache children and send a HUP to a couple of the children, then do a localhost server-status (as you now have a few freed up children to serve requests).

share|improve this answer
1  
This relies on you using the prefork MPM. If you use the worker MPM, it may not be as useful. While worker does fork and use a number of processes, you'll end up killing far more requests than you would like. –  David Pashley Jun 15 '09 at 9:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.