monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apache, rotatelogs & chroot environment


From: David Fletcher
Subject: Re: Apache, rotatelogs & chroot environment
Date: Thu, 2 Dec 2004 23:18:33 +0000

Hi Marco & everyone,

I think there might be a better solution to the Apache piped logging
problem, which could be a much better way of doing things.

If Apache is installed with mod_status, the server can be queried for a
machine readable status page at

http://localhost/server-status/?auto

which is pure text, and will look something like:

Total Accesses: 35291
Total kBytes: 10383
CPULoad: .00235583
Uptime: 275062
ReqPerSec: .128302
BytesPerSec: 38.6538
BytesPerReq: 301.272
BusyWorkers: 1
IdleWorkers: 9
Scoreboard: _..___.__W_.__...........................

The scoreboard line will indicate what is going on, with this key:

"_" Waiting for Connection, "S" Starting up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" Gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process

If we get Monit to read this file, it can be configured to restart Apache
if, for example, more than 30% of the active httpd processes are stuck in
Logging, or some other "bad" state.

This would be a much more general solution to the Apache in chroot
problem than the one I wrote about before.

I've been looking at the http.c protocol file in Monit. Would this be a
good place to put something, or is it wrong to have something Apache
specific in that file? Should the percentage limit of "bad" state processes
be hard coded, or can there be a configuration line somewhere?

Perhaps just using /server-status/?auto as the page to check could
automatically indicate that we want to do the extra Apache checks.

if failed host 192.168.1.1 port 80 
        protocol HTTP request /server-status/?auto then restart

David.

-- 
-------------------------------------------------
Email: address@hidden
-------------------------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]