[Tomcat Tuning] Tomcat7 in question is equal to -1 maxThreads
2018-04-29 17:54:55 consumption of fish sauce number 2083 read more
Category Rubric: error Solution
Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/weixin_38278878/article/details/80144397
Today tune to the Tomcat server configuration is as follows:
<span style="color:#000000"><code><span style="color:#006666 !important"><<span style="color:#4f4f4f !important">Executor</span> <span style="color:#4f4f4f !important">name</span>=<span style="color:#009900 !important">"tomcatThreadPool"</span> <span style="color:#4f4f4f !important">namePrefix</span>=<span style="color:#009900 !important">"catalina-exec-"</span>
<span style="color:#4f4f4f !important">maxThreads</span>=<span style="color:#009900 !important">"500"</span> <span style="color:#4f4f4f !important">minSpareThreads</span>=<span style="color:#009900 !important">"5"</span> /></span>
<span style="color:#006666 !important"><<span style="color:#4f4f4f !important">Connector</span> <span style="color:#4f4f4f !important">executor</span>=<span style="color:#009900 !important">"tomcatThreadPool"</span> <span style="color:#4f4f4f !important">port</span>=<span style="color:#009900 !important">"8080"</span>
<span style="color:#4f4f4f !important">protocol</span>=<span style="color:#009900 !important">"org.apache.coyote.http11.Http11NioProtocol"</span>
<span style="color:#4f4f4f !important">connectionTimeout</span>=<span style="color:#009900 !important">"20000"</span> <span style="color:#4f4f4f !important">redirectPort</span>=<span style="color:#009900 !important">"8443"</span> /></span></code></span>
The maximum number of threads to the thread pool can hold 500, the minimum number of threads is set to inactive 5
The results are as follows:
The minimum number of threads set up, the maximum number of threads to -1; maxThreads changed after the default value of 200, 1000, etc., are displayed 1;
Is this attribute failure yet?
After testing, this property is in effect, set after 1, Current thread count (the current number of threads) will not exceed 1.
But why it shows -1? Check maxThreads property tomcat7 document:
The last sentence "Note that if an executor is configured any value set for this attribute will be recorded correctly but it will be reported (eg via JMX) as -1 to make clear that it is not used." When it comes to this situation, probably meaning:
if Executor a configuration, any value of the attribute to be set correctly recorded, but it is shown as -1
Toss over an hour, was laid bare.