You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by daniel steel <se...@yahoo.com> on 2009/06/30 22:01:51 UTC

Connection Pool Tuning

hi all,
  we are running a load test using tomcat6 with SQL Server and dbcp connection pooling.
This is our current conn pool set up - Some of the parameters are not ideal for prod env..

initialSize="5"
maxActive="-2"
maxIdle="85"
maxWait="10000"
timeBetweenEvictionRunsMillis="1800000"
removeAbandoned="true"
removeAbandonedTimeout="4"

During the run, for some of the long running jsp  we started getting errors and logs had these kind of errors..

1.
java.sql.SQLException: Connection net.sourceforge.jtds.jdbc.ConnectionJDBC3@a6ebc0c is closed.
    at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.checkOpen(DelegatingConnection.java:354)
    at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.createStatement(DelegatingConnection.java:222)
    at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.createStatement(PoolingDataSource.java:205)

2. 
java.sql.SQLException: Invalid state, the Connection object is closed.
    at net.sourceforge.jtds.jdbc.TdsCore.checkOpen(TdsCore.java:448)
    at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:946)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:406)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1258)
    at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)

Is these errors because of removeAbandonedTimeoutsetting? 
would increasing the timeout help in reducing the errors? 
or 
what would cause these errors? 
would turning on logAbandoned help to correlate these errors to connection closed by dbcp?

thank you
bharat



      

Re: Connection Pool Tuning

Posted by Mark Thomas <ma...@apache.org>.
daniel steel wrote:
> hi all,
>   we are running a load test using tomcat6 with SQL Server and dbcp connection pooling.
> This is our current conn pool set up - Some of the parameters are not ideal for prod env..
> 
> initialSize="5"
> maxActive="-2"
> maxIdle="85"
> maxWait="10000"
> timeBetweenEvictionRunsMillis="1800000"
> removeAbandoned="true"
> removeAbandonedTimeout="4"
> 
> During the run, for some of the long running jsp  we started getting errors and logs had these kind of errors..
> 
> 1.
> java.sql.SQLException: Connection net.sourceforge.jtds.jdbc.ConnectionJDBC3@a6ebc0c is closed.
>     at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.checkOpen(DelegatingConnection.java:354)
>     at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.createStatement(DelegatingConnection.java:222)
>     at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.createStatement(PoolingDataSource.java:205)
> 
> 2. 
> java.sql.SQLException: Invalid state, the Connection object is closed.
>     at net.sourceforge.jtds.jdbc.TdsCore.checkOpen(TdsCore.java:448)
>     at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:946)
>     at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:406)
>     at net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1258)
>     at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
> 
> Is these errors because of removeAbandonedTimeoutsetting?

Almost certainly.

> would increasing the timeout help in reducing the errors?

Have you tried increasing it?

> or 
> what would cause these errors? 
> would turning on logAbandoned help to correlate these errors to connection closed by dbcp?

That won't hurt and will at least give you more information about what
is going on.

Mark


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