tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "GB Developer" <gb107...@globallyboundless.com>
Subject Usage of DBCP in Tomcat
Date Thu, 02 Jun 2005 21:03:42 GMT
Hi everyone,
 
The number of sites we support has recently expanded, and we're starting to
run into db connection errors : we are running out.
 
Mysql currently has its default max (somewhere around 100?), and I'll be
scheduling a restart to increase this count  (as an aside: anyone know how
to up the connections on a running mysql server?)
 
But I'd also like to find out why the DBCP configuration that I have is not
functioning as expected.  Is there something I'm missing or not
understanding?
 
Tomcat 5.0.29
commons-dbcp-1.2.1.jar
JDK 1.4.2


<parameter>
  <name>url</name>
  <value>jdbc:mysql://xxx:xxx:xxx:xx:xxxx/yyyy?autoReconnect=true</value>
</parameter>
<parameter>
  <name>maxActive</name>
  <value>15</value>
</parameter>
<parameter>
  <name>maxIdle</name>
  <value>5</value>
</parameter>
<parameter>
  <name>maxWait</name>
  <value>5000</value>
</parameter>
<parameter>
  <name>removeAbandoned</name>
  <value>true</value>
</parameter>
<parameter>
  <name>removeAbandonedTimeout</name>
  <value>15</value>
</parameter>
<parameter>
  <name>logAbandoned</name>
  <value>true</value>
</parameter>

This, I would read as "use up to 15 total connections, maintain no less than
5 at the ready, and wait for no more than 5 seconds before indicating you
are 'out of connections'. Also remove a connection if it hasn't been used
for more than 15 seconds, and tell me you did that".
 
All the websites share this common config.  I'm getting single websites
maintaining up to 20 connections.  When I examine the mysql instance with
the GUI MySql Admin tool, I see pretty much all of them in "SLEEP" and for
well over 5000 seconds, never mind 15 seconds.  Perhaps I'm leaking
connections, which I'll be investigating as well, but then why aren't they
being reclaimed as abandoned?
 
If I don't configure timeBetweenEvictionRunsMillis, will the number of
connection in the pool ever be reduced to maxIdle ?

Is the autoReconnect screwing me?
  

Thanks for any ideas.


---------------------------------------------------------------------
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