Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 11771 invoked from network); 15 Oct 2007 07:12:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Oct 2007 07:12:36 -0000 Received: (qmail 51189 invoked by uid 500); 15 Oct 2007 07:12:23 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 50682 invoked by uid 500); 15 Oct 2007 07:12:22 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 50673 invoked by uid 99); 15 Oct 2007 07:12:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Oct 2007 00:12:22 -0700 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [203.99.254.144] (HELO rsmtp2.corp.hki.yahoo.com) (203.99.254.144) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Oct 2007 07:12:23 +0000 Received: from bhaskar1 (bhaskarpc.eglbp.corp.yahoo.com [10.66.72.156]) (authenticated bits=0) by rsmtp2.corp.hki.yahoo.com (8.13.8/8.13.8/y.rout) with ESMTP id l9F7BppT043817 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Mon, 15 Oct 2007 00:11:54 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=from:to:subject:date:message-id:mime-version:content-type: x-mailer:x-mimeole:thread-index; b=KyqysfC1qcYtMPg5GZNE8slF+4rYc7BSsCb5U64uSQC1CVlr4Z7bE3w2ql3Lqwms From: "Bhaskar" To: Subject: Enhancement/suggession - GenericObjectPool.evict - log a warning if _numActive goes below _minIdle Date: Mon, 15 Oct 2007 12:41:50 +0530 Message-ID: <00ca01c80efa$ab19b260$9c48420a@ds.corp.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00CB_01C80F28.C4D1EE60" X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Thread-Index: AcgO+qhQ8NUy37CeSHOyuFjUMkHprQ== X-Virus-Checked: Checked by ClamAV on apache.org ------=_NextPart_000_00CB_01C80F28.C4D1EE60 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Hi, Recently we had a hardware issue due to which numActive use to drop drastically (in netstat I found that number of connections established to oracle db was keep on reducing). Enhancement/Suggession is to log a warning or recreate a new connection and put into pool when _numActive < _minIdle or _numActive < _maxIdle (please refer to the suggested code change) I am new to this community so, i might be wrong in the code which i am refering to. Please let me know if it make sence to submit the patch on this. thanks in advance, Bhaskar Suggested code change: public class GenericObjectPool extends BaseObjectPool implements ObjectPool { ............. .............. public synchronized void evict() throws Exception { ......... ......... if(removeObject) { try { iter.remove(); int prevNumActive = _numActive; _factory.destroyObject(pair.value); //suggession start if( (prevNumActive < _maxIdle) || (_numActive < _numIdle) ) { //log a warning telling that too many connections are getting invalidated during eviction time. or //create a new connection and put it into pool back. } //suggession end } catch(Exception e) { // ignored } } PS: Enviornment: RHEL 4 with JDK 1.4 Configs: maxActive = 50 maxIdle = 30 factory=org.apache.commons.dbcp.BasicDataSourceFactory maxWait=10000 timeBetweenEvictionRunsMillis=900000 numTestsPerEvictionRun=50 minEvictableIdleTimeMillis=1800000 testWhileIdle=true I noticed that in netstat, number of connections with oracle db got reduced from 12 to 8 at some point of time. ------=_NextPart_000_00CB_01C80F28.C4D1EE60--