Managing server performance for HTTP Server (powered by Apache)
In the IBM HTTP Server for i5/OS, you can manage your servers performance.
Information for this topic supports the latest PTF levels for HTTP Server for i5/OS . IBM recommends that you install the latest PTFs to upgrade to the latest level of the HTTP Server for i5/OS. Some of the topics documented here are not available prior to this update. See IBM Service for more information.
There are several things that can affect your server's performance. Consider the following performance related topics:
- Local cache
- Files to cache when server has started
- Threads
- DNS lookups
- Server-side includes
- Content negotiation
- Document tree
- .htaccess files
- Virtual host log files
- KeepAlive and KeepAliveTimeout
- Logging
- CGI programs
- TCP/IP settings
- Network
Parent topic:
HTTP Server tasks
Local cache
Enabling the HTTP Server's local cache can result in better performance and system throughput by caching (in memory) frequently accessed files. You can configure several settings associated with the local cache.
To configure the local cache settings, do the following:
- Click the Manage tab.
- Click the HTTP Servers subtab.
- Select your HTTP Server (powered by Apache) from the Server list.
- Select the Global configuration from the Server area list.
- Expand Server Properties.
- Click System Resources.
- Click the Caching tab in the form.
Enter or select options from this form. After you are finished, click OK.
Files to cache when server has started
Including file names in Files to cache when server is started causes the files to be loaded into the server's memory when the server is started.
- Copy into memory specifies the names of files that you want to load into the server's memory each time you start the server. By keeping your most frequently requested files loaded in the server's memory, you can improve your server's response time for those files. For example, if you load your server's welcome page into memory at startup, the server can handle requests for the page much more quickly than if it had to read the file from the file system.
- Keep file descriptor open specifies the names of ASCII stream files whose descriptors are cached at the server startup. By keeping your most frequently requested files opened at server startup, you can improve your server's response time for those files. For example, if you open your server's welcome page files at startup, the server can handle requests for the page much more quickly than if it had to open the files each time they are requested. The advantage of using this option over Copy into memory is it does not cache the content of the file and therefore does not allocate large amount of memory, yet provides similar performance. The disadvantage of using this option over Copy into memory is it only caches the file descriptors of ASCII stream files and it keeps the file open (share read) while the server is active.
- Memory map of file option is the same as Copy into memory except it uses memory address pointers, instead of simply using a chunk of server memory, to specify the names of files that you want to map into the server's memory each time that you start the server.
What to cache allows you to specify what information is included in the cache.
- Dynamically cache files based on file usage allows dynamic caching. The default value is off (or disabled).
- Update cache when files are modified updates the cache whenever its original file content changes. The default value is on (or enabled).
Enter or select options from this form. After you are finished, click OK.
Threads
Each time your server receives a client request, the server first checks to see if any threads are available and then uses available threads to process the request. If no threads are available, it holds the request until threads become available. When a request ends, the server threads become idle (at which point they are available for the server to use again).
The HTTP Server performance may increase by increasing the number of threads, but not the iSeries™ system performance.
Setting the maximum number of active threads too high can cause a decrease in system performance. You can experiment with lowering the maximum number of active threads until you see no affect on system performance. A good starting point would be half of the previous setting. For example, if you had the maximum number of active threads set to 100, try setting it to 50. Lowering the maximum number of active threads directive might result in an increased number of rejected connections when the server reaches its capacity.
To change the number of threads to process requests, do the following:
- Click the Manage tab.
- Click the HTTP Servers subtab.
- Select your HTTP Server (powered by Apache) from the Server list.
- Select the Global configuration from the Server area list.
- Expand Server Properties.
- Click System Resources.
- Click the Advanced tab in the form.
Enter or select options from this form. After you are finished, click OK.
DNS lookups
Every time the server needs to request a DNS lookup, there may be a delay while the DNS server is contacted. Limit the use of DNS lookups. Consider logging IP addresses and using a log analysis tool that does DNS lookups.
Server-side includes
Server performance can be impacted when server-side includes are processed. Limit the use of server-side includes except where needed.
Content negotiation
Restrict content negotiation to those contexts where it is needed.
Document tree
Try to organize your document tree into a flat broad tree structure rather than a narrow deep tree structure. The fewer directory levels the better.
For better performance, store static and Net.Data® files in the root (or /) file system. Avoid placing static and Net.Data files in the QSYS and QDLS file systems.
.htaccess files
Server performance is impacted if the server must look for and open .htaccess files. If the AllowOverride directive is set to None, the server does not look for .htaccess files. If AllowOverride is set to All, there is a significant performance impact as the server looks for .htaccess files in every directory.
Virtual host log files
If you create separate log files for each virtual host, you should consider that a file descriptor is opened for each log file. Opening too many file descriptors can impact system performance.
KeepAlive and KeepAliveTimeout
The connection time-out determines the number of seconds the server waits for a subsequent request before closing a persistent connection. Enabling persistent connections increases the throughput of your server. Consider decreasing the connection time-out if you have simple pages without images.
To set this value, do the following:
- Click the Manage tab.
- Click the HTTP Servers subtab.
- Select your HTTP Server (powered by Apache) from the Server list.
- Select the Global configuration from the Server area list.
- Expand Server Properties.
- Click System Resources.
- Click the HTTP Connections tab in the form.
- Enter a value for Connection time-out, or make a selection from the list.
- Enter a value for Maximum pending connections, or make a selection from the list.
- Select Enabled for Allow persistent connections.
- Enter a value for Time to wait between requests, or make a selection from the list.
- Enter a value for Maximum requests per connection, or make a selection from the list.
- Click OK.
Logging
Logging server activity does impact server performance. Try to do as little error and access logging as required.
CGI programs
CGI programs should be run in a named activation group to get the best performance. Also determine what CGI jobs your server generally uses. Use the StartCGI and StartThreadedCGI directives to start those jobs when the server starts. Use the QTMHHTP1 user profile to run CGI requests. If use a different user profile, use a "dummy" user profile (a user profile that is not allowed to sign-on) instead of %%CLIENT%%.
TCP/IP settings
See Adjusting your TCP/IP configuration for more information on TCP/IP settings.
Network
Consider that the performance of the network that your data flows across can also affect the perception of your server's performance.