Forums Register Login

jdbc pool - heavy load configuration

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
"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.
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1247 times.
Similar Threads
RE: accessing database using JNDI
datasource for mysql
EJB connect with Mysql
Help with context.xml for data source
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:43:23.