Configuring and tuning IBM HTTP Server (IHS)
Authors: HongyanHuo, GrantCovellBuild basis: CLM 3.x, CLM 4.x
This article explains some of the strategies for configuring and tuning IHS.
Sample output of
Enable the IHS server-status page by adding an
Apache.org makes a sample page available at http://www.apache.org/server-status.
Check an individual process with child threads
Introduction
IHS is based on the Apache HTTP Server. In the CLM standard topologies, IHS also functions as reverse proxy server. A reverse proxy server provides a layer of indirection for backend application servers, and can provide load balancing at the http server tier to other application servers. This article introduces some monitoring and tuning techniques. Generally, tuning is not always necessary as the default IHS settings are designed to handle reasonable load. However symptoms of poor performance include IHS crashing and CPU thrashing.| Diagnosing and troubleshooting IHS server problems may be out-of-scope for most Jazz administrators. These tasks may be better performed by Web server administrators. Do not make changes to IHS configurations without making backups first. Do not make changes to IHS configurations without consulting your Web server administrators. |
The IHS directives and what they mean
The tunable IHS directives live in thehttpd.conf in the \config directory. Always backup the httpd.conf file before making a change (rename it to httpd.conf.bak for example). After making changes, you will need to restart IHS for changes to take effect. All numeric values must be positive, non-zero integers.
Multi-Processing Module (aka MPM) directives
MaxClients is a key factor that defines how much load IHS can serve. MaxClients is not the same as maximum number of users served. MaxClients is a soft limit to control the simultaneous connections or threads. Changing this value doesn't mean IHS will deny new or additional user requests. Requests over this value will be put in queue until there are available threads.
-
MaxClientsis recommended to be set lower than 2000 for a single IHS server. Monitor the number of bsy threads (see "section IHS error logs" below) to determine the peak of the simutanous connections based on your typical load, and then add 25% as a secure factor to set the value of MaxClients.
- Note that on Windows there is no
MaxClientsdirective and thatThreadsPerChildis used instead.
ServerLimit, ThreadsPerChild, ThreadsLimit along with MaxClients affect the capability of IHS in handling loads. To tune these, start with ThreadsPerChild and consider platform, plugin, SSL and caching. A higher ThreadsPerChild can benefit the WebSphere plugin, but the trade-off compensates CPU for SSL.
-
ThreadsPerChilddefault is 25.
-
ThreadsLimitshould equalThreadsPerChild.
-
ServerLimitshould be equal toMaxClientsdivided byThreadsPerChildrounded to nearest integer. Ideally, changeMaxClientsso that it equalsServerLimitmultiplied byThreadsPerChildwithout any fractions. IfServerLimitmultiplied by 25 is greater than the amount of available RAM, lowerMaxClientsand readjustServerLimit.
StartServers, MaxSpareThreads, MinSpareThreads determine how IHS reacts when load varies.
-
MinSpareThreadsshould not exceed the value of 25 or 10% ofMaxClients.
-
MaxSpareThreadscan be increased in step withMaxClients.
-
StartServersis best to leave at default of 1.
MaxRequestsPerChild can remain at the default of 0.
Other considerations
Modules that are not in use should be unloaded to reduce IHS memory footprint.| Optimizing KeepAlive, KeepAliveTimeOut and MaxKeepAliveRequests can be very helpful to improve the performance as well. Plugin parameters may also be taken into account for fine-tuning, if the WebSphere web server plugin modules are configured. |
| Note that the tuning highly depends on the actual server environment and the load. Use the suggested values above as a starting point and follow the tuning practices to adjust them. Please refer to the documents in the section 'External link' for more details. |
IHS server settings
System resources
On a linux system be sure that there are enough user processes allowed. You may need to increase themax user processes setting using this command:
ulimit -u 65536Also decrease the stack size. 512 MB is sufficient for CLM apps:
#add this line into the envvar file under folder /conf ulimit -s 512
Tools and tips
IHS error logs
Ordinarilly, IHS logging is enabled by default. In test systems, you may wish to disable the access_log to save disk space. To do this comment out the following in the httpd.conf fileCustomLog logs/access_log commonHowever, for production environment, consider the options for effectively managing log files http://httpd.apache.org/docs/2.2/logs.html. IHS error logs live in the
/logs directory. The frequency they are written to is controlled by the mpmstats module which is automatically enabled in IHS version 8.x. To obtain more accurate statistics, set the ReportInterval to a small value. For instance, set it to 60 (seconds).
Sample output of mpmstats:
[Mon Jun 04 14:32:00 2012] [notice] mpmstats: rdy 88 bsy 187 rd 0 wr 5 ka 160 log 0 dns 0 cls 22In the above example
bsy 187 indicates the busy threads and should be less than the MaxClients value.
Monitoring the log files closely by watching for [alert], [warn] and [error] messages can give you hints on what goes wrong, for example:
[Thu May 10 15:10:34 2012] [alert] (11)Resource temporarily unavailable: apr_thread_create: unable to create worker threadThe above message shows that IHS hits a resource limit and cannot create more threads. If the MPM modules are configured correctly (see section "The IHS directives and what they mean" above), it may be often remedied by reducing MaxClients or increasing the maximum user processes on the system. This link provides handful information for IHS trouble-shooting: http://publib.boulder.ibm.com/httpserv/ihsdiag/errorlog.html
Server status
Runtime monitoring is possible through the IHS server-status page, located athttp://your_server_name/server-status
Enable the IHS server-status page by adding an allow directive to the corresponding section of the httpd.conf.
Apache.org makes a sample page available at http://www.apache.org/server-status.
Useful commands on Linux
Watch open IHS processes with this command:ps -ylC httpdSort by process size:
ps -ylC httpd --sort:rssSort by parent process:
ps -ylC httpd --sort:ppid
Check an individual process with child threads
pstree -cp <pid>
Related topics: Deployment web home
External links:
- IBM article Using IBM HTTP Server 6.1 and later diagnostic capabilities with WebSphere
- IBM article on tuning IHS: IHS performance tuning
- IBM technote: Tuning IHS to maximize the number of client connections to WebSphere Application Server
- IBM IHS Q&A: IHS Questions and Answers
- IBM Infocenter IHS v8 Infocenter
- Apache.org article: Apache tuning
- IBM developerWorks article: Proxy server versus the HTTP plug-in: Choosing the best WebSphere Application Server workload management option
Additional contributors: None
Deployment.ConfiguringAndTuningIBMHTTPServer moved from Deployment.TuningIBMHTTPServer on 2013-11-30 - 17:18 by Main.sbeard -
Contributions are governed by our Terms of Use. Please read the following disclaimer.
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.