<summary>
- <p>The Performance Tuning page in the Apache 1.3 documentation says:
+ <p>The Performance Tuning page in the Apache HTTP Server 1.3 documentation says:
</p>
<blockquote><p>
- "Apache is a general webserver, which is designed to be
+ "httpd is a general webserver, which is designed to be
correct first, and fast
second. Even so, its performance is quite satisfactory. Most
sites have less than 10Mbits of outgoing bandwidth, which
- Apache can fill using only a low end Pentium-based
+ httpd can fill using only a low end Pentium-based
webserver."</p>
</blockquote>
<p>However, this sentence was written a few years ago, and in the
gather information about its performance, or lack thereof.
We'll assume that you don't have an unlimited budget for
server hardware, so the existing infrastructure will have to do the
- job. You have no desire to compile your own Apache, or to recompile
+ job. You have no desire to compile your own httpd, or to recompile
the operating system kernel. We do assume, though, that you have
some familiarity with the Apache httpd configuration file.
</p>
</title>
<p>The mod_status module gives an overview of the server
performance at a given moment. It generates an HTML page
- with, among others, the number of Apache processes running
+ with, among others, the number of httpd processes running
and how many bytes each has served, and the CPU load caused
by httpd and the rest of the system. The Apache Software
Foundation uses <module>mod_status</module> on its own
<p>On a server that is visible to the Internet, expect to see a
lot of exploit attempt and worm attacks in the error log. A
lot of these will be targeted at other server platforms
- instead of Apache, but the current state of affairs is that
+ instead of httpd, but the current state of affairs is that
attack scripts just throw everything they have at any open
port, regardless of which server is actually running or
what applications might be installed. You could block these
<p>-</p>
</td>
<td>
- <p>Remote username as authenticated by Apache</p>
+ <p>Remote username as authenticated by httpd</p>
</td>
</tr>
<tr>
<p>This approach also works on Windows, just not as smoothly.
While the httpd process on your Windows server will keep
writing to the log file after it has been renamed, the
- Windows Service that runs Apache can not do a graceful
+ Windows Service that runs httpd can not do a graceful
restart. Restarting a Service on Windows means stopping it
and then starting it again. The advantage of a graceful
restart is that the httpd child processes get to complete
</example>
<p>The program on the other end of the pipe will receive the
- Apache log data on its stdin stream, and can do with this
+ httpd log data on its stdin stream, and can do with this
data whatever it wants. The rotatelogs program that comes
- with Apache seamlessly turns over the log file based on
+ with httpd seamlessly turns over the log file based on
time elapsed or the amount of data written, and leaves the
old log files with a timestamp suffix to its name. This
method for rotating logfiles works well on unix platforms,
<section id="logging-and-performance">
<title>Logging and Performance
</title>
- <p>Writing entries to the Apache log files obviously takes some
+ <p>Writing entries to the httpd log files obviously takes some
effort, but the information gathered from the logs is so
valuable that under normal circumstances logging should not
be turned off. For optimal performance, you should put your
to make httpd print the hostname of the virtual host that
received the request or the error at the beginning of each
log line. A simple Perl script can split out the log file
- after it rotates: one is included with the Apache source
+ after it rotates: one is included with the httpd source
under <code>support/split-logfile</code>.
</p>
<p>
You can use the <directive module="mod_log_config">BufferedLogs</directive>
- directive to have Apache collect several log lines in
+ directive to have httpd collect several log lines in
memory before writing them to disk. This might yield better
performance, but could affect the order in which the
server's log is written.
test load against your web server.
</p>
<ul>
- <li>Apache ships with a test program called ab, short for
+ <li>httpd ships with a test program called ab, short for
Apache Bench. It can generate a web server load by
repeatedly asking for the same file in rapid succession.
You can specify a number of concurrent connections and have
</li>
<li>
<p>ASF external projects, that have proven to be quite
- good: grinder, httperf, tsung, <a href="http://funkload.nuxeo.org/">FunkLoad</a>
+ good: grinder, tsung
</p>
</li>
</ul>
<section id="apache-configuration">
<title>Httpd Configuration
</title>
- <p>The Apache 2.2 httpd is by default a pre-forking web server.
+ <p>The httpd 2.2 server is by default a pre-forking web server.
When the server starts, the parent process spawns a number of
child processes that do the actual work of servicing requests.
- But Apache httpd 2.0 introduced the concept of the
+ But httpd 2.0 introduced the concept of the
Multi-Processing Module (MPM). Developers can write MPMs to
suit the process- or threadingarchitecture of their specific
- operating system. Apache 2 comes with special MPMs for Windows,
+ operating system. httpd 2 comes with special MPMs for Windows,
OS/2, Netware and BeOS. On unix-like platforms, the two most
popular MPMs are Prefork and Worker. The Prefork MPM offers the
- same pre-forking process model that Apache 1.3 uses. The Worker
+ same pre-forking process model that httpd 1.3 uses. The Worker
MPM runs a smaller number of child processes, and spawns
multiple request handling threads within each child process. In
2.4 MPMs are no longer hard-wired. They too can be exchanged
</code>
and <code>MaxSpareServers
</code>
- ,which specify the number of workers Apache keeps waiting
+ ,which specify the number of workers httpd keeps waiting
in the wings ready to serve requests. The absolute maximum
number of processes is configurable through the <code>
ServerLimit
complicated. Threaded MPMs support the <code>
ThreadsPerChild
</code>
- directive1 . Apache requires that <code>MaxClients</code>
+ directive1 . httpd requires that <code>MaxClients</code>
is evenly divisible by <code>ThreadsPerChild
</code>
.If you set either directive to a number that doesn't
- meet this requirement, Apache will send a message of
+ meet this requirement, httpd will send a message of
complaint to the error log and adjust the <code>
ThreadsPerChild
</code>
<p>The difference between these two is the amount of memory
per-process. The shared segment really exists only once and
is used for the code and libraries loaded and the dynamic
- inter-process tally, or 'scoreboard,' that Apache
+ inter-process tally, or 'scoreboard,' that httpd
keeps. How much memory each process takes for itself
depends heavily on the number and kind of modules you use.
The best approach to use in determining this need is to
<p>This has been a sore point within the PHP community. The PHP
processor heavily relies on third-party libraries and
cannot guarantee that all of these are thread-safe. The
- good news is that if you are running Apache on Linux, you
+ good news is that if you are running httpd on Linux, you
can run PHP in the preforked MPM without fear of losing too
much performance relative to the threaded option.
</p>
the server may exhibit the Thundering Herd syndrome.
</p>
<p>Consider an American Football team poised on the line of
- scrimmage. If the football players were Apache processes
+ scrimmage. If the football players were httpd processes
all team members would go for the ball simultaneously at
the snap. One process would get it, and all the others
would have to lumber back to the line for the next snap. In
avoid it whenever possible. Hence the revolving door
construction. In recent years, many operating systems,
including Linux and Solaris, have put code in place to
- prevent the Thundering Herd syndrome. Apache recognizes
+ prevent the Thundering Herd syndrome. httpd recognizes
this and if you run with just one network listener, meaning
- one virtual host or just the main server, Apache will
+ one virtual host or just the main server, httpd will
refrain from using an accept mutex. If you run with
multiple listeners (for instance because you have a virtual
host serving SSL requests), it will activate the accept
manipulate them with care.
</p>
<p>There is no compelling reason to disable the accept mutex.
- Apache automatically recognizes the single listener
+ httpd automatically recognizes the single listener
situation described above and knows if it is safe to run
without mutex on your platform.
</p>
</title>
<p>The usual mantra regarding RAM is "more is
better". As discussed above, unused RAM is put to good
- use as file system cache. The Apache processes get bigger
+ use as file system cache. The httpd processes get bigger
if you load more modules, especially if you use modules
that generate dynamic page content within the processes,
like PHP and mod_perl. A large configuration file-with many
virtual hosts-also tends to inflate the process footprint.
- Having ample RAM allows you to run Apache with more child
+ Having ample RAM allows you to run httpd with more child
processes, which allows the server to process more
concurrent requests.
</p>
<title>ulimit: Files and Processes
</title>
<p>Given a machine with plenty of RAM and processor capacity,
- you can run hundreds of Apache processes if necessary. . .
+ you can run hundreds of httpd processes if necessary. . .
and if your kernel allows it.
</p>
<p>Consider a situation in which several hundred web servers
</example>
<p>command. Once again, this must be done prior to starting
- Apache.
+ httpd.
</p>
will show which services are enabled and disable them
respectively.
</p>
- <p>In a similar fashion, cast a critical eye on the Apache
- modules you load. Most binary distributions of Apache
- httpd, and pre-installed versions that come with Linux
+ <p>In a similar fashion, cast a critical eye on the httpd
+ modules you load. Most binary distributions of httpd, and pre-installed versions that come with Linux
distributions, have their modules enabled through the
<directive>LoadModule</directive> directive.
</p>
Valentine's Day. When the user searches for red roses,
they are served the pre-rendered page. Queries for, say, yellow
roses will be generated directly from the database. The
- mod_rewrite module included with Apache is a great tool to
+ mod_rewrite module included with httpd is a great tool to
implement these substitutions.
</p>
</example>
<p>This can be run periodically from Cron, after you upload
- content, etc. To make Apache substitute the statically
+ content, etc. To make httpd substitute the statically
rendered pages for the dynamic content, we'll use
- mod_rewrite. This module is included with the Apache source
+ mod_rewrite. This module is included with the httpd source
code, but is not compiled by default. It can be built with
the server by passing the option <code>--enable-rewrite[=shared]</code>
to the configure command. Many binary distributions of
- Apache come with <module>mod_rewrite </module> included. The following is an
- example of an Apache virtual host that takes advantage of
+ httpd come with <module>mod_rewrite </module> included. The following is an
+ example of an httpd virtual host that takes advantage of
pre-rendered blog pages:
</p>