commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject [dbcp] Re: Debugging dbcp issues?
Date Sat, 12 Sep 2009 00:32:13 GMT
daniel steel wrote:
> all,
>  we are running some performance tests and in one of the test script, i am tracking the
time it takes to check out a connection from the pool.
> 
> times in milliseconds:
> 
> 9, 16, 2, 127, 9, 145
> 
> the question is why would it vary so much? and how do i trouble shoot as i why it took
so much time in few instances ?
> 
> few dbcp settings:
> 
> initialSize="55"
> maxActive="-2" 
> 
> maxIdle="85" 
> timeBetweenEvictionRunsMillis="1800000"
> 
> thanks
> dan
> 
> 

There are lots of things that determine how long it takes to check
out a connection from the pool.  Assuming you have set no other
parameters (i.e. left all but the ones you mention to defaults), the
following is most likely. Since you have no limit on the number of
connections that the pool can create (maxActive negative), when
there are no idle connections in the pool, new ones will be created.
 Creating a connection is much slower than just returning one
sitting idle in the pool, so the long response times are likely
occurring when there are no idle connections in the pool.

You can observe the number of idle connections by inspecting the
numIdle property of the pool.  Doing this too much in performance
tests can skew your results, however, as this method is
synchronized.  If you can monitor the database, it is also
instructive to observe the number of open and active connections in
the database used by the pool as the test is running.

Phil

P.S.: Since this list is shared by all commons components, we ask
that you prepend the component name as I have done above to the
subject line of posts to this list.  Thanks!




>       


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


Mime
View raw message