DBA Hub

📋Steps in this guide1/2

Apache Monitoring using mod_status (server-status)

Monitor the performance of Apache servers using the mod_status Apache module.

oracle miscconfigurationintermediate
by OracleDba
13 views
1

Setup

The Apache module should be loaded by default in any modern version of Apache. You can see this by checking for the following line in the "/etc/httpd/conf/httpd.conf" file. Assuming that is in place already, you just need to enable to "server-status" page by making two amendments to the "/etc/httpd/conf/httpd.conf". If you want additional status information, you can set the option to "On". The default is "Off". Uncomment the "server-status" location, amending the "Allow from" line to include any domains or IP addresses that you want to have access to the status page. It is a good idea to lock this down as much as possible. Reload or restart Apache. The server status page should now be visible from the following type of URL. The "refresh=15" parameter means the page will refresh every 15 seconds.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
LoadModule status_module modules/mod_status.so

ExtendedStatus On

<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from localhost 192.168.0.4
</Location>

# service httpd reload
# # OR
# service httpd restart

http://localhost/server-status

http://localhost/server-status?refresh=15
2

Reading the server-status Page

The status page is made up of several distinct sections. The header contains basic information about the Apache installation. There is a status summary containing basic status information. The scoreboard gives a visual display of how the available slots are being used. We have 8 servers spawned, with 7 of them idle (_). In total, there are 256 slots. If we look at the configuration in the "httpd.conf" file, we can see this is what we should expect. The bottom of the status page contains information about current requests. During periods of high activity, you can now monitor the status of the Apache server to see if your configuration needs adjusting. For more information see: - Apache Module mod_status - Linux HTTP and FTP Server Configuration (RHCSA) - Linux HTTP Server Configuration (RHCE) - Apache : Reverse Proxy Configuration Hope this helps. Regards Tim...

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Apache Server Status for localhost

Server Version: Apache/2.2.15 (Unix) DAV/2
Server Built: Aug 13 2013 10:51:17

Current Time: Tuesday, 18-Mar-2014 10:12:23 GMT
Restart Time: Tuesday, 18-Mar-2014 10:08:10 GMT
Parent Server Generation: 0
Server uptime: 4 minutes 13 seconds
Total accesses: 6 - Total Traffic: 19 kB
CPU Usage: u0 s0 cu0 cs0
.0237 requests/sec - 76 B/second - 3242 B/request
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

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000
</IfModule>

Srv	PID	Acc	M	CPU 	SS	Req	Conn	Child	Slot	Client	VHost	Request
0-0	31705	0/13/13	W 	0.00	0	0	0.0	0.05	0.05 	::1	ol6-mysql.localdomain	GET /server-status?refresh=15 HTTP/1.1
1-0	31706	0/13/13	_ 	0.00	75	0	0.0	0.05	0.05 	localhost	ol6-mysql.localdomain	GET /server-status?refresh=15 HTTP/1.1
2-0	31707	0/13/13	_ 	0.00	105	0	0.0	0.05	0.05 	localhost	ol6-mysql.localdomain	GET /server-status?refresh=15 HTTP/1.1
3-0	31708	0/13/13	_ 	0.00	90	0	0.0	0.05	0.05 	localhost	ol6-mysql.localdomain	GET /server-status?refresh=15 HTTP/1.1
4-0	31709	0/13/13	_ 	0.00	60	0	0.0	0.05	0.05 	localhost	ol6-mysql.localdomain	GET /server-status?refresh=15 HTTP/1.1
5-0	31710	0/13/13	_ 	0.00	45	0	0.0	0.06	0.06 	localhost	ol6-mysql.localdomain	GET /server-status?refresh=15 HTTP/1.1
6-0	31711	0/13/13	_ 	0.00	30	1	0.0	0.06	0.06 	localhost	ol6-mysql.localdomain	GET /server-status?refresh=15 HTTP/1.1
7-0	31712	0/13/13	_ 	0.00	15	0	0.0	0.06	0.06 	localhost	ol6-mysql.localdomain	GET /server-status?refresh=15 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

Comments (0)

Please to add comments

No comments yet. Be the first to comment!