commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Shifman <mark.shif...@yale.edu>
Subject Re: [DBCP] Too many connections issue...
Date Wed, 26 Jan 2011 13:24:28 GMT
You may want to look at what connections your database thinks are open.
In Oracle, from a sql plus command line:

select username, program, machine, osuser, logon_time,  sid, serial#
from v$session where osuser != 'oracle' order by machine, logon_time;

You can also do something similar with mysql but I don't remember the
sql.  I suspect all databases have some way to tell which connections
are open.

You can also watch the number of open connections grow if you haven't
appropriately closed the connections.

mas



On 01/25/2011 08:05 PM, Phil Steitz wrote:
> On Tue, Jan 25, 2011 at 4:39 PM, Suny kk <suny.kk@gmail.com> wrote:
>> Hi Phil,
>>
>> Yes, I'm using BasiDataSource well, Is it because of my DBCP settings?
>> Remember I got this exception when I started my application on different
>> machine with same database.
>>
> 
> Well, if the first instance starts and uses the full 500 max
> connections, then that could explain why the second instance cannot
> get any connections from the database (assuming the database itself
> cannot handle more than 500 connections).
> 
> As I said below, the error that you are getting means that when the
> application starts the database does not have connections available to
> provide to the pool.  You should check and confirm:
> 
> 0) Is the application closing all connections that it opens?  You can
> quickly max the pool connections if your code does not return
> connections to the pool.  Your configuration allows 500 connections to
> be opened by the pool concurrently.  You should observe the actual
> database engine connection counts and see if your app is getting near
> the max.  Given that you have maxIdle set at 8, if you are hitting
> high connection count numbers either you have some very long-running
> queries and large load spikes, or your code is abandoning connections
> (not closing them).
> 
> 1) Are other applications or processes consuming available database connections?
> 
> Phil
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shifman@yale.edu

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


Mime
View raw message