tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jthomp...@honda.co.nz
Subject Re: Tomcat becoming almost completely non-responsive
Date Sun, 03 Oct 2004 20:58:20 GMT





The most likely reason for your connections not being re-used is that your
java code isn't explicitly closing connections, statements and result sets
after use.
If visiting all your code is too onerous a task, you could add the
following parameters to your data-source configuration:

<parameter>
  <name>removeAbandoned</name>
  <value>true</value>
 </parameter>
<parameter>
  <name>removeAbandonedTimeout</name>
  <value>60</value>
 </parameter>

The effect of the above is to mark any data-pool connection as re-usable
after 60 seconds of inactivity.
You can add the following to log abandonned connection activity:

<parameter>
  <name>logAbandoned</name>
  <value>true</value>
 </parameter>

John Thompson



|---------+---------------------------->
|         |           Kaleb Pederson   |
|         |           <kpederson@mail.e|
|         |           wu.edu>          |
|         |                            |
|         |           02/10/2004 10:07 |
|         |           AM               |
|         |           Please respond to|
|         |           "Tomcat Users    |
|         |           List"            |
|         |                            |
|---------+---------------------------->
  >--------------------------------------------------------------------------------------------------------------|
  |                                                                                      
                       |
  |       To:       Tomcat Users List <tomcat-user@jakarta.apache.org>             
                             |
  |       cc:                                                                            
                       |
  |       Subject:  Tomcat becoming almost completely non-responsive                     
                       |
  >--------------------------------------------------------------------------------------------------------------|




Hello,

I have an interesting problem.  After a while, tomcat (5.0.27) becomes
almost
completely non-responsive.  If I telnet in to port 8009  (I'm using apache
and mod_jk2), I get no response, at least not within the default timeout.
If
a browse to a page, I will generally, after about 4-5 minutes, see a page
returned.

To narrow down the slowness, I generated a full thread dump, and found the
following information:

[ see attachment for more info]
Total threads: 180
executeQuery: 2 //  executing a db query
validateConnection: 0 // trying to validate their connection
validateObect: 48 // in
commons.dbcp.PoolableConnectionFactory.validateObject
socketAccept: 3 // accepting a socket
socketRead0: 10 // reading a socket
ReferenceQueue: 1
ThreadPool$MonitorRunnable: 2
borrowObject and Object.wait: 85 // trying to get an object from the pool
Object.wait: 20 // threads just waiting around
Remaining:  9 // misc. threads

My database connection is setup so that I have 50 allowed connections,
which
matches my 48 in validateObject and 2 executing queries.  However, when I
query the database status, I see 2 active threads and the rest are
'sleeping', just waiting around, as they would be if the connection pool
hadn't released them yet.

So, why would there be 48 connections that seemed locked and weren't
querying
the DB?  And then the other 85 that were seemingly waiting on the 45?  Any
ideas what might be going on?  The DB is ready?  I have log abandoned
turned
and an haven't seen a problem yet.  If the load drops sufficiently on the
server, everything eventually returns back to normal, otherwise it takes
5-10
minutes to get a response from the server.

I have attached an abbreviated form of the thread dump which should provide
all the critical information and can provide as much other information as
is
necessary.

Thanks for the help.  *All* suggestions welcome ;)

--Kaleb


---------------------------------------------------------------------
 To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message