The keep-alive (or HTTP/1.1 persistent connection handling) subsystem in Sun Java System Web Server 6.1 is designed to be massively scalable. The out-of-the-box configuration can be less than optimal if the workload is non-persistent (that is, HTTP/1.0 without the KeepAlive header), or for a lightly loaded system that’s primarily servicing keep-alive connections.
There are several tuning parameters that can help improve performance. Those parameters are listed below:
acceptorthreads: Number of threads waiting to accept incoming connections on a given network port. This is specified per the listen socket (LS) element in server.xml.
ConnQueueSize: Size of the queue of active, ready-to-process connections.
RqThrottle: Number of worker threads in the server. Each thread parses and services a request from an active connection. Worker threads, in contrast with acceptor threads, service requests. The maximum number of worker threads is configured using RqThrottle. For more information, seeMaximum Simultaneous Requests
MaxKeepAliveConnections: This controls the maximum number of keep-alive connections the Web Server can maintain at any time. The default is 256. The range is 0 to 32768.
KeepAliveTimeout: This directive determines the maximum time (in seconds) that the server holds open an HTTP keep-alive connection or a persistent connection between the client and the server. The default is 30 seconds. The connection will timeout if idle for more than 30 seconds. The maximum is 300 seconds (5 minutes).
KeepAliveThreads: This directive determines the number of threads in the keep-alive subsystem. It is recommended that this number be a small multiple of the number of processors on the system (for example, a 2 CPU system should have 2 or 4 keep-alive threads). The default is 1.
KeepAliveQueryMaxSleepTime: Specifies an upper limit to the time slept (in milliseconds) after polling keep-alive connections for further requests. The default is 100. 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.
KeepAliveQueryMeanTime: Specifies the desired keep-alive latency in milliseconds. The default value of 100 is appropriate for almost all installations. Note that CPU usage will increase with lower KeepAliveQueryMeanTime values.
For more information about the Web Server’s keep-alive subsystem, seeKeep-Alive/Persistent Connection Information
For information about connection queue sizing, seeConnection Queue Information
Since HTTP/1.0 results in a large number of new incoming connections, the default acceptor threads of 1 per listen socket would be suboptimal. Increasing this to a higher number should improve performance for HTTP/1.0-style workloads. For instance, for a system with 2 CPUs, you may want to set it to 2.