Apache2 troubleshooting
Fred
puissante at lrc.puissante.com
Sun Oct 29 08:38:33 EST 2006
On Friday 27 October 2006 11:27, Ben Scott uttered thusly:
> On 10/27/06, Fred <puissante at lrc.puissante.com> wrote:
> > Then you can use your browser and do
> > "http://yourdomain.com/server-status" to see how active your server
> > really is.
>
> Or combine that with the nifty "watch" command I just learned about
> (in this forum) recently:
>
> watch "elinks -dump http://yourdomain.com/server-status"
>
> (Replace "elinks" with "lynx" if that's what you have.)
>
> -- Ben
Oh, that's a cool command. Saves me from having to do:
for ((;;)) do clear; lynx -dump http://yourdomain.com/server-status; sleep
15; done
Just a note on server-status: If you, in your browser, do:
http://yourdomain.com/server-status?refresh=15
It will automatically refresh every 15 seconds. You, of course, can change
that to whatever refresh rate you desire.
You may also do:
http://yourdomain.com/server-status?auto
Which will yeild a plain text format easily parsable by scripts, etc., which
is how I get my web applications to monitor server loads and react
accordingly. The output it produces is something like:
Total Accesses: 11874
Total kBytes: 218608
CPULoad: 13.3988
Uptime: 3899
ReqPerSec: 3.0454
BytesPerSec: 57413.3
BytesPerReq: 18852.5
BusyWorkers: 12
IdleWorkers: 17
Scoreboard: W_______K__K____.K_WK..._ ...
Of particular interest (to me) are the "BusyWorkers" and "IdleWorkers"
fields, as these two fields are a direct reflection of server load, whose
max values are determined by your Apache settings for Prefork or MPM. A good
showing here is to see BusyWorkers low relative to your max settings and to
have "IdleWorkers" be something other than 0. Server should be very
responsive to human visitors at that point. A bad showing is
when "BusyWorkers" is close to or at your max setting and "IdleWorkers" is
0, in which case Apache simply can't handle any new queries in a timely
fashion and visitors to your sites will wait 30 seconds or longer for
resources to free up. Not Good.
I actually take an normalized exponential moving average of "BusyWorkers"
and "IdleWorkers" and have my apps make decisions on that basis, so spike
demands are smoothed out and the server does not react spasmodically to the
ever shifting loads.
Probably more than you wanted to know. :-)
-Fred
More information about the gnhlug-discuss
mailing list