简体   繁体   English

如果未在server.xml中定义,Tomcat将创建多少个线程

[英]how many threads Tomcat create if i dont define in server.xml

I am using Tomcat 7 我正在使用Tomcat 7

I just now installed Tomcat to serve dynamic contents and my apache for php to serve static contents. 我刚刚安装了Tomcat以提供动态内容,并为php提供了apache以提供静态内容。

while trying to do optimisation, I Was just looking into Server.xml and found below configuration. 在尝试进行优化时,我只是查看Server.xml并发现以下配置。

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

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

tomcatThreadPool is commented and it is not used in connector so what it means to me is my tomcat is not considering above setup and not limiting the maxThreads = 150. tomcatThreadPool已注释并且未在连接器中使用,所以对我而言,这意味着我的tomcat不考虑上述设置并且不限制maxThreads = 150。

So just trying to understand if i keep setup as it is(commented executor) in server.xml then 所以只是试图了解我是否在server.xml中保持设置不变(注释执行程序)

  1. How many max threads my tomcat will create. 我的tomcat将创建多少个最大线程。
  2. and how many spare threads it will keep. 以及它将保留多少个备用线程。

If any experienced tomcat admin could you please share some info. 如果有经验的tomcat管理员,您可以分享一些信息。

Guys please dont guess, by looking at above config i can guess it my self. 伙计们请不要猜,通过查看上述配置,我可以猜到我自己。

Thank you in advance. 先感谢您。

Regards, Mona 蒙娜娜

By default for the HTTP connector, maxThreads is 200 and minSpareThreads is 10. That is, unless an other value is specified or you are using a Executor . 默认情况下,HTTP连接器的maxThreads为200, minSpareThreads为10。也就是说,除非指定了其他值或您正在使用Executor

See tomcat documentation for detail. 有关详细信息,请参见tomcat文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM