You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by munkee <r....@staffs.ac.uk> on 2008/12/16 13:50:25 UTC

Can someone tell me what maxIdle & maxActive do ?

Hi,

We've got a problem with tomcat and JDBC pooling, we set the maxActive to 6
and maxIdle to 6, but this seems to then need 12 database connections to
work with these settings. Can anyone explain this?

We've 6 connections to the database to use, when we set maxActive to 6 and
maxIdle to 0, this seems to be working as expected. Although if we leave it
set to that then we're not using the pooling features as maxIdle isn't being
used.

Can anyone explain what maxIdle is, more than just : The maximum number of
connections that can remain idle in the pool, without extra ones being
released, or negative for no limit.

Then what advantages we would have if we set maxActive to 3 and maxIdle to
3, thus enabling pooling.

Many thanks,
Ray. 
-- 
View this message in context: http://www.nabble.com/Can-someone-tell-me-what-maxIdle---maxActive-do---tp21032459p21032459.html
Sent from the Commons - User mailing list archive at Nabble.com.


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


Re: Can someone tell me what maxIdle & maxActive do ?

Posted by Cyrille Roy <cy...@free.fr>.
Hi,
for dbcp, an active connection is a connection where 
connectionPool.getConnection() has been called and 
connectionPool.getConnection().close() has not yet been called. In other 
words, a connection that is no more in the connection pool.

An idle connection is a connection where connectionPool.getConnection() 
and then connectionPool.getConnection().close() have been called.

Every time you get a connection from the pool, the number of active 
connection is increased, and the number of idle connection is decreased.
Internally, dbcp holds a list of connection ready to be served. This is 
the pool.

Basically, the number of connection opened to the db can be maxActive + 
minIdle, because the pool will make sure "minIdle" number of connections 
are created with the db .

Hope this helps,
Cyrille

munkee wrote:
> Hi,
>
> We've got a problem with tomcat and JDBC pooling, we set the maxActive to 6
> and maxIdle to 6, but this seems to then need 12 database connections to
> work with these settings. Can anyone explain this?
>
> We've 6 connections to the database to use, when we set maxActive to 6 and
> maxIdle to 0, this seems to be working as expected. Although if we leave it
> set to that then we're not using the pooling features as maxIdle isn't being
> used.
>
> Can anyone explain what maxIdle is, more than just : The maximum number of
> connections that can remain idle in the pool, without extra ones being
> released, or negative for no limit.
>
> Then what advantages we would have if we set maxActive to 3 and maxIdle to
> 3, thus enabling pooling.
>
> Many thanks,
> Ray. 
>   


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