我已经在JBoss7.2.0 standalone.xml中创建了一个有界队列线程池,如下所示:
<subsystem xmlns="urn:jboss:domain:threads:1.1">
<bounded-queue-thread-pool name="myThreadPool">
<core-threads count="6000"/>
<queue-length count="1000"/>
<max-threads count="6000"/>
<keepalive-time time="60" unit="seconds"/>
</bounded-queue-thread-pool>
</subsystem>在此之后,我将此作为AJP连接器中的执行器,如下所示:
<connector name="conn1" protocol="AJP/1.3" scheme="http" socket-binding="conn1" enabled="true" max-post-size="0" executor="myThreadPool" max-connections="2000"/>
<connector name="conn2" protocol="AJP/1.3" scheme="http" socket-binding="conn2" enabled="true" executor="myThreadPool" max-connections="2000"/>
<connector name="conn3" protocol="AJP/1.3" scheme="http" socket-binding="conn3" enabled="true" executor="myThreadPool" max-connections="2000"/>在最后,三个连接器的套接字绑定:
<socket-binding name="conn1" port="15007"/>
<socket-binding name="conn2" port="15008"/>
<socket-binding name="conn3" port="15009"/>当我启动jboss并创建多个http请求时,每个请求线程都被创建为myThreadPool-threads-1、myThreadPool-threads-2等。但是,当我使用命令行关闭jboss时,这些线程不会终止。下面是我用来关闭的命令:
%JBOSS_HOME%\bin\jboss-cli.bat --connect controller=10.10.54.85:9999 --commands=:shutdown由于这个原因,jboss的java进程没有被杀死。但是,当我简单地从executor中删除connector时,java进程就被成功地终止了。有人能建议我在服务器关机时如何终止threadPool的所有线程吗?
发布于 2014-11-03 22:09:43
这只虫子可能是造成您的问题的原因之一,解决方法是:
org.apache.coyote.ajp.DEFAULT_CONNECTION_TIMEOUT将以下内容添加到system-properties中的host.xml、standalone.xml或domain.xml中
<system-properties>
<property name="org.apache.coyote.ajp.DEFAULT_CONNECTION_TIMEOUT" value="600000"/>
<system-properties>这是可行的,除非我们不断地向服务器发送请求。
https://stackoverflow.com/questions/26716551
复制相似问题