[ILUG] Hanging apache
Niall O Broin
niall at linux.ie
Thu Jan 25 13:46:43 GMT 2007
On 25 Jan 2007, at 13:20, Colm MacCarthaigh wrote:
> On Thu, Jan 25, 2007 at 12:46:15PM +0000, Donncha O Caoimh wrote:
>> I blogged about it a while back:
> Good god, that's *horrific* advice. That will brutally murder harmless
> requests which are being served by perfectly fine threads.
It's a tad violent alright, but I think I'm going to use it in this
case because it's a very simple approach which will probably solve my
problem, albeit in a brutal way.
The alternative I considered is to periodically run a script which
sees how many processes are running. If that's the max. allowed it
will then check for the CPU usage of eaach process, just as Donncha
did, and then if it finds ALL the processes have a CPU usage > 0, it
will restart the server.
Again, this is a brutal approach, but probably a bit less than brutal
then Donncha's (actually, it's probably more brutal, but less often).
The third approach is to use the various forensic techniques already
suggested by Colm and find out what request is causing the problem,
and then find out where the bug is in the code, and solve it. This is
of course the best approach.
But, those of you working in the real world know what's going to
happen here. Yes, number 1, aka the O'Caoimh shotgun, is going to win
the day. This is old cruddy code, and there is no budget for
improvements. It needs to be stopped from hanging, and if that
results in the death of some "perfectly fine threads" then that's the
price we have to be prepared to pay for our liberty.
More information about the ILUG