Question

In Tomcat, your META-INF/context.xml file can contain a JNDI datasource object like so:

<Resource
    name="jdbc/dbLogging"
    auth="Container"
    type="javax.sql.DataSource"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://mysql.server.example.com:3306/my_db"
    username="my_user"
    password="my_password"

    maxActive="15"
    maxIdle="3"
    maxWait="-1"
/>

What calculations/algorithms/heuristics/etc. can I use to tune what the values of the connection pool settings (maxActive, maxIdle, maxWait, etc.) should be?

Are there any other major connection pool settings I'm overlooking here?

Was it helpful?

Solution

You may also use

<Context>
   ...
   <Resource name="jdbc/oralocal" auth="Container" type="javax.sql.DataSource"
         url="your URL"
         driverClassName="driver class name"
         username="dbuser" password="password"
         maxActive="20" 
         maxIdle="3" 
         maxWait="10000"
         poolPreparedStatements="true"
         maxOpenPreparedStatements="100"
         validationQuery="SQL Query" />
</Context>

Pooling of prepared statements and maximum open prepared statements also you can use to tune prepared statements.

have a Look at this

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top