You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Bhaskar <bh...@yahoo-inc.com> on 2007/10/15 14:08:06 UTC

More number of connections got created than maxActive

Hi,
I am currently using dbcp 1.2.1 with common pool 1.3. Currently i have
following settings in server.xml:
maxActive = 50
maxIdle = 30
minIdle=30
factory=org.apache.commons.dbcp.BasicDataSourceFactory
maxWait=10000
timeBetweenEvictionRunsMillis=900000
numTestsPerEvictionRun=50
minEvictableIdleTimeMillis=1800000
testWhileIdle=true
testOnBorrow = true
validationQuery='select 1 from dual'

Issue is when i restarted tomcat, i seen there were only 6 connections.
After 15 minutes, i see there were 121 connections in netstat against oracle
port.
 
Can someone please help me understand the DBCP behaviour here? how can it go
beyond maxActive? 

Thanks,
Bhaskar
 
System info:
---------------  S Y S T E M  ---------------
 
OS:Red Hat Enterprise Linux AS release 4 (Nahant Update 2)
 
uname:Linux 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:32:14 EDT 2005 i686

 
vm_info: Java HotSpot(TM) Server VM (1.4.2_13-b06) for linux-x86, built on
Oct 18 2006 09:55:11 by unknown with unknown compiler

 

Re: More number of connections got created than maxActive

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David,

David Smith wrote:
>> Also, if you have a connection leak, then DBCP will continue to create
>> connections to meet demand, even if the old connections are not closed.
>> Since they are no longer in the "pool" (since they were never returned),
>> they don't count against the "size" of the pool.
> 
> Huh??  Borrowed objects are still in the pool, just marked as borrowed
> so they don't go out to another request.

Uh, right. Need ... coffee. Sorry for the Monday morning stupidity.

You will exhaust the pool if you leak connections.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHE3MQ9CaO5/Lv0PARAswVAJ4iWieJKRmmwGxub9sf56nnaBpysACgueve
wLQPzZsTBGbS6XCyLpTT/Lo=
=sKOS
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: More number of connections got created than maxActive

Posted by David Smith <dn...@cornell.edu>.
>
>
>Also, if you have a connection leak, then DBCP will continue to create
>connections to meet demand, even if the old connections are not closed.
>Since they are no longer in the "pool" (since they were never returned),
>they don't count against the "size" of the pool.
>  
>

Huh??  Borrowed objects are still in the pool, just marked as borrowed 
so they don't go out to another request.  If the pool fills to capacity 
with all items borrowed future requests either wait or are denied until 
borrowed connections are returned.  I suspect there is more than one 
pool at work here.

--David

Christopher Schultz wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Bhaskar,
>
>Bhaskar wrote:
>  
>
>>Issue is when i restarted tomcat, i seen there were only 6 connections.
>>After 15 minutes, i see there were 121 connections in netstat against oracle
>>port.
>> 
>>Can someone please help me understand the DBCP behaviour here? how can it go
>>beyond maxActive? 
>>    
>>
>
>Are you sure all those connections are from the DBCP?
>
>Also, if you have a connection leak, then DBCP will continue to create
>connections to meet demand, even if the old connections are not closed.
>Since they are no longer in the "pool" (since they were never returned),
>they don't count against the "size" of the pool.
>
>- -chris
>
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.4.7 (MingW32)
>Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
>iD8DBQFHE2/Q9CaO5/Lv0PARAsvzAKCDTtMaBTBDhdWxZtloYze8RVJZwgCfajE6
>XHS+EVHNks6d8N7pFlNgdr4=
>=7wZP
>-----END PGP SIGNATURE-----
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: More number of connections got created than maxActive

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bhaskar,

Bhaskar wrote:
> Issue is when i restarted tomcat, i seen there were only 6 connections.
> After 15 minutes, i see there were 121 connections in netstat against oracle
> port.
>  
> Can someone please help me understand the DBCP behaviour here? how can it go
> beyond maxActive? 

Are you sure all those connections are from the DBCP?

Also, if you have a connection leak, then DBCP will continue to create
connections to meet demand, even if the old connections are not closed.
Since they are no longer in the "pool" (since they were never returned),
they don't count against the "size" of the pool.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHE2/Q9CaO5/Lv0PARAsvzAKCDTtMaBTBDhdWxZtloYze8RVJZwgCfajE6
XHS+EVHNks6d8N7pFlNgdr4=
=7wZP
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: More number of connections got created than maxActive

