commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <>
Subject Re: DBCP maxActive
Date Sat, 01 Sep 2007 23:38:07 GMT
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.


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

View raw message