Apache 2.0 includes performance enhancements that increase throughput and scalability. Most of these are enabled by default. In addition, on the Performance Tuning page in Apache Manager, you can change the configuration of Apache to best serve the needs for which you are using it.
Figure 3-3 Apache Performance Tuning
For example, you can increase the maximum number of threads allowed to run simultaneously if your Web server is getting a larger number of client visits. You can also disable the Keep Alive feature to restrict persistent connections, which some Web clients request when they connect to your server.
Because Apache is very self-regulating, most sites do not need to adjust the default values of any of the thread directives. However, if you need to make changes to any of the thread settings, continue reading.
For more information about thread directives, see ThreadStackSize directive on the Apache Web site.
NOTE:Because Apache for NetWare is multi-threaded, it does not use a separate process for each request, as Apache does in some Linux/UNIX implementations. Apache for NetWare uses a parent thread and multiple child threads, which handle all requests.
A thread stack is a piece of scratch memory that a thread uses to store information temporarily. If there is not enough stack space and the thread requires more in order to continue, the server abends. Intensive applications usually require more stack space. Modules such as mod_perl or mod_php might require a thread to yield more stack space. However, 65,536 bytes is typically large enough.
Keep in mind that increasing the stack size consumes more system resources because each thread requires a certain amount of space. Therefore, increasing the stack size should be done only after considering what is required based on the applications and modules that are being used.
The ThreadStackSize directive tells the server what stack size to use for each running thread. If a stack overflow occurs, you need to increase this number.
On the Performance Tuning page, specify a numerical value in the
field.The default is 65536.
Click
> to save your changes.or
Click
> to save your changes and restart Apache so your changes are immediately put into effect.For information about where configuration information is stored, see Section 2.3.3, Saving Configuration Changes and Restarting Apache in Apache Manager.
The StartThreads directive specifies the number of child server processes that are to be created when the Web server is started. Because the number of processes is dynamically controlled according to system load, there is usually little reason to adjust this parameter.
On the Performance Tuning page, specify a numerical value in the
field.The default is 50.
Click
> to save your changes.or
Click
> to save your changes and restart Apache so your changes are immediately put into effect.For information about where configuration information is stored, see Section 2.3.3, Saving Configuration Changes and Restarting Apache in Apache Manager.
The MinSpareThreads directive defines the minimum number of idle threads set aside to process surges in client requests to the Web server.
Different multiprocessing modules (MPMs) deal with this directive differently. On NetWare, the mpm_netware module is used to control all of the threading directives and functionality.
On the Performance Tuning page, specify a numerical value in the
field.The default is 10.
Click
> to save your changes.or
Click
> to save your changes and restart Apache so your changes are immediately put into effect.For information about where configuration information is stored, see Section 2.3.3, Saving Configuration Changes and Restarting Apache in Apache Manager.
The MaxSpareThreads directive lets you define the maximum number of idle threads allowed. Again, different MPMs deal with this directive differently. On NetWare, the mpm_netware module is used. Therefore, this directive tracks the minimum spare threads value on a server-wide basis.
On the Performance Tuning page, specify a numerical value in the
field.The default is 75.
Click
> to save your changes.or
Click
> to save your changes and restart Apache so your changes are immediately put into effect.For information about where configuration information is stored, see Section 2.3.3, Saving Configuration Changes and Restarting Apache in Apache Manager.
The MaxThreads directive specifies the maximum number of worker threads allowed.
On the Performance Tuning page, specify a numerical value in the
field.The default is 250.
Click
> to save your changes.or
Click
> to save your changes and restart Apache so your changes are immediately put into effect.For information about where configuration information is stored, see Section 2.3.3, Saving Configuration Changes and Restarting Apache in Apache Manager.
Keep Alive provides live HTTP sessions that allow multiple requests to be sent over the same TCP connection. In some cases this has been shown to result in an almost 50% increase in latency times for HTML documents with many images.
To modify Keep Alive settings:
On the Performance Tuning page, click
for , then adjust the following settings as needed:Maximum Keep Alive Requests: When Keep Alive is enabled, it limits the number of requests allowed per connection. The default setting is 100. For maximum server performance, increase this setting until desired performance is reached.
Entering 0 (zero) in the MaxKeepAliveRequests directive on the Apache Web site.
field allows an unlimited amount of connections. (SeeKeep Alive Timeout: The KeepAliveTimeout directive lets you specify (in seconds) how long Apache waits for a subsequent request before closing a TCP connection. After a request has been received, the timeout value specified by this directive applies.
Setting
to a high value can cause performance problems for heavily loaded servers. The higher the timeout, the more server processes are kept busy waiting on connections with idle clients.or
Click
.Click
> to save your changes.or
Click
> to save your changes and restart Apache so your changes are immediately put into effect.For information about where configuration information is stored, see Section 2.3.3, Saving Configuration Changes and Restarting Apache in Apache Manager.
When enabled, the HostnameLookups directive records the names of clients or their IP addresses, for example www.apache.org (when on, or enabled) or 172.16.5.18 (when off, or disabled).
The default is set to
. This is because when this directive enabled, every client request would result in at least one lookup request to the nameserver, causing unnecessary congestion on DNS servers and the Internet.For additional information about DNS issues on Apache, see Issues Regarding DNS and Apache on the Apache Web site.
You can also adjust the settings of the Mod_Cache module. For more information about Mod_Cache, see Section 5.0, Managing Apache Modules.
For additional information about performance tuning, see Apache Performance Tuning on the Apache Web site.