Tuning the Keep-Alive Subsystem in Sun ONE Web Server 6.0
By by Jackson Thompson and Marina Sum with contributions from Chris Elving, April 1, 2003
This article focuses on one area of performance enhancement: how to tune the keep-alive subsystem in Sun ONE Web Server 6.0. For details, see the Sun ONE Web Server 6.0 Performance Tuning, Sizing, and Scaling Guide.
Keep-Alive Subsystem
Under certain conditions, the performance of Sun ONE Web Server 6.0 can be slower than that of earlier versions. This behavior is particularly visible when the Web Server serves a page with many inline images to only a few clients. The root cause can be attributed to the massively scalable keep-alive subsystem. When configured in the standard, out-of-the-box installation, the performance of Sun ONE Web Server 6.0 can be suboptimal in low-load conditions that rely heavily on keep-alive connections.
The next section explains the functions and settings of the keep-alive performance parameters.
Performance Parameters
The performance parameters reside in the
magnus.conf
file. The following table describes their functions and attributes.
Parameter Function Attributes MaxKeepAliveConnections
Controls the maximum number of keep-alive connections Sun ONE Web Server can maintain at any time. The default is 256. The range is 0 to 32,768. KeepAliveTimeout
Determines the maximum time (in seconds) that Sun ONE Web Server holds open an HTTP keep-alive connection or a persistent connection between the client and the server. The default is 30 seconds. The maximum is 300 seconds (five minutes). KeepAliveThreads
Determines the number of threads in the keep-alive subsystem. We recommend that you adjust this number to be a small multiple of the number of processors on your system. For example, assign two or four keep-alive threads to a two-CPU system. The default is 1. KeepAliveQueryMeanTime
(in Sun ONE Web Server 6.0, Service Pack 2 or above only)Specifies the desired keep-alive latency in milliseconds. On lower-load systems, you can lower this number to enhance performance. Doing so can increase CPU usage, however. The default is 100. KeepAliveQueryMaxSleepTime
(in Sun ONE Web Server 6.0, Service Pack 5 or above only)Sets an upper limit to the time slept (in milliseconds) after polling keep-alive connections for further requests. On lightly loaded systems that primarily service keep-alive connections, you can lower this number to enhance performance. Doing so can increase CPU usage, however. The default is 100 milliseconds. The range is 0 to 5,000 milliseconds.
KeepAliveQueryMeanTime
andKeepAliveQueryMaxSleepTime
control latency. Changing their values affects Sun ONE Web Server as follows:
- By lowering their settings, you lower the latency on lightly loaded systems. An example is reduced page load times.
- By raising their settings, you raise the aggregate throughput on heavily loaded systems. An example is an increased number of requests the server can handle. However, in the case of too much latency and too few clients, the server remains unnecessarily idle and causes aggregate throughput to deteriorate.
Hence, keep in mind the two general rules for tuning keep-alive subsystems at a particular load:
- In the event of idle CPU time, decrease the setting for
KeepAliveQueryMeanTime
andKeepAliveQueryMaxSleepTime
.- In the event of no idle CPU time, increase the setting for
KeepAliveQueryMeanTime
andKeepAliveQueryMaxSleepTime
.References
- Java BluePrints
- Adventure Builder Application Architecture, Early Access
- Designing Enterprise Applications with the J2EE Platform, Second Edition: See Chapters 3 and 4
About the Authors
Jackson Thompson is a developer for Sun ONE Web Server. During his career at Sun, Jackson also worked in Sustaining Engineering and Technical Support.
Chris Elving is a developer for Sun ONE Web Server. Previously, he contributed to the development of Sun ONE Application Server 7 and Sun ONE Web Server, versions 4.1 and 6.0.
Marina Sum is a staff writer for Sun ONE for Developers. She has been writing for Sun for 14 years, mostly in the technical arena.
Last changes: Friday, February 09, 2007 03:38:18 PM,
:P 2004 filibeto.org, site statistics, legal stuff