I would like to know how tomcat connector threads use CPU resources and serve requests.
In my application, I set maxThreads=300, maxKeepAliveRequests=25, minSpareThreads=25.
My understand is that (NIO threads)
- when a connector thread is busy, it means it is working with a connection like creating connections, accepting requests, keeping the connection alive for other immediate requests through the same connection and closing the connection. A connection can also be closed if it receives "maxKeepAliveRequests" number of requests.
- when a connector thread is idle, it means it is waiting for connections and doing nothing. Such threads are killed when they exceed minSpareThreads?
- when a connector thread is waiting for something like IO or waiting for some application thread to give response, it can accept new connections.
Now, I was looking at these JMX mbeans values and found this: currentThreadCount.It is equal to 282.
What is this value?? From threadpool, I see these many number of http-nio threads are running. But it is far from the number of busy threads. See the below graph. I expected (currentThreadCount ~ Busy Threads + minSpareThreads), but it is far off and almost near to maxThreads
