Tomcat线程池设置

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
Executor表示在tomcat中各个组件可共享使用的线程池。以前一个connector使用一个线程池,但现在可以通过配置各个connector和组件共享使用同一个线程池。

The executor is a nested element to the Service  element. And in order for it to be picked up by the connectors, the Executor element has to appear prior to the Connector element in server.xml
Executor包含在Service里。在server.xml中Executor必须配置在Connector前,才能让connectors选择线程池。

threadPriority (int) The thread priority for threads in the executor, the default is Thread.NORM_PRIORITY
此executor中的线程的优先级

namePrefix (String) The name prefix for each thread created by the executor. The thread name for an individual thread will be namePrefix+threadNumber
线程名的前缀

maxThreads (int) The max number of active threads in this pool, default is 200
最大的线程数量

minSpareThreads (int) The minimum number of threads always kept alive, default is 25
最少的线程数量

maxIdleTime (int) The number of milliseconds before an idle thread shutsdown, unless the number of active threads are less or equal to minSpareThreads. Default value is 60000(1 minute)
关闭空闲线程达到最少线程数量的等待时间

    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="1000" minSpareThreads="50" maxIdleTime="600000"/> 

    <Connector executor="tomcatThreadPool" 
               port="80" protocol="HTTP/1.1"               
               connectionTimeout="20000" 
               redirectPort="8443" URIEncoding="UTF-8" enableLookups="false" />

你可能感兴趣的:(thread,tomcat,xml,UP)