As explained in the question Tomcat - maxThreads vs maxConnections, the maxThreads
attribute is the size of the Executor
used to process requests. No more than maxThreads
requests will be processed at the same time.
On Tomcat 8.5 and later all connector types also use an acceptor thread, which just accepts up to maxConnections
connections. Those connections that are beyond the limit remain in the operating system's queue (the acceptCount
attribute is a hint for the OS on the preferred size of such a queue).
However the rest of Tomcat Coyote's architecture is obviously different from that of the Oracle iPlanet Web Server and depends on the connector type used.
You can read the details of the NIO connector in this article. Basically:
the server reacts to network events by polling the sockets using Selector
s. This way one thread can service all the client connections.
there are only 3 threads dealing with the network I/O:
- the
Acceptor
, which only accepts new connections and sends them to the poller,
- the
Poller
, which responds to read/write events and dispatches them to the request executor,
- the
BlockPoller
, which disappeared in version 9.0.47 and dealt with blocking operations on the ServletInputStream
and ServletOutputStream
. The Poller
took its tasks.
there is no connection queue. The threads mentioned above just submit Runnable
tasks to the executor. Internally the executor has a queue of Runnable
s and each thread picks a task from there when it is free.