java - 更改最大http线程数jboss AS6.1.0.Final

标签 java http jboss6.x httpconnection

我想知道在哪里可以增加 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/

相关文章:

java - 如何编写一个以通用方式接受迭代器或集合的函数?

http - wget 说 406 Not Acceptable

java - 同时获取多个 HTML 页面的有效方法

jms - 两个 HornetQ 服务器之间的 HornetQ JMS 桥无法交付

axis2 - JBoss6.1 和 Axis2 兼容性问题

java - C客户端与Java服务器通信错误

java - 是否有办法关闭 Java EE 1.4 JSP 中的注释?

java - Jakson 多态枚举案例

c# - UrlPathEncode() 替代方案

java - 如何设置自定义主体类