connection_pool_size和tp-processor之间的关系?

时间:2011-08-11 08:17:24

标签: apache tomcat mod-jk

apache2 workers.properties:

worker.node223.connection_pool_size=100
worker.node223.connection_pool_minsize=50

tomcat server.xml:

<Connector address="192.168.0.17" port="8009" maxHttpHeaderSize="64836"
           maxThreads="350" minSpareThreads="50" maxSpareThreads="200"
           acceptCount="700" connectionTimeout="360000" disableUploadTimeout="true"
           enableLookups="false" URIEncoding="UTF-8" protocol="AJP/1.3" />

connection_pool_size应该意味着最大tcp连接数应该建立到后端服务器(tomcat)。当我为tomcat server.as运行kill -3时:

........      
"TP-Processor499" daemon prio=10 tid=0x00007fb8455b5000 nid=0x4521 in Object.wait() [0x00007fb7ffe3f000]
       java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00007fb89017d430> (a org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
        at java.lang.Object.wait(Object.java:485)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:662)
        - locked <0x00007fb89017d430> (a org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
        at java.lang.Thread.run(Thread.java:619)


"TP-Processor498" daemon prio=10 tid=0x00007fb8455b3000 nid=0x4520 runnable [0x00007fb7fff40000]
   java.lang.Thread.State: RUNNABLE
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
    - locked <0x00007fb8a486fde0> (a java.io.BufferedInputStream)
    at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:621)
    at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:559)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:686)
    at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
    at java.lang.Thread.run(Thread.java:619)

........

然后我得到:

有295个TP处理器,我想295&lt; connection_pool_size + maxSpareThreads = 300; 295&lt; maxThreads = 350,没关系。

有189个Tp处理器(在等待中)&lt; maxSpareThreads = 200,没关系。

有106个TP处理器(在RUNNABLE中)&gt; connection_pool_size = 100,我认为这是错误的。

我做错了什么?如果没有,你知道可能的解释吗? 感谢

1 个答案:

答案 0 :(得分:1)

如果我正确读你,那么100就是每个工人的最大线程数。也许有不止一个工人在跑。

http://tomcat.apache.org/connectors-doc/reference/workers.html