On 13/05/2010 09:35, Tomás Tormo wrote:
> Greetings
> 
> I would like to understand correctly how Tomcat database pool works.

It's a repackaged version of Apache Commons DBCP.

> As I understand, when the application starts, a pool connection is
> created with *initialSize* connections (0 by default).
> 
> Later on, new connections are created on demand of the application,
> untill it reaches the *maxActive* connections. If *maxActive* has been
> reached and the application requests for a new connection, the pool will
> wait *maxWait* milliseconds for a free connection.
> 
> If any connection has been released, it will be kept as idle as long as
> *maxIdle* is not reached. No more connections will be created if there
> are *minIdle* or more connections in the pool in idle state.

http://commons.apache.org/dbcp/configuration.html

> ¿Am I right?
> 
> But I still have some questions:
> 
> ¿How to see the pool connection state in real time? (idle connections,
> active connections, etc). We are using Introscope for monitoring an
> application, and we can see some stalled connections... but the
> maxActive parameter is far bigger (100) than the actived connections
> shown by Introscope (24). This is happening with Tomcat 5.5 on CentOs
> using Java 1.6.

I don't know anything about Introscope.

If maxActive is larger than the number of active connections, then
there's nothing wrong there, is there?  I'm not sure what you're trying
to explain by that.

If you can see some stalled connections, take a thread dump to see what
they're doing/waiting on.


p


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to