使用 Java Visual VM:我可以看到将近 100 个线程处于 WAIT 状态。
在 JBoss Server.xml 我有:
<!-- A HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" address="${jboss.bind.address}"
maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
emptySessionPath="true"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"/>
我在 Jboss-Service.xml 中有一个 ThreadPool,如下所示:
<mbean code="org.jboss.util.threadpool.BasicThreadPool"
name="jboss.system:service=ThreadPool">
<attribute name="Name">JBoss System Threads</attribute>
<attribute name="ThreadGroupName">System Threads</attribute>
<attribute name="KeepAliveTime">60000</attribute>
<attribute name="MaximumPoolSize">10</attribute>
<attribute name="MaximumQueueSize">1000</attribute>
<attribute name="BlockingMode">run</attribute>
</mbean>
在 Thread Dump 中,大多数线程处于以下状态:
"http-0.0.0.0-8180-97" - Thread t@7296
java.lang.Thread.State: WAITING
at java.lang.Object.wait(Native Method)
- waiting on <23791834> (a org.apache.tomcat.util.net.MasterSlaveWorkerThread)
at java.lang.Object.wait(Object.java:485)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.await(MasterSlaveWorkerThread.java:81)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:107)
at java.lang.Thread.run(Thread.java:619)
Java Visual VM 还列出了非常高的 Daemon Threads Live: 176 Daemon: 171
我正在使用 JBoxx 4x