2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <modulesynopsis metafile="mod_status.xml.meta">
25 <name>mod_status</name>
26 <description>Provides information on server activity and
27 performance</description>
29 <sourcefile>mod_status.c</sourcefile>
30 <identifier>status_module</identifier>
34 <p>The Status module allows a server administrator to find out
35 how well their server is performing. A HTML page is presented
36 that gives the current server statistics in an easily readable
37 form. If required this page can be made to automatically
38 refresh (given a compatible browser). Another page gives a
39 simple machine-readable list of the current server state.</p>
41 <p>The details given are:</p>
44 <li>The number of worker serving requests</li>
46 <li>The number of idle worker</li>
48 <li>The status of each worker, the number of requests that
49 worker has performed and the total number of bytes served by
52 <li>A total number of accesses and byte count served (*)</li>
54 <li>The time the server was started/restarted and the time it
55 has been running for</li>
57 <li>Averages giving the number of requests per second, the
58 number of bytes served per second and the average number of
59 bytes per request (*)</li>
61 <li>The current percentage CPU used by each worker and in
62 total by all workers combined (*)</li>
64 <li>The current hosts and requests being processed (*)</li>
67 <p>The lines marked "(*)" are only available if
68 <directive module="core">ExtendedStatus</directive>
69 is <code>On</code>. In version 2.3.6, loading mod_status will
70 toggle <directive module="core">ExtendedStatus</directive> On
74 <strong>It should be noted that if <module>mod_status</module> is
75 loaded into the server, its handler capability is available
76 in <em>all</em> configuration files, including
77 <em>per</em>-directory files (<em>e.g.</em>,
78 <code>.htaccess</code>). This may have security-related
79 ramifications for your site.</strong>
85 <title>Enabling Status Support</title>
87 <p>To enable status reports only for browsers from the example.com
88 domain add this code to your <code>httpd.conf</code>
89 configuration file</p>
90 <highlight language="config">
91 <Location "/server-status">
92 SetHandler server-status
93 Require host example.com
97 <p>You can now access server statistics by using a Web browser
99 <code>http://your.server.name/server-status</code></p>
102 <section id="autoupdate">
104 <title>Automatic Updates</title>
105 <p>You can get the status page to update itself automatically if
106 you have a browser that supports "refresh". Access the page
107 <code>http://your.server.name/server-status?refresh=N</code> to
108 refresh the page every N seconds.</p>
112 <section id="machinereadable">
114 <title>Machine Readable Status File</title>
115 <p>A machine-readable version of the status file is available by
117 <code>http://your.server.name/server-status?auto</code>. This
118 is useful when automatically run, see the Perl program
119 <code>log_server_status</code>, which you will find in the
120 <code>/support</code> directory of your Apache HTTP Server installation.</p>
124 <section id="troubleshoot">
125 <title>Using server-status to troubleshoot</title>
127 <p>The <code>server-status</code> page may be used as a starting
128 place for troubleshooting a situation where your server is consuming
129 all available resources (CPU or memory), and you wish to identify
130 which requests or clients are causing the problem.</p>
132 <p>First, ensure that you have <directive
133 module="core">ExtendedStatus</directive> set on, so that you can see
134 the full request and client information for each child or
137 <p>Now look in your process list (using <code>top</code>, or similar
138 process viewing utility) to identify the specific processes that are
139 the main culprits. Order the output of <code>top</code> by CPU
140 usage, or memory usage, depending on what problem you're trying to
143 <p>Reload the <code>server-status</code> page, and look for those process
144 ids, and you'll be able to see what request is being served by that
145 process, for what client. Requests are transient, so you may need to
146 try several times before you catch it in the act, so to speak.</p>
148 <p>This process <em>should</em> give you some idea what client, or
149 what type of requests, are primarily responsible for your load
150 problems. Often you will identify a particular web application that
151 is misbehaving, or a particular client that is attacking your