I managed to get a thread dump during one such tomcat hangs. Most of the 
threads are in the following status ...

"TP-Processor7" daemon prio=10 tid=00093ab0 nid=86 lwp_id=4866290 runnable 
[53c00000..53c00dc0]
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:134)
        at java.io.FilterInputStream.read(FilterInputStream.java:111)
        at 
com.wily.introscope.agent.probe.net.ManagedSocketInputStream.read(ManagedSocketInputStream.java:214)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:222)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
        - locked <8e0d3a50> (a java.io.BufferedInputStream)
        at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:598)
        at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:535)
        at 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:663)
        at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:534)
"TP-Processor6" daemon prio=10 tid=000938d0 nid=85 lwp_id=4866288 runnable 
[53cc0000..53cc0dc0]
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:134)
        at java.io.FilterInputStream.read(FilterInputStream.java:111)
        at 
com.wily.introscope.agent.probe.net.ManagedSocketInputStream.read(ManagedSocketInputStream.java:214)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:222)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
        - locked <8e0d7ed8> (a java.io.BufferedInputStream)
        at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:598)
        at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:535)
        at 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:663)
        at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:534)





________________________________
From: Chetan Chheda <chetan_chh...@yahoo.com>
To: Tomcat Users List <users@tomcat.apache.org>
Sent: Tuesday, May 12, 2009 1:32:16 PM
Subject: Re: Tomcat not closing threads

Just wondering if anyone got my message below? 




________________________________
From: Chetan Chheda <chetan_chh...@yahoo.com>
To: users@tomcat.apache.org
Sent: Tuesday, May 12, 2009 12:03:49 PM
Subject: Tomcat not closing threads

Hello, 
I am having an issue where I could use some clarity. 
We are using apache 2.0.59 and tomcat 5.5. We are having some growing pains 
with vendor specified modjk and tomcat settings. 
1. Tomcat opens up a number of threads during some transactions but does not 
close them. Is this because the connectionTimeout parameter is missing in the 
AJP connector defination? 
2. I do have the cache_timeout (deprecated , I know ) set to 900 secs. What 
impact does that have on closing idle threads?
3. Today one of the Tomcat's froze and thru jkstatus I saw 409 connections open 
to it. If my connection pool size is 256 (from modjk.log) why are more 
connections being opened?
 
Thanks,
Chetan
 
My workers.properties file looks like this. 
ps=/
worker.list=ajp13App31,ajp13App32,loadbalancer,mystatus
workers.tomcat_home=/coach/app/ptc/tomcat1
worker.ajp13App31.port=8012
worker.ajp13App31.host=localhost
worker.ajp13App31.type=ajp13
worker.ajp13App31.lbfactor=1
worker.ajp13App31.cache_timeout=900
worker.ajp13App31.socket_timeout=0
worker.ajp13App31.retries=3
worker.ajp13App31.recycle_timeout=900
worker.ajp13App32.port=8013
worker.ajp13App32.host=localhost
worker.ajp13App32.type=ajp13
worker.ajp13App32.lbfactor=1
worker.ajp13App32.cache_timeout=900
worker.ajp13App32.socket_timeout=0 
worker.ajp13App32.retries=3
worker.ajp13App32.recycle_timeout=900
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13App31,ajp13App32
worker.loadbalancer.method=Request
worker.loadbalancer.sticky_session=true
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
worker.inprocess.cmd_line=start
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr
worker.mystatus.type=status
worker.mystatus.mount=/admin/status/jk
 
And here is the AJP13 connector from one of the tomcat's server.xml : 
<Connector URIEncoding="UTF-8" acceptCount="100" debug="1" port="8012" 
protocol="AJP/1.3" 
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" 
redirectPort="8445" tomcatAuthentication="false" useBodyEncodingForURI="true">
 
Apache MPM
# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule worker.c>
ThreadLimit        512
StartServers       100
MaxClients         512
MinSpareThreads    129
MaxSpareThreads    256
ThreadsPerChild    256
MaxRequestsPerChild  0
</IfModule>


      

Reply via email to