You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Eric Prévost <ep...@yahoo.ca> on 2004/02/10 15:37:51 UTC
DBCP and removeAbandoned
Hi,
I'm using Tomcat 5.0.18 on Linux. My database server is Microsoft SQL Server 2000. I'm using Microsoft's JDBC driver. This is my data source definition in server.xml:
<Resource name="jdbc/intranet" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/intranet">
<parameter>
<name>validationQuery</name>
<value>select getdate()</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>50</value>
</parameter>
<parameter>
<name>password</name>
<value>myPassword</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:microsoft:sqlserver://myserver;DatabaseName=intranet</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<parameter>
<name>username</name>
<value>MyUsername</value>
</parameter>
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
</ResourceParams>
When I stress-test my application with JMeter, I can see over 80 connections on my database server, and they are not released until I stop tomcat... Is removeAbandoned parameter not supposed to take care of these connections???
Thank you
Eric Prévost
---------------------------------
Lèche-vitrine ou lèche-écran ? Yahoo! Magasinage.
Re: DBCP and removeAbandoned
Posted by Philipp Taprogge <Ph...@gmx.net>.
Hi!
Eric Prévost wrote:
> I'm using Tomcat 5.0.18 on Linux. My database server is Microsoft SQL Server 2000. I'm using Microsoft's JDBC driver.
> When I stress-test my application with JMeter, I can see over 80 connections on my database server, and they are not
> released until I stop tomcat... Is removeAbandoned parameter not supposed to take care of these connections???
I am not entirely sure here, so please correct me, if I'm wrong, but...
you are using dbcp, right? So, isn't the pool _supposed_ to reuse open
connections instead of closing them and reopening anew for each request?
I think what you should do is choose a reasonable max number of
connections and then stress-test while look for a dbcp exception
indicating that no new connection could be acquired. If you get one,
either removeabandoned is not working properly, of (more likely) your
application keeps a hold on connections that therefor are not
concidered abandoned. If you don't get an exception, you can be quite
sure you will never see more connections than you specified.
HTH
Phil
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: DBCP and removeAbandoned
Posted by Eric Prévost <ep...@yahoo.ca>.
There is only one application on this tomcat server... It's easy to identify these connections on SQL server. Also, there is no explicit database connection in the application code: it all pass through JNDI.
I also tried to increase my maxActive setting to 100. It didn't change anything.
I set logAbandoned to true. I never see anything related to dbcp in my logs except this, in calatina.out:
AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@b82bbc6)
LogAbandoned: true
RemoveAbandoned: true
RemoveAbandonedTimeout: 10
What can it be? Maybe someone stored a resultset in session?
SMaric <st...@eaac.co.uk> wrote:
When you say 'the connections was still alive this morning'
How are you testing for connections being abandoned
Also your
maxActive = 50 // doesn't this mean you shouldn't get more tahn
50 connections from the pool
if this is true (& working) then HOW do you know that the 80 connections are
from this Pool ???
Are you are the only point of connection to the DB
"Eric Prévost" wrote in message
news:20040210151943.56650.qmail@web21404.mail.yahoo.com...
> I did my tests yesterday, and the connections was still alive this
morning... I also tested 5 seconds before.
>
> SMaric wrote:Hi
>
> If I've understood things correctly
> removeAbandoned should enable recovery of 'lost' connections - ie your
> webApp dies without cleanly releaseing the Connection object, so having
> removeAbandoned on tells the container to keep an eye on things
>
> You've also got the timeout set to 60 (secs ??) - did you wait this long
> when you were checking
>
> Obviously when you stop Tomcat, the whole JRE gets shutdown so what you've
> seen there is correct
>
>
> "Eric Prévost" wrote in message
> news:20040210143751.16341.qmail@web21405.mail.yahoo.com...
> > Hi,
> >
> > I'm using Tomcat 5.0.18 on Linux. My database server is Microsoft SQL
> Server 2000. I'm using Microsoft's JDBC driver. This is my data source
> definition in server.xml:
> >
> >
> >
> >
>
> > validationQuery
> > select getdate()
> >
>
> >
>
> > maxWait
> > 5000
> >
>
> >
>
> > maxActive
> > 50
> >
>
> >
>
> > password
> > myPassword
> >
>
> >
>
> > url
> >
> jdbc:microsoft:sqlserver://myserver;DatabaseName=intranet
> >
>
> >
>
> > driverClassName
> > com.microsoft.jdbc.sqlserver.SQLServerDriver
> >
>
> >
>
> > maxIdle
> > 30
> >
>
> >
>
> > username
> > MyUsername
> >
>
> >
>
> > removeAbandoned
> > true
> >
>
> >
>
> > removeAbandonedTimeout
> > 60
> >
>
> >
>
> > factory
> > org.apache.commons.dbcp.BasicDataSourceFactory
> >
>
> >
> >
> >
> > When I stress-test my application with JMeter, I can see over 80
> connections on my database server, and they are not released until I stop
> tomcat... Is removeAbandoned parameter not supposed to take care of these
> connections???
> >
> > Thank you
> >
> > Eric Prévost
> >
> >
> >
> > ---------------------------------
> > Lèche-vitrine ou lèche-écran ? Yahoo! Magasinage.
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------
> Lèche-vitrine ou lèche-écran ? Yahoo! Magasinage.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------
Lèche-vitrine ou lèche-écran ? Yahoo! Magasinage.
Re: DBCP and removeAbandoned
Posted by SMaric <st...@eaac.co.uk>.
When you say 'the connections was still alive this morning'
How are you testing for connections being abandoned
Also your
maxActive = 50 // doesn't this mean you shouldn't get more tahn
50 connections from the pool
if this is true (& working) then HOW do you know that the 80 connections are
from this Pool ???
Are you are the only point of connection to the DB
"Eric Pr�vost" <ep...@yahoo.ca> wrote in message
news:20040210151943.56650.qmail@web21404.mail.yahoo.com...
> I did my tests yesterday, and the connections was still alive this
morning... I also tested 5 seconds before.
>
> SMaric <st...@eaac.co.uk> wrote:Hi
>
> If I've understood things correctly
> removeAbandoned should enable recovery of 'lost' connections - ie your
> webApp dies without cleanly releaseing the Connection object, so having
> removeAbandoned on tells the container to keep an eye on things
>
> You've also got the timeout set to 60 (secs ??) - did you wait this long
> when you were checking
>
> Obviously when you stop Tomcat, the whole JRE gets shutdown so what you've
> seen there is correct
>
>
> "Eric Pr�vost" wrote in message
> news:20040210143751.16341.qmail@web21405.mail.yahoo.com...
> > Hi,
> >
> > I'm using Tomcat 5.0.18 on Linux. My database server is Microsoft SQL
> Server 2000. I'm using Microsoft's JDBC driver. This is my data source
> definition in server.xml:
> >
> >
> >
> >
>
> > validationQuery
> > select getdate()
> >
>
> >
>
> > maxWait
> > 5000
> >
>
> >
>
> > maxActive
> > 50
> >
>
> >
>
> > password
> > myPassword
> >
>
> >
>
> > url
> >
> jdbc:microsoft:sqlserver://myserver;DatabaseName=intranet
> >
>
> >
>
> > driverClassName
> > com.microsoft.jdbc.sqlserver.SQLServerDriver
> >
>
> >
>
> > maxIdle
> > 30
> >
>
> >
>
> > username
> > MyUsername
> >
>
> >
>
> > removeAbandoned
> > true
> >
>
> >
>
> > removeAbandonedTimeout
> > 60
> >
>
> >
>
> > factory
> > org.apache.commons.dbcp.BasicDataSourceFactory
> >
>
> >
> >
> >
> > When I stress-test my application with JMeter, I can see over 80
> connections on my database server, and they are not released until I stop
> tomcat... Is removeAbandoned parameter not supposed to take care of these
> connections???
> >
> > Thank you
> >
> > Eric Pr�vost
> >
> >
> >
> > ---------------------------------
> > L�che-vitrine ou l�che-�cran ? Yahoo! Magasinage.
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------
> L�che-vitrine ou l�che-�cran ? Yahoo! Magasinage.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: DBCP and removeAbandoned
Posted by Eric Prévost <ep...@yahoo.ca>.
I did my tests yesterday, and the connections was still alive this morning... I also tested 5 seconds before.
SMaric <st...@eaac.co.uk> wrote:Hi
If I've understood things correctly
removeAbandoned should enable recovery of 'lost' connections - ie your
webApp dies without cleanly releaseing the Connection object, so having
removeAbandoned on tells the container to keep an eye on things
You've also got the timeout set to 60 (secs ??) - did you wait this long
when you were checking
Obviously when you stop Tomcat, the whole JRE gets shutdown so what you've
seen there is correct
"Eric Prévost" wrote in message
news:20040210143751.16341.qmail@web21405.mail.yahoo.com...
> Hi,
>
> I'm using Tomcat 5.0.18 on Linux. My database server is Microsoft SQL
Server 2000. I'm using Microsoft's JDBC driver. This is my data source
definition in server.xml:
>
>
>
>
> validationQuery
> select getdate()
>
>
> maxWait
> 5000
>
>
> maxActive
> 50
>
>
> password
> myPassword
>
>
> url
>
jdbc:microsoft:sqlserver://myserver;DatabaseName=intranet
>
>
> driverClassName
> com.microsoft.jdbc.sqlserver.SQLServerDriver
>
>
> maxIdle
> 30
>
>
> username
> MyUsername
>
>
> removeAbandoned
> true
>
>
> removeAbandonedTimeout
> 60
>
>
> factory
> org.apache.commons.dbcp.BasicDataSourceFactory
>
>
>
>
> When I stress-test my application with JMeter, I can see over 80
connections on my database server, and they are not released until I stop
tomcat... Is removeAbandoned parameter not supposed to take care of these
connections???
>
> Thank you
>
> Eric Prévost
>
>
>
> ---------------------------------
> Lèche-vitrine ou lèche-écran ? Yahoo! Magasinage.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------
Lèche-vitrine ou lèche-écran ? Yahoo! Magasinage.
Re: DBCP and removeAbandoned
Posted by SMaric <st...@eaac.co.uk>.
Hi
If I've understood things correctly
removeAbandoned should enable recovery of 'lost' connections - ie your
webApp dies without cleanly releaseing the Connection object, so having
removeAbandoned on tells the container to keep an eye on things
You've also got the timeout set to 60 (secs ??) - did you wait this long
when you were checking
Obviously when you stop Tomcat, the whole JRE gets shutdown so what you've
seen there is correct
"Eric Pr�vost" <ep...@yahoo.ca> wrote in message
news:20040210143751.16341.qmail@web21405.mail.yahoo.com...
> Hi,
>
> I'm using Tomcat 5.0.18 on Linux. My database server is Microsoft SQL
Server 2000. I'm using Microsoft's JDBC driver. This is my data source
definition in server.xml:
>
> <Resource name="jdbc/intranet" type="javax.sql.DataSource"/>
> <ResourceParams name="jdbc/intranet">
> <parameter>
> <name>validationQuery</name>
> <value>select getdate()</value>
> </parameter>
> <parameter>
> <name>maxWait</name>
> <value>5000</value>
> </parameter>
> <parameter>
> <name>maxActive</name>
> <value>50</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value>myPassword</value>
> </parameter>
> <parameter>
> <name>url</name>
>
<value>jdbc:microsoft:sqlserver://myserver;DatabaseName=intranet</value>
> </parameter>
> <parameter>
> <name>driverClassName</name>
> <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
> </parameter>
> <parameter>
> <name>maxIdle</name>
> <value>30</value>
> </parameter>
> <parameter>
> <name>username</name>
> <value>MyUsername</value>
> </parameter>
> <parameter>
> <name>removeAbandoned</name>
> <value>true</value>
> </parameter>
> <parameter>
> <name>removeAbandonedTimeout</name>
> <value>60</value>
> </parameter>
> <parameter>
> <name>factory</name>
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
> </parameter>
> </ResourceParams>
>
>
> When I stress-test my application with JMeter, I can see over 80
connections on my database server, and they are not released until I stop
tomcat... Is removeAbandoned parameter not supposed to take care of these
connections???
>
> Thank you
>
> Eric Pr�vost
>
>
>
> ---------------------------------
> L�che-vitrine ou l�che-�cran ? Yahoo! Magasinage.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org