2014-09-12 87 views
0

我在JBoss7.1.1.Final上配置了一个AJP连接器。我分配一个线程池,该连接器蒙山一些“坏”的配置:jboss 7域:线程配置

<bounded-queue-thread-pool name="ajp-executor"> 
    <core-threads count="10" per-cpu="20"/> 
    <queue-length count="10" per-cpu="20"/> 
    <max-threads count="10" per-cpu="20"/> 
    <keepalive-time time="10" unit="seconds"/> 
</bounded-queue-thread-pool> 

我关闭和启动我的JBoss和standalone.xml想出了另一种配置:

<bounded-queue-thread-pool name="ajp-executor"> 
    <core-threads count="90"/> 
    <queue-length count="90"/> 
    <max-threads count="90"/> 
    <keepalive-time time="10" unit="seconds"/> 
</bounded-queue-thread-pool> 

这是一个正确的。好吧,JBoss删除了“坏”配置。但是,为什么计数是90? JBoss如何计算这个值?

回答

0

我看过的许多例子都有一个count和per-cpu属性集,就像在你的配置中一样,我一直在试图弄清楚这到底意味着什么。看看这个网页:https://developer.jboss.org/wiki/ThreadPoolConfiguration

per-cpu - 可选的float属性;指定的数量是 乘以可用的CPU数量。这两个数量然后是 增加和最终结果是使用的实际计数。 - 多见于: https://developer.jboss.org/wiki/ThreadPoolConfiguration#sthash.OH93iLwC.dpuf

因此,我认为正在发生的事情是它走20的“每个CPU”属性和乘以4(假定你有四个CPU?),以获得80和然后加上你的“计数”得到总数为90.

10 + (20 * 4) = 90