tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hedrick, Brooke - 43" <brooke.hedr...@rainhail.com>
Subject RE: Question about resetting datasources and changes to the BasicDataSource.close() method
Date Thu, 31 May 2012 15:51:30 GMT
Chris,

We don't have "high load" applications for the most part so it is pretty common to have a
MaxActive set to around 5 or 10.   We monitor applications to watch for high-water marks to
make sure we keep 10-20% headroom on for free datasource connections.  

Our release cycle has us releasing many applications on many JVMs every week.  From time to
time, these applications have issues in them where someone has made a code change that requires
2 connections per request instead of 1.  In those cases, we temporarily increase the MaxActive
to accommodate the issue introduced.  We do this by using JMX as well as updating the server.xml
( in case the JVM is restarted for some reason ).  In some cases an application is released
that shares a datasource with another application and the MaxActive isn't large enough to
accommodate both apps.  By using JMX, we are able to increase MaxActive without having to
take the JVM down to resolve this.

We also have cases where applications are released with connection pool leaks.  When this
happens, we catch problems because we keep the pools only big enough to service demand.  We
will see connection pools hit 100% usage and thread pools increase rapidly due to waiting
on connections.  We do this to prevent the database from being hit overly hard by a single
application.  We also do not use the removeAbandoned settings today in favor of failing fast.
 This way the App Server suffers not the DB.  Our Tomcat hosts and JVMs greatly outnumber
our DB hosts.

What do you do today to reset or resize connection pools?

Thanks,
 
Brooke Hedrick

-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net] 
Sent: Wednesday, May 30, 2012 7:09 PM
To: Tomcat Users List
Subject: Re: Question about resetting datasources and changes to the BasicDataSource.close()
method

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brooke,

On 5/30/12 3:31 PM, Hedrick, Brooke - 43 wrote:
> How are others dynamically resetting/resizing their database 
> connection pools when necessary?

Quick question about all this: why do you need to do any more dynamic-resizing than dbcp already
provides out of the box? I know that dbcp doesn't have a built-in method for trashing all
connections and re-filling the pool, but re-sizing is definitely something it can already
do (see the configuration property "minEvictableIdleTimeMillis").

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/GtpEACgkQ9CaO5/Lv0PALnwCgtIQEoDQ8PHSX//pv9NDRg8f+
jQMAn2sxxVMgY4Q5ea7aLvHGkp13tdBO
=4tle
-----END PGP SIGNATURE-----

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

Mime
View raw message