• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc pool - heavy load configuration

 
yair fridman
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
i have the following configuration for the tomcat-jdbc to get pooledConnection , is it good for production environment under stress ?

PoolProperties p = new PoolProperties();
// p.setUrl("jdbc:mysql://localhost:3306/mysql");
p.setUrl("jdbc:mysql://"+url+"?autoReconnect=true");
p.setDriverClassName("com.mysql.jdbc.Driver");
p.setUsername(user);
p.setPassword(password);
p.setJmxEnabled(true);
p.setTestWhileIdle(false);
p.setTestOnBorrow(true);
p.setValidationQuery("SELECT 1");
p.setTestOnReturn(false);
p.setValidationInterval(30000);
p.setTimeBetweenEvictionRunsMillis(30000);
p.setMaxActive(40);
p.setInitialSize(5);
p.setMaxWait(7000);
p.setRemoveAbandonedTimeout(20); //in seconds
p.setMinEvictableIdleTimeMillis(30000);
p.setMinIdle(10);
p.setMaxIdle(35);
p.setLogAbandoned(true);
p.setRemoveAbandoned(true);
p.setJdbcInterceptors(
"org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;"+
"org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer");

DataSource datasource = new DataSource();
datasource.setPoolProperties(p);

thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35269
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"It depends." There's really no way to say. It depends on your application and server. You'd need to run a stress test or load test to find out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic