Arequest processing thread might also be instructed to send the request to a dierent thread
poolfor processing. For example, if the request processing thread must perform some work that
isnot thread-safe, it might be instructed to send part of the processing to the NativePool. Once
theNativePool completes its work, it communicates the result to the request processing thread
andthe request processing thread continues processing the request.
Atstartup, the server only creates the number of threads dened in the thread pool minimum
threads,by default 16. As the load increases, the server creates more threads. The policy for
addingnew threads is based on the connection queue state.
Eachtime a new connection is returned, the number of connections waiting in the queue (the
backlogof connections) is compared to the number of request processing threads already
created.If the number of connections waiting is greater than the number of threads, more
threadsare scheduled to be added the next time a request completes.
Theprocess of adding new session threads is strictly limited by the maximum threads value. For
moreinformation on maximum threads, see “Maximum Threads (Maximum Simultaneous
Requests)”on page 58.
Youcan change the settings that aect the number and timeout of threads, processes, and
connectionsin the Admin Console, on the conguration's Performance tab (HTTP settings),
andon the HTTP listener. You can also use the wadm commands set-thread-pool-prop and
set-http-listener-propand set-keep-alive-prop.
LowLatency and High Concurrency Modes
Theserver can run in one of two modes, depending upon the load. It changes modes to
accommodatethe load most eciently.
Inlow latency mode, for keep-alive connections, session threads themselves poll for new
requests.
Inhigh concurrency mode, after nishing the request, session threads give the connection to
thekeep-alive subsystem. In high concurrency mode, the keep-alive subsystem polls for new
requestsfor all keep-alive connections.
Whenthe server is started, it starts in low latency mode. When the load increases, the server
movesto high concurrency mode. The decision to move from low latency mode to high
concurrencymode and back again is made by the server, based on connection queue length,
averagetotal sessions, average idle sessions, and currently active and idle sessions.
DisabledThread Pools
Ifa thread pool is disabled, no threads are created in the pool, no connection queue is created,
andno keep-alive threads are created. When the thread pool is disabled, the acceptor threads
themselvesprocess the request.
UnderstandingThreads,Processes, and Connections
Chapter2 • Tuning Sun Java System Web Server 41