java - Connection pool in tomcat 7 -
here current config
<resource name="jdbc/data" auth="container" type="javax.sql.datasource" factory="org.apache.tomcat.jdbc.pool.datasourcefactory" driverclassname="com.mysql.jdbc.driver" url="jdbc:mysql://localhost:3306/table_name" username="user_name" password="password" initialsize="10" maxactive="50" suspecttimeout="120" minidle="10" maxidle="20" maxwait="1000" testonborrow="true" timebetweenevictionrunsmillis="30000" minevictableidletimemillis="60000" validationquery="select 1 dual" validationinterval="40" removeabandoned="true" removeabandonedtimeout="100" /> this in global context multiple apps can use it. little confused parameters.need details. understand is
initalsize number of connection created when pool started.
maxactive maximum 50 connections can active @ time.
minidle 10 connections remain idle when connection not used else closed after maxwait
maxidle 20 connections can store idle.
but when start tomcat server can see 30 idle connections remains forever.why happens? missing ? according understanding connection pool there should 10 connections should created , can stay in idle mode. there specific changes have mysql my.cnf
when say...
this in global context multiple apps can use it.
what mean? in $catalina_base/conf/server.xml in globalnamingresources block or in $catalina_base/conf/context.xml?
defining resource tag in globalnamingresources block of $catalina_base/conf/server.xml cause 1 resource created across entire server. can shared applications deployed on system adding resourcelink tag context configuration.
defining resource in $catalina_base/conf/context.xml define resource once each application deployed tomcat instance. if have 3 applications deployed, you'll end 3 separate resources. guess, why seeing 30 connections database server.
Comments
Post a Comment