commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From noon <>
Subject Re: DBCP maxActive
Date Sun, 02 Sep 2007 08:58:19 GMT

Hi Phil, 

Thanks for you quick reply.

I kind of knew this, but just wanted that some Pro or Guru would proof that

I don't know yet what causes the performance issues in my application. I
just started to investigate all the issues that might cause this and the
size of the DB pool is one of them. The symtoms of the issues our customer
is having, sounds like the problem was with the database... when user makes
a request to DB, it takes some time to get the reply... just like the
connection pool would have reached the "exhausted" state or something else.

Do you know is there any good technique to log the state of the connection
pool? how many active connections there are and how many of them are in use
or free etc. I checked the source code and I didn't find any logging rows of
anykind from the source (commons pool and commons dbcp projects).

Phil Steitz wrote:
> On 9/1/07, noon <> wrote:
>> We have a small performance issue in our project and I'm trying to locate
>> the
>> problem.
>> The application is a Spring MVC application and the database has about 90
>> 000 rows in the database. We're using DBCP as JDBC pooling tool. Now we
>> have
>> realized that we're having some performance issues. The application has
>> about 100 - 150 users.
>> I just realized that we're using it with it's default values so the
>> maxActive setting is only 8. Do you think this might cause some
>> performance
>> issues? If I increase the maxActive up to 40 is it enough? What is the
>> downside if I set it as 100 or -1 to indicate unlimited connections?
> If the load is heavy enough, 8 active database connections could be
> insufficient and increasing the number of connections might improve
> performance.  This may not, however, be the source of the bottleneck.
> If the database queries are running too slowly, for example, you will
> still have performance problems.  Increasing maxActive increases the
> maximum number of physical database connections that can be in use at
> a given time.  Making that number larger uses more resources on the
> database engine and memory on the client side (where the pool lives).
>> Another question regarding the DBCP.
>> Our Spring application is multilayered application with web, manager and
>> dao
>> layers. When exactly does the DBCP give a JDBC connection to the
>> application? Just when the application needs a connection in the dao (I'm
>> using Hibernate as ORM + Spring's HibernateDaoSupport jdbc template
>> class)?
>> or somewhere before? If I make let say 10 queries into the database in
>> the
>> web or manager layer (each in differend daos), does my application
>> request
>> for each dao access a new JDBC connection from the pool?
> I am not a Hibernate-Spring expert, but what DBCP does is maintain a
> *pool* of physical connections that are borrowed by clients when they
> make getConnection requests of DBCP datasources.  Connections are
> returned to the pool when clients close them.  DBCP interaction is
> handled for you by Hibernate, so in your case, it is Hibernate that
> gets and closes DBCP connections. I don't know the internals of
> Hibernate, so I can't answer the question definitively of when the
> getConnection happens for a Hibernate session.  Your different queries
> may be attached to different Hibernate sessions, so they may compete
> for connections from the pool.  You should verify that your code,
> Spring and Hibernate are working correctly together to close all of
> the DBCP connections that are opened.
> Phil
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View this message in context:
Sent from the Commons - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message