Apache monitoring busy vs idle workers

apache-2.2monitoringperformance-monitoring

For Apache, I want to monitor

  1. Busy workers
  2. Idle workers
  3. Queued requests

Monitoring would be done throughout the day, taking a sample every min., in a graphical manner.

If such a tool is not available for free, then any script which can dump this data in a tabular format and I can import that data in CSV format would be sufficient.

Is there any tool for doing that ?

Best Answer

For the busy and idle workers, you can parse it from the status page, something like this:

busy_workers=`lynx -dump http://domain.com/server-status?auto | awk '/BusyWorkers/ { print $2 }'`
idle_workers=`lynx -dump http://domain.com/server-status?auto | awk '/IdleWorkers/ { print $2 }'`

For the waiting requests, you can calculate the numbers of concurrent connections and subtract to MaxClients directive:

concurrent_connections=`netstat -natp | grep httpd | grep ESTABLISHED | grep -v grep | wc -l`

From this result, you can plot a graph with any monitoring tools you want: gmetric (Ganglia), PNP4Nagios, ...

Related Topic