1.22.2011

How can I view Apache server performance status?

Apache server performance can be monitored using the Apache module mod_status. Server status is presented in an HTML page that gives the current server statistics in an easily readable form. The page can be also made automatically refresh with a compatible browser. Another page gives a simple machine-readable list of the current server state.


The details given are:


•The number of children serving requests.

•The number of idle children.

•The status of each child, the number of requests that child has performed and the total number of bytes served by the child (*)

•A total number of accesses and byte count served (*).

•The time the server was started/restarted and the time it has been running for

•Averages giving the number of requests per second, the number of bytes served per second and the average number of bytes per request (*).

•The current percentage CPU used by each child and in total by Apache (*).

•The current hosts and requests being processed (*).


Details marked "(*)" are only available with ExtendedStatus On.


Activating Status Support for Apache

To activate status reports only for browsers from the mydomain.com domain add the following code to your httpd.conf configuration file:





SetHandler server-status
Order Deny,Allow
Deny from all
Allow from .mydomain.com



Note: The lines above may already exist in your default httpd.conf file. If this is the case, you can simply uncomment this section to use the existing configuration.


The server statistics can now be accessed by using a Web browser. To access the page http://mydomain.com/server-status.


Try accessing and get the result likewise:

Apache Server Status for 10.14.236.98
Server Version: Apache/2.0.52 (Red Hat)
Server Built: Aug 7 2007 05:01:09

--------------------------------------------------------------------------------

Current Time: Sunday, 11-Oct-2009 21:38:25 IST
Restart Time: Sunday, 11-Oct-2009 21:38:19 IST
Parent Server Generation: 0
Server uptime: 5 seconds
Total accesses: 0 - Total Traffic: 0 kB
CPU Usage: u0 s0 cu0 cs0
0 requests/sec - 0 B/second -
1 requests currently being processed, 7 idle workers
_W______........................................................
................................................................
................................................................
................................................................

Scoreboard 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

Srv PID Acc M CPU SS Req Conn Child Slot Client VHost Request
1-0 25523 0/0/0 W 0.00 0 0 0.0 0.00 0.00 158.234.236.15 relay.groupultra.com GET /server-status HTTP/1.1



--------------------------------------------------------------------------------
Srv Child Server number - generation
PID OS process ID
Acc Number of accesses this connection / this child / this slot
M Mode of operation
CPU CPU usage, number of seconds
SS Seconds since beginning of most recent request
Req Milliseconds required to process most recent request
Conn Kilobytes transferred this connection
Child Megabytes transferred this child
Slot Total megabytes transferred this slot

--------------------------------------------------------------------------------
SSL/TLS Session Cache Status:
cache type: SHMCB, shared memory: 512000 bytes, current sessions: 0
sub-caches: 32, indexes per sub-cache: 133
index usage: 0%, cache usage: 0%
total sessions stored since starting: 0
total sessions expired since starting: 0
total (pre-expiry) sessions scrolled out of the cache: 0
total retrieves since starting: 0 hit, 0 miss
total removes since starting: 0 hit, 0 miss


--------------------------------------------------------------------------------

Apache/2.0.52 (Red Hat) Server at 10.14.236.98 Port 80

No comments:

Post a Comment