Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat thread pool? Commented out in tomcat.conf, should I use it?

I really don't consider myself a java or tomcat expert. I have a vps with tomcat running on it. In the tomcat.conf file there is the following.

Notice that the Excecutor 'tomcatThreadPool' and corresponding Connector referencing that Executor is commented out.

At the risk of sounding very stupid...I'm going to ask this question...

With the Executor and Connector commented out, how are my servlets functioning? In other words, are they using a default thread pool? Or should I uncomment the Executor and Connector for servlet efficiency?

I guess I'm not very knowledgeable in this area at all....

<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-" 
    maxThreads="150" minSpareThreads="4"/>
-->

<Connector port="8080" protocol="HTTP/1.1" 
           connectionTimeout="20000" 
           redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
           port="8080" protocol="HTTP/1.1" 
           connectionTimeout="20000" 
           redirectPort="8443" />
-->
like image 465
katura Avatar asked Mar 08 '12 22:03

katura


1 Answers

The Tomcat documentation of Executor says (emphasis is mine):

The Executor represents a thread pool that can be shared between components in Tomcat. Historically there has been a thread pool per connector created but this allows you to share a thread pool, between (primarly) connector but also other components when those get configured to support executors

So, you don't have to uncomment anything for Tomcat to work efficently, the Executor is for special needs as using more than one executor or using some thread pool yourself.

The referenced tomcat page is in the first results if you google "Tomcat Executor", by the way.

like image 195
madth3 Avatar answered Oct 27 '22 22:10

madth3