tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vasily Kukhta <v.b.kuk...@gmail.com>
Subject Tomcat JDBC pool - too many connections in TIME_WAIT state
Date Wed, 05 Nov 2014 14:13:47 GMT
Hello all!

I have developed an application using Tomcat JDBC pool. Everything is fine
except that the pool leaves hundreds of TCP connections in TIME_WAIT state,
which kills the server sooner or later... Could you please suggest what to
fix, my configuration is below:

            PoolProperties pp = new PoolProperties();

            String connprops =
"oracle.net.CONNECT_TIMEOUT=3000;oracle.jdbc.ReadTimeout=3000;oracle.net.READ_TIMEOUT=3000";

            pp.setUsername(user);
            pp.setPassword(pass);
            pp.setConnectionProperties(connprops);

            pp.setDriverClassName("oracle.jdbc.OracleDriver");

            pp.setTestOnBorrow(true);
            pp.setTestOnConnect(true);

            pp.setTestWhileIdle(true);

            pp.setMaxWait(1000);
            pp.setMinEvictableIdleTimeMillis(10000);
            pp.setTimeBetweenEvictionRunsMillis(5000);

            pp.setValidationInterval(10000);
            pp.setValidationQuery("SELECT 1 FROM DUAL");

            pp.setRemoveAbandoned(true);
            pp.setRemoveAbandonedTimeout(5);

pp.setJdbcInterceptors("org.apache.tomcat.jdbc.pool.interceptor.QueryTimeoutInterceptor(queryTimeout=3)");
            dataSource = new DataSource();
            dataSource.setPoolProperties(pp);

Thank you in advance!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message