Posted by David Smith <dn...@cornell.edu>.
These questions may be better answered on a DBCP user list since they 
are very specific to DBCP and commons-pool.

--David

Bhaskar wrote:

>I tried with dbcp1.2.2 today and found same issue. 
>
>With maxActive=30, maxIdle=30 and minIdle=30, connecitons went upto 120. And
>it didn't comeback after 3-4 hrs.
>
>After changing minIdle=0, number of connections were stayed at 30.
>
>Is it a issue related to common pool (I am using common pool 1.3)?
>
>Bhaskar 
>
>  
>
>>-----Original Message-----
>>From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com] 
>>Sent: Tuesday, October 16, 2007 8:57 PM
>>To: Tomcat Users List
>>Subject: Re: More number of connections got created than maxActive
>>
>>Isn't it  http://issues.apache.org/jira/browse/DBCP-28 ? 
>>"Connection leak ..."
>>
>>It was fixed in DBCP 1.2.2.
>>
>>You may want to read through the Release History of DBCP for 
>>other bugs that have been already found and fixed, 
>>http://commons.apache.org/dbcp/changes-report.html
>>
>>
>>-------------------------------------
>>2007/10/16, Bhaskar <bh...@yahoo-inc.com>:
>>    
>>
>>>I found that issue is around minIdle settings.
>>>
>>>When I had following settings:
>>>maxActive = 50
>>>maxIdle = 30
>>>minIdle=30
>>>factory=org.apache.commons.dbcp.BasicDataSourceFactory
>>>maxWait=10000
>>>timeBetweenEvictionRunsMillis=900000
>>>numTestsPerEvictionRun=50
>>>minEvictableIdleTimeMillis=1800000
>>>testWhileIdle=true
>>>testOnBorrow = true
>>>validationQuery='select 1 from dual'
>>>
>>>
>>>Number of connections in the pool went upto 121.
>>>
>>>When I changed minIdle to 15 and did my load test 
>>>      
>>>
>>connecitons in the 
>>    
>>
>>>pool went upto 66
>>>
>>>Looks like maxActive is getting bypassed with minIdle.
>>>
>>>When I changed minIdle to 10 and did my load test 
>>>      
>>>
>>connections in the 
>>    
>>
>>>pool went upto 24
>>>
>>>Can someone please throw light on what is going on here? I am using 
>>>DBCP
>>>1.2.1
>>>
>>>Bhaskar
>>>      
>>>
>>---------------------------------------------------------------------
>>To start a new topic, e-mail: users@tomcat.apache.org To 
>>unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: More number of connections got created than maxActive

Posted by Bhaskar <bh...@yahoo-inc.com>.
I tried with dbcp1.2.2 today and found same issue. 

With maxActive=30, maxIdle=30 and minIdle=30, connecitons went upto 120. And
it didn't comeback after 3-4 hrs.

After changing minIdle=0, number of connections were stayed at 30.

Is it a issue related to common pool (I am using common pool 1.3)?

Bhaskar 

> -----Original Message-----
> From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com] 
> Sent: Tuesday, October 16, 2007 8:57 PM
> To: Tomcat Users List
> Subject: Re: More number of connections got created than maxActive
> 
> Isn't it  http://issues.apache.org/jira/browse/DBCP-28 ? 
> "Connection leak ..."
> 
> It was fixed in DBCP 1.2.2.
> 
> You may want to read through the Release History of DBCP for 
> other bugs that have been already found and fixed, 
> http://commons.apache.org/dbcp/changes-report.html
> 
> 
> -------------------------------------
> 2007/10/16, Bhaskar <bh...@yahoo-inc.com>:
> > I found that issue is around minIdle settings.
> >
> > When I had following settings:
> > maxActive = 50
> > maxIdle = 30
> > minIdle=30
> > factory=org.apache.commons.dbcp.BasicDataSourceFactory
> > maxWait=10000
> > timeBetweenEvictionRunsMillis=900000
> > numTestsPerEvictionRun=50
> > minEvictableIdleTimeMillis=1800000
> > testWhileIdle=true
> > testOnBorrow = true
> > validationQuery='select 1 from dual'
> >
> >
> > Number of connections in the pool went upto 121.
> >
> > When I changed minIdle to 15 and did my load test 
> connecitons in the 
> > pool went upto 66
> >
> > Looks like maxActive is getting bypassed with minIdle.
> >
> > When I changed minIdle to 10 and did my load test 
> connections in the 
> > pool went upto 24
> >
> > Can someone please throw light on what is going on here? I am using 
> > DBCP
> > 1.2.1
> >
> > Bhaskar
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To 
> unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: More number of connections got created than maxActive

