Hi,
In some stress tests of my application I'm guessing the following exception (BoneCP 0.7.0):
Caused by: java.sql.SQLException: Timed out waiting for a free available connection.
at com.jolbox.bonecp.BoneCP.getConnection(BoneCP.java:432)
at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:91)
I don't have a timeout set for BoneCP, so I'm thinking it should default to Long.MAX_VALUE, so I'm not sure why I'm getting this exception.
Our application has 128 threads that are doing reasonably quick database operations, but they may occasionally take a while, here's the BoneCP config:
<property name="idleMaxAge" value="30"/>
<property name="idleConnectionTestPeriod" value="30"/>
<property name="partitionCount" value="${bonecp.partitionCount}"/>
<property name="acquireIncrement" value="10"/>
<property name="maxConnectionsPerPartition" value="20"/>
<property name="minConnectionsPerPartition" value="60"/>
<property name="statementsCacheSize" value="0"/>
<property name="releaseHelperThreads" value="3"/>
<property name="connectionTestStatement" value="select 1"/>
It starts to happen an hour or so after starting our stress test, and our stress test does around 100 operations per second. We were seeing the exception several times an hour. Using the profiler YourKit, I saw there was quite a bit of contention on the monitor for Connections from the threads making the call, and the statement release helper threads, so I disabled them by adding the following to the config:
<property name="statementReleaseHelperThreads" value="0"/>
This brought down the number of exceptions drastically, down to around one every few hours.
Any thoughts or help would be appreciate.
Thanks,
Chris
