You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Supun Abeysinghe <su...@cse.mrt.ac.lk> on 2019/04/26 05:25:24 UTC

Internals of Tomcat Thread Pool

Hi all,


I am working on a project which tries to tune the Tomcat thread pool
dynamically by looking at runtime characteristics in order to enhance the
system performance. To get a better understanding, I have gone through the
Tomcat source code and found out that it uses ThreadPoolExecutor. It maps
minSpareThreads parameter to corePoolSize and maxThreads parameter to
specify the maximum thread pool size. However, I'm having trouble
understanding how to specify the queue length. This is not the acceptCount.
I'm talking about the size of the BlockingQueue (work queue) which is used
inside the ThreadPoolExecutor. As per my understanding, the BlockingQueue
(work queue) and the request queue (of which the size is specified using
the acceptCount parameter) are two different queues (am I wrong here? are
both the same?).

My Question is, how to specify the length of the BlockingQueue (work queue)
using Tomcat parameters? Is there any JMX MBean that reports this queue
size?


Any pointers, help, and suggestions are welcome.

Best regards,
Supun


-- 
*Supun Abeysinghe*
Undergrad, Department of Computer Science and Engineering,
University of Moratuwa, Faculty of Engineering.
+94717018897
<https://lk.linkedin.com/pub/supun-abeysinghe/109/3a4/554>

Re: Internals of Tomcat Thread Pool

Posted by Mark Thomas <ma...@apache.org>.
On 26/04/2019 06:25, Supun Abeysinghe wrote:
> Hi all,
> 
> 
> I am working on a project which tries to tune the Tomcat thread pool
> dynamically by looking at runtime characteristics in order to enhance the
> system performance. To get a better understanding, I have gone through the
> Tomcat source code and found out that it uses ThreadPoolExecutor. It maps
> minSpareThreads parameter to corePoolSize and maxThreads parameter to
> specify the maximum thread pool size. However, I'm having trouble
> understanding how to specify the queue length. This is not the acceptCount.
> I'm talking about the size of the BlockingQueue (work queue) which is used
> inside the ThreadPoolExecutor. As per my understanding, the BlockingQueue
> (work queue) and the request queue (of which the size is specified using
> the acceptCount parameter) are two different queues (am I wrong here? are
> both the same?).
> 
> My Question is, how to specify the length of the BlockingQueue (work queue)
> using Tomcat parameters? Is there any JMX MBean that reports this queue
> size?

StandardThreadExectuor
maxQueueSize

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org