Posted by Konstantin Kolinko <kn...@gmail.com>.
Isn't it  http://issues.apache.org/jira/browse/DBCP-28 ? "Connection leak ..."

It was fixed in DBCP 1.2.2.

You may want to read through the Release History of DBCP for other
bugs that have been already found and fixed,
http://commons.apache.org/dbcp/changes-report.html


-------------------------------------
2007/10/16, Bhaskar <bh...@yahoo-inc.com>:
> I found that issue is around minIdle settings.
>
> When I had following settings:
> maxActive = 50
> maxIdle = 30
> minIdle=30
> factory=org.apache.commons.dbcp.BasicDataSourceFactory
> maxWait=10000
> timeBetweenEvictionRunsMillis=900000
> numTestsPerEvictionRun=50
> minEvictableIdleTimeMillis=1800000
> testWhileIdle=true
> testOnBorrow = true
> validationQuery='select 1 from dual'
>
>
> Number of connections in the pool went upto 121.
>
> When I changed minIdle to 15 and did my load test connecitons in the pool
> went upto 66
>
> Looks like maxActive is getting bypassed with minIdle.
>
> When I changed minIdle to 10 and did my load test connections in the pool
> went upto 24
>
> Can someone please throw light on what is going on here? I am using DBCP
> 1.2.1
>
> Bhaskar

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: More number of connections got created than maxActive

Posted by Bhaskar <bh...@yahoo-inc.com>.
I found that issue is around minIdle settings.

When I had following settings:
maxActive = 50
maxIdle = 30
minIdle=30
factory=org.apache.commons.dbcp.BasicDataSourceFactory
maxWait=10000
timeBetweenEvictionRunsMillis=900000
numTestsPerEvictionRun=50
minEvictableIdleTimeMillis=1800000
testWhileIdle=true
testOnBorrow = true
validationQuery='select 1 from dual'


Number of connections in the pool went upto 121.

When I changed minIdle to 15 and did my load test connecitons in the pool
went upto 66

Looks like maxActive is getting bypassed with minIdle.

When I changed minIdle to 10 and did my load test connections in the pool
went upto 24

Can someone please throw light on what is going on here? I am using DBCP
1.2.1

Bhaskar

> -----Original Message-----
> From: Bhaskar [mailto:bhaskar@yahoo-inc.com] 
> Sent: Tuesday, October 16, 2007 10:20 AM
> To: 'Tomcat Users List'
> Subject: RE: More number of connections got created than maxActive
> 
> Yes. I tested it. After stopping tomcat, all connections to 
> oracle went down and only my app was running in tomcat .
> 
> 
> 
> > -----Original Message-----
> > From: David Smith [mailto:dns4@cornell.edu]
> > Sent: Monday, October 15, 2007 6:59 PM
> > To: Tomcat Users List
> > Subject: Re: More number of connections got created than maxActive
> > 
> > Can you determine with certainty that this one pool was responsible 
> > for all 121 connections?  You don't have any other webapps 
> with their 
> > own pool hitting the same db?
> > 
> > --David
> > 
> > Bhaskar wrote:
> > 
> > >Hi,
> > >I am currently using dbcp 1.2.1 with common pool 1.3. 
> > Currently i have
> > >following settings in server.xml:
> > >maxActive = 50
> > >maxIdle = 30
> > >minIdle=30
> > >factory=org.apache.commons.dbcp.BasicDataSourceFactory
> > >maxWait=10000
> > >timeBetweenEvictionRunsMillis=900000
> > >numTestsPerEvictionRun=50
> > >minEvictableIdleTimeMillis=1800000
> > >testWhileIdle=true
> > >testOnBorrow = true
> > >validationQuery='select 1 from dual'
> > >
> > >Issue is when i restarted tomcat, i seen there were only 6
> > connections.
> > >After 15 minutes, i see there were 121 connections in
> > netstat against
> > >oracle port.
> > > 
> > >Can someone please help me understand the DBCP behaviour
> > here? how can
> > >it go beyond maxActive?
> > >
> > >Thanks,
> > >Bhaskar
> > > 
> > >System info:
> > >---------------  S Y S T E M  ---------------
> > > 
> > >OS:Red Hat Enterprise Linux AS release 4 (Nahant Update 2)
> > > 
> > >uname:Linux 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:32:14 EDT 2005 i686
> > >
> > > 
> > >vm_info: Java HotSpot(TM) Server VM (1.4.2_13-b06) for
> > linux-x86, built
> > >on Oct 18 2006 09:55:11 by unknown with unknown compiler
> > >
> > > 
> > >
> > >  
> > >
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org To 
> unsubscribe, 
> > e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To 
> unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: More number of connections got created than maxActive

