Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 2990 invoked from network); 26 Jan 2011 13:25:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Jan 2011 13:25:06 -0000 Received: (qmail 75084 invoked by uid 500); 26 Jan 2011 13:25:05 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 74560 invoked by uid 500); 26 Jan 2011 13:25:02 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 74551 invoked by uid 99); 26 Jan 2011 13:25:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jan 2011 13:25:00 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [130.132.232.16] (HELO hera.med.yale.edu) (130.132.232.16) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jan 2011 13:24:54 +0000 Received: from moussaka.med.yale.edu (moussaka.med.yale.edu [128.36.29.108]) by email.med.yale.edu (PMDF V6.2-X17 #31441) with ESMTPS id <0LFM0YJF0T8SAI@email.med.yale.edu> for user@commons.apache.org; Wed, 26 Jan 2011 08:24:28 -0500 (EST) Date: Wed, 26 Jan 2011 08:24:28 -0500 From: Mark Shifman Subject: Re: [DBCP] Too many connections issue... In-reply-to: To: Commons Users List Message-id: <4D40208C.6080101@yale.edu> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 X-Enigmail-Version: 1.1.1 References: 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 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