commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <phil.ste...@gmail.com>
Subject Re: DBCP maxActive
Date Sun, 02 Sep 2007 15:39:16 GMT
On 9/2/07, noon <rami.muurimaki@gmail.com> wrote:
>
> 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).
>

Neither DBCP nor pool have logging capabilities themselves.  DBCP's
BasicDataSource exposes getNumActive and getNumIdle methods, however,
that can be used programatically to check the number of active/idle
connections at a given time.  Be careful introducing lots of
activations of these methods, however, since (as of version 1.2) they
are synchronized.

You might do best monitoring the database itself or looking at its
logs to see how many connections are being opened / closed and if you
can get this information, query response times.  If many / most
queries are responding very slowly, then you are going to have
problems under load no matter how you configure the pool.  The pool
really just takes away the overhead of opening / closing connections.
In any case, you should focus on finding the long-running queries and
improving their performance assuming you have that problem.

Phil




>
>

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


Mime
View raw message