Skip to content

Instantly share code, notes, and snippets.

@sprix
Created August 14, 2014 06:37
dbcp settings
<?xml version='1.0' encoding='utf-8'?>
<Context>
<Resource
name="jdbc/sc_master"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/sc_ryi"
closeMethod="close"
username="root"
password="passwd"
initialSize="5"
minIdle="1"
maxIdle="10"
maxActive="100" ← tomcatのmaxThreadsに応じて変化させる。(maxThreads * サーバ台数)
maxWait="5000"
validationQuery="SELECT 1"
validationQueryTimeout="5"
testOnBorrow="true"
testWhileIdle="true"
timeBetweenEvictionRunsMillis="1800000"
numTestsPerEvictionRun="5"
minEvictableIdleTimeMillis="86400000"
removeAbandoned="true"
removeAbandonedTimeout="600"
/>
</Context>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment