3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen<?xml version="1.0"?>
0d26a2bd71224b954baab529bbadc4d676c35b95slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<!--
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding Licensed to the Apache Software Foundation (ASF) under one or more
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding contributor license agreements. See the NOTICE file distributed with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding this work for additional information regarding copyright ownership.
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding The ASF licenses this file to You under the Apache License, Version 2.0
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding (the "License"); you may not use this file except in compliance with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding the License. You may obtain a copy of the License at
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd http://www.apache.org/licenses/LICENSE-2.0
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Unless required by applicable law or agreed to in writing, software
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd distributed under the License is distributed on an "AS IS" BASIS,
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd See the License for the specific language governing permissions and
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd limitations under the License.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd-->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
7db9f691a00ead175b03335457ca296a33ddf31bnd<modulesynopsis metafile="mod_status.xml.meta">
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen<name>mod_status</name>
0d26a2bd71224b954baab529bbadc4d676c35b95slive<description>Provides information on server activity and
0d26a2bd71224b954baab529bbadc4d676c35b95sliveperformance</description>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen<status>Base</status>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen<sourcefile>mod_status.c</sourcefile>
0d26a2bd71224b954baab529bbadc4d676c35b95slive<identifier>status_module</identifier>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen<summary>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <p>The Status module allows a server administrator to find out
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen how well their server is performing. A HTML page is presented
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen that gives the current server statistics in an easily readable
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen form. If required this page can be made to automatically
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen refresh (given a compatible browser). Another page gives a
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen simple machine-readable list of the current server state.</p>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <p>The details given are:</p>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <ul>
3e0c673f5399cfb820c3bb9f62dd746d21ba7d71yoshiki <li>The number of worker serving requests</li>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3e0c673f5399cfb820c3bb9f62dd746d21ba7d71yoshiki <li>The number of idle worker</li>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3e0c673f5399cfb820c3bb9f62dd746d21ba7d71yoshiki <li>The status of each worker, the number of requests that
3e0c673f5399cfb820c3bb9f62dd746d21ba7d71yoshiki worker has performed and the total number of bytes served by
3e0c673f5399cfb820c3bb9f62dd746d21ba7d71yoshiki the worker (*)</li>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <li>A total number of accesses and byte count served (*)</li>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <li>The time the server was started/restarted and the time it
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen has been running for</li>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <li>Averages giving the number of requests per second, the
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen number of bytes served per second and the average number of
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen bytes per request (*)</li>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3e0c673f5399cfb820c3bb9f62dd746d21ba7d71yoshiki <li>The current percentage CPU used by each worker and in
2f46ce2a814d7f2b126dfb9f1b25fd64e2fbdc11rbowen total by all workers combined (*)</li>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <li>The current hosts and requests being processed (*)</li>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen </ul>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <p>The lines marked "(*)" are only available if
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <directive module="core">ExtendedStatus</directive>
a8ee031b2224ce5473826c9d4f603681589245fawrowe is <code>On</code>. In version 2.3.6, loading mod_status will
a8ee031b2224ce5473826c9d4f603681589245fawrowe toggle <directive module="core">ExtendedStatus</directive> On
a8ee031b2224ce5473826c9d4f603681589245fawrowe by default.</p>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen</summary>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
53bae66d3dc14a667e14a451f7bc65a893dd450fnd<section id="enable">
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <title>Enabling Status Support</title>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
e8811b6d38f756b325446ded5d96857d13856511takashi <p>To enable status reports only for browsers from the example.com
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen domain add this code to your <code>httpd.conf</code>
0d26a2bd71224b954baab529bbadc4d676c35b95slive configuration file</p>
ab152dac543de24fadd7ed0159c9f380af02061bhumbedooh<highlight language="config">
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar&lt;Location "/server-status"&gt;
ab152dac543de24fadd7ed0159c9f380af02061bhumbedooh SetHandler server-status
ab152dac543de24fadd7ed0159c9f380af02061bhumbedooh Require host example.com
ab152dac543de24fadd7ed0159c9f380af02061bhumbedooh&lt;/Location&gt;
ab152dac543de24fadd7ed0159c9f380af02061bhumbedooh</highlight>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <p>You can now access server statistics by using a Web browser
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen to access the page
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <code>http://your.server.name/server-status</code></p>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen</section>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
53bae66d3dc14a667e14a451f7bc65a893dd450fnd<section id="autoupdate">
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <title>Automatic Updates</title>
0d26a2bd71224b954baab529bbadc4d676c35b95slive <p>You can get the status page to update itself automatically if
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen you have a browser that supports "refresh". Access the page
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <code>http://your.server.name/server-status?refresh=N</code> to
0d26a2bd71224b954baab529bbadc4d676c35b95slive refresh the page every N seconds.</p>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen</section>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
53bae66d3dc14a667e14a451f7bc65a893dd450fnd<section id="machinereadable">
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <title>Machine Readable Status File</title>
0d26a2bd71224b954baab529bbadc4d676c35b95slive <p>A machine-readable version of the status file is available by
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen accessing the page
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <code>http://your.server.name/server-status?auto</code>. This
2f46ce2a814d7f2b126dfb9f1b25fd64e2fbdc11rbowen is useful when automatically run, see the Perl program
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <code>log_server_status</code>, which you will find in the
2f46ce2a814d7f2b126dfb9f1b25fd64e2fbdc11rbowen <code>/support</code> directory of your Apache HTTP Server installation.</p>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <note>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <strong>It should be noted that if <module>mod_status</module> is
4968ba2f73bc7d02d116c3532b79fc1ffbebeb72rbowen loaded into the server, its handler capability is available
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen in <em>all</em> configuration files, including
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <em>per</em>-directory files (<em>e.g.</em>,
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen <code>.htaccess</code>). This may have security-related
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen ramifications for your site.</strong>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen </note>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen</section>
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen<section id="troubleshoot">
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen <title>Using server-status to troubleshoot</title>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen <p>The <code>server-status</code> page may be used as a starting
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen place for troubleshooting a situation where your server is consuming
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen all available resources (CPU or memory), and you wish to identify
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen which requests or clients are causing the problem.</p>
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen <p>First, ensure that you have <directive
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen module="core">ExtendedStatus</directive> set on, so that you can see
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen the full request and client information for each child or
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen thread.</p>
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen <p>Now look in your process list (using <code>top</code>, or similar
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen process viewing utility) to identify the specific processes that are
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen the main culprits. Order the output of <code>top</code> by CPU
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen usage, or memory usage, depending on what problem you're trying to
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen address.</p>
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen
8a373a7c7f3097912691a5dc917ef85039cd5598rbowen <p>Reload the <code>server-status</code> page, and look for those process
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen ids, and you'll be able to see what request is being served by that
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen process, for what client. Requests are transient, so you may need to
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen try several times before you catch it in the act, so to speak.</p>
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen <p>This process <em>should</em> give you some idea what client, or
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen what type of requests, are primarily responsible for your load
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen problems. Often you will identify a particular web application that
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen is misbehaving, or a particular client that is attacking your
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen site.</p>
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen</section>
32360f3c865c75b35e954385a4b7cadba7b1af9brbowen
3b40d219e6e756e68d1b7a4dd9489f9ef7bdbabcrbowen</modulesynopsis>