]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_status.xml
XML update.
[apache] / docs / manual / mod / mod_status.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
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
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
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.
21 -->
22
23 <modulesynopsis metafile="mod_status.xml.meta">
24
25 <name>mod_status</name>
26 <description>Provides information on server activity and
27 performance</description>
28 <status>Base</status>
29 <sourcefile>mod_status.c</sourcefile>
30 <identifier>status_module</identifier>
31
32
33 <summary>
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>
40
41     <p>The details given are:</p>
42
43     <ul>
44       <li>The number of worker serving requests</li>
45
46       <li>The number of idle worker</li>
47
48       <li>The status of each worker, the number of requests that
49       worker has performed and the total number of bytes served by
50       the worker (*)</li>
51
52       <li>A total number of accesses and byte count served (*)</li>
53
54       <li>The time the server was started/restarted and the time it
55       has been running for</li>
56
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>
60
61       <li>The current percentage CPU used by each worker and in
62       total by all workers combined (*)</li>
63
64       <li>The current hosts and requests being processed (*)</li>
65     </ul>
66
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
71     by default.</p>
72
73     <note>
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>
80     </note>
81
82 </summary>
83
84 <section id="enable">
85     <title>Enabling Status Support</title>
86
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 &lt;Location "/server-status"&gt;
92     SetHandler server-status
93     Require host example.com
94 &lt;/Location&gt;
95 </highlight>
96
97     <p>You can now access server statistics by using a Web browser
98     to access the page
99     <code>http://your.server.name/server-status</code></p>
100 </section>
101
102 <section id="autoupdate">
103
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>
109
110 </section>
111
112 <section id="machinereadable">
113
114     <title>Machine Readable Status File</title>
115     <p>A machine-readable version of the status file is available by
116     accessing the page
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>
121
122 </section>
123
124 <section id="troubleshoot">
125     <title>Using server-status to troubleshoot</title>
126
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>
131
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
135     thread.</p>
136
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
141     address.</p>
142
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>
147
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
152     site.</p>
153
154 </section>
155
156 </modulesynopsis>