Posted by Bhaskar <bh...@yahoo-inc.com>.
Yes. I tested it. After stopping tomcat, all connections to oracle went down
and only my app was running in tomcat .



> -----Original Message-----
> From: David Smith [mailto:dns4@cornell.edu] 
> Sent: Monday, October 15, 2007 6:59 PM
> To: Tomcat Users List
> Subject: Re: More number of connections got created than maxActive
> 
> Can you determine with certainty that this one pool was 
> responsible for all 121 connections?  You don't have any 
> other webapps with their own pool hitting the same db?
> 
> --David
> 
> Bhaskar wrote:
> 
> >Hi,
> >I am currently using dbcp 1.2.1 with common pool 1.3. 
> Currently i have 
> >following settings in server.xml:
> >maxActive = 50
> >maxIdle = 30
> >minIdle=30
> >factory=org.apache.commons.dbcp.BasicDataSourceFactory
> >maxWait=10000
> >timeBetweenEvictionRunsMillis=900000
> >numTestsPerEvictionRun=50
> >minEvictableIdleTimeMillis=1800000
> >testWhileIdle=true
> >testOnBorrow = true
> >validationQuery='select 1 from dual'
> >
> >Issue is when i restarted tomcat, i seen there were only 6 
> connections.
> >After 15 minutes, i see there were 121 connections in 
> netstat against 
> >oracle port.
> > 
> >Can someone please help me understand the DBCP behaviour 
> here? how can 
> >it go beyond maxActive?
> >
> >Thanks,
> >Bhaskar
> > 
> >System info:
> >---------------  S Y S T E M  ---------------
> > 
> >OS:Red Hat Enterprise Linux AS release 4 (Nahant Update 2)
> > 
> >uname:Linux 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:32:14 EDT 2005 i686
> >
> > 
> >vm_info: Java HotSpot(TM) Server VM (1.4.2_13-b06) for 
> linux-x86, built 
> >on Oct 18 2006 09:55:11 by unknown with unknown compiler
> >
> > 
> >
> >  
> >
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To 
> unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: More number of connections got created than maxActive

Posted by David Smith <dn...@cornell.edu>.
Can you determine with certainty that this one pool was responsible for 
all 121 connections?  You don't have any other webapps with their own 
pool hitting the same db?

--David

Bhaskar wrote:

>Hi,
>I am currently using dbcp 1.2.1 with common pool 1.3. Currently i have
>following settings in server.xml:
>maxActive = 50
>maxIdle = 30
>minIdle=30
>factory=org.apache.commons.dbcp.BasicDataSourceFactory
>maxWait=10000
>timeBetweenEvictionRunsMillis=900000
>numTestsPerEvictionRun=50
>minEvictableIdleTimeMillis=1800000
>testWhileIdle=true
>testOnBorrow = true
>validationQuery='select 1 from dual'
>
>Issue is when i restarted tomcat, i seen there were only 6 connections.
>After 15 minutes, i see there were 121 connections in netstat against oracle
>port.
> 
>Can someone please help me understand the DBCP behaviour here? how can it go
>beyond maxActive? 
>
>Thanks,
>Bhaskar
> 
>System info:
>---------------  S Y S T E M  ---------------
> 
>OS:Red Hat Enterprise Linux AS release 4 (Nahant Update 2)
> 
>uname:Linux 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:32:14 EDT 2005 i686
>
> 
>vm_info: Java HotSpot(TM) Server VM (1.4.2_13-b06) for linux-x86, built on
>Oct 18 2006 09:55:11 by unknown with unknown compiler
>
> 
>
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org