From 1a3860497a79a7dd6cce74c0bbaf37a2851ae6e5 Mon Sep 17 00:00:00 2001
From: Luca Toscano Apache 2.x is a general-purpose webserver, designed to
+ This document is partially out of date and might be inaccurate. Apache 2.4 is a general-purpose webserver, designed to
provide a balance of flexibility, portability, and performance.
Although it has not been designed specifically to set benchmark
- records, Apache 2.x is capable of high performance in many
+ records, Apache 2.4 is capable of high performance in many
real-world situations. Compared to Apache 1.3, release 2.x contains many additional
- optimizations to increase throughput and scalability. Most of
- these improvements are enabled by default. However, there are
- compile-time and run-time configuration choices that can
- significantly affect performance. This document describes the
- options that a server administrator can configure to tune the
- performance of an Apache 2.x installation. Some of these
- configuration options enable the httpd to better take advantage
- of the capabilities of the hardware and OS, while others allow
+ This document describes the options that a server administrator
+ can configure to tune the performance of an Apache 2.4 installation.
+ Some of these configuration options enable the httpd to better take
+ advantage of the capabilities of the hardware and OS, while others allow
the administrator to trade functionality for speed.sendfile
enables Apache 2 to deliver
+ available, sendfile
enables Apache to deliver
static content faster and with lower CPU utilization.
Prior to Apache 1.3, On
.
- This adds latency to every request because it requires a
- DNS lookup to complete before the request is finished. In
- Apache 1.3 this setting defaults to Off
. If you need
- to have addresses in your log files resolved to hostnames, use the
-
It is recommended that you do this sort of postprocessing of
+ causing an extra latency penalty for every request due to a
+ DNS lookup to complete before the request was finished.
+ In Apache 2.4 this setting defaults to Off
. If you need
+ to have addresses in your log files resolved to hostnames, please
+ consider post-processing rather than forcing Apache to do it in the first
+ place. It is recommended that you do this sort of post-processing of
your log files on some machine other than the production web
server machine, in order that this activity not adversely affect
server performance.
Please use the
Note that it's possible to scope the directives, such as
within a <Location "/server-status">
section.
@@ -153,7 +155,6 @@
except for .html
and .cgi
files:
Prior to Apache 1.3 the 5
would take on
- the order of 95 seconds to spawn enough children to handle
- the load. This works fine in practice on real-life servers
- because they aren't restarted frequently. But it does really
- poorly on benchmarks which might only run for ten minutes.
The one-per-second rule was implemented in an effort to
- avoid swamping the machine with the startup of new children. If
- the machine is busy spawning children, it can't service
- requests. But it has such a drastic effect on the perceived
- performance of Apache that it had to be replaced. As of Apache
- 1.3, the code will relax the one-per-second rule. It will spawn
- one, wait a second, then spawn two, wait a second, then spawn
- four, and it will continue exponentially until it is spawning
- 32 children per second. It will stop whenever it satisfies the
-
This appears to be responsive enough that it's almost
- unnecessary to twiddle the
Related to process creation is process death induced by the
- 0
,
- which means that there is no limit to the number of connections
- handled per child. If your configuration currently has this set
- to some very low number, such as 30
, you may want to bump this
- up significantly. If you are running SunOS or an old version of
- Solaris, limit this to 10000
or so because of memory leaks.
When keep-alives are in use, children will be kept busy - doing nothing waiting for more requests on the already open +
0
- unlimited). This affects all
+ the MPMs, even the ones using threads.
+ For example, each process created by the
When keep-alives are in use, a process (or a thread spawned by a process)
+ will be kept busy doing nothing but waiting for more requests on the already open
connection. The default 5
seconds attempts to minimize this effect. The tradeoff here is
- between network bandwidth and server resources. In no event
- should you raise this above about 60
seconds, as
- most of the benefits are lost.