我想知道在哪里可以增加 Jboss AS 6.1.0.Final
中的最大
线程
计数。
我通过谷歌浏览但找不到确切的答案,并且其中提到的文件和位置不正确。
最佳答案
这是通过 Tomcat Executor 完成的。详情可阅读Thread Pool Configuration in AS 6.x 。
可以编写一个独立的描述符,其名称为“jboss-threads.xml”或以“jboss-threads.xml”结尾。这种描述符的格式如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<threads xmlns="urn:jboss:threads:2.0">
<thread-factory name="MyThreadFactory" thread-name-pattern="My Thread %t">
<thread-group name="MyThreadGroup"/>
</thread-factory>
<!-- This is the Executor instance -->
<thread-factory-executor name="MyExecutor">
<thread-factory name="MyThreadFactory"/>
<max-threads count="100" per-cpu="100"/>
</thread-factory-executor>
</threads>
<小时/>
或者:您可以将其包含在微容器部署中。
由于微容器处理 XML 部署的方式,可以在常规 POJO 部署中包含线程描述符,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<!-- JBossMC elements here -->
<threads xmlns="urn:jboss:threads:2.0">
<thread-factory name="MyThreadFactory" thread-name-pattern="My Thread %t">
<thread-group name="MyThreadGroup"/>
</thread-factory>
<!-- This is the Executor instance -->
<thread-factory-executor name="MyExecutor">
<thread-factory name="MyThreadFactory"/>
<max-threads count="100" per-cpu="100"/>
</thread-factory-executor>
</threads>
</deployment>
关于java - 更改最大http线程数jboss AS6.1.0.Final,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20088005/