0

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).

Brendan
  • 934
  • 6
  • 5

3 Answers3

1

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.

David Pashley
  • 23,497
  • 2
  • 46
  • 73
  • 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 06:13
0

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?

crb
  • 7,998
  • 1
  • 38
  • 53
  • 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 03:10
0

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).

Brendan
  • 934
  • 6
  • 5
  • 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 09:13