You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by sum2000 <su...@live.cn> on 2016/01/09 06:27:32 UTC

[dbcp]the activity when number of active connections reach (maxActive-minIdle)

for example,pool size:
db.pool.size.init=5
db.pool.size.active.max=20
db.pool.size.idle.max=20
db.pool.size.idle.min=10
when # of active connections reach 10, what's the following activity of dbcp?
We know it can’t create new one for idle due to no availabe pool resource, if true dbcp can’t keep minIdle for 10, so what's next happen?


Thank you.
Yong Fu

Re: [dbcp]the activity when number of active connections reach (maxActive-minIdle)

Posted by Phil Steitz <ph...@gmail.com>.
On Fri, Jan 8, 2016 at 10:27 PM, sum2000 <su...@live.cn> wrote:

> for example,pool size:
> db.pool.size.init=5
> db.pool.size.active.max=20
> db.pool.size.idle.max=20
> db.pool.size.idle.min=10
> when # of active connections reach 10, what's the following activity of
> dbcp?
> We know it can’t create new one for idle due to no availabe pool resource,
> if true dbcp can’t keep minIdle for 10, so what's next happen?
>

The maxTotal [1] property is a hard limit on the total number of
connections that can be open under management by the pool at a given time
(checked out or idle).  The minIdle property really expresses an objective,
not a guarantee.  In the situation you describe, the number of idle
connections will drop down below minIdle.

Another thing to note is that as of version 2.1 of DBCP, as indicated in
the javadoc for minIdle, the pool only attempts to ensure minIdle when the
evictor runs, so unless you have timeBetweenEvictionRunsMillis set to a
positive value, there will be no attempt by the pool to ensure minIdle.

Phil

[1] In DBCP 1.x, this property is named "maxActive".

>
>
> Thank you.
> Yong Fu