Configuring the database connection pool
This page describes how to change the default database connection pool settings used by FishEye and Crucible.
FishEye and Crucible use the BoneCP connection pool manager to manage connections to the database. The BoneCP connection pool manager has been preconfigured in FishEye and Crucible to work out-of-the-box for most customers. However, you can override any of the default settings to fine tune performance, if you wish. For example, you may want to try increasing the minimum and/or maximum number of connections, if you are getting significant delays creating connections for clients.
On this page:
Related pages:
Setting Minimum and Maximum Database Connections
To configure the database connection pool:
- Log in to FishEye or Crucible as an administrator.
- In the Admin area, click Database (under 'System Settings').
- Click Edit.
- Enter new values for the Minimum Pool Connections and Maximum Pool Connections fields.
- Advanced users only. Enter any overrides of BoneCP properties in the Parameters field. Enter each parameter-value pair on a new line in the Parameters field. See the section below for details of some common properties you may wish to configure.
- Click Save.
Screenshot: Database configuration screen in FishEye / Crucible
Advanced: Tuning The Connection Pool via Properties
The following table shows some properties you can use to tune the database connection pool used by FishEye and Crucible. You can override any of these parameters by entering parameter-value pairs (on separate lines) into the Parameters field of the 'Database Configuration' dialog, as described above.
Refer to the BoneCP API javadoc for a full list and description of BoneCP properties.
Parameter | Property and Default Value | Description |
Connection timeout | bonecp.idleMaxAgeInMinutes=0 | Time to wait before dropping idle connections, in minutes. Zero means that idle connections will stay open forever. |
Connection test period | bonecp.idleConnectionTestPeriodInMinutes=60 | Database connections are kept alive by sending ping requests on idle connections. This value sets the time between pings, in minutes. |
Connection pool partition count | bonecp.partitionCount=3 | The database connection pool is split into a number of equal-sized "partitions" to increase concurrent performance. This property sets the number of partitions to use. Note that if you set this property, but not the bonecp.m inConnectionsPerPartition or bonecp.maxConnectionsPerPartition properties below, FishEye will use the "Minimum Pool Connections" and "Maximum Pool Connections" field settings to calculate the effective minimum and maximum connections per partition. These values will be calculated to ensure that the field settings are not exceeded. |
Max and min number of connections per partition |
Defaults calculated based on value of | These properties control the minimum and maximum number of connections in each partition. To calculate the the total number of connections in the pool: Note that setting these properties overrides the "Minimum Pool Connections" and "Maximum Pool Connections" field settings. |
Connection acquire increment | bonecp.acquireIncrement=2 | The batch size used when BoneCP will acquire new connections. |
Statement cache size | bonecp. statementsCacheSize=50 | The statement cache size defaults to 50, except when using an Oracle database, for which it defaults to zero to avoid having too many open cursors. |
Connection test query | bonecp.connectionTestStatement By default boneCP will use a metadata request. | The query to send to the DB to maintain keep-alives and test for dead connections. This is database specific and should be set to a query that consumes the minimal amount of load on the server. Examples:
If you do not set this, then BoneCP will issue a metadata request instead that should work on all databases but is probably slower. (Note: In MySQL, prefixing the statement by /* ping *\/ makes the driver issue 1 fast packet instead. See http://blogs.sun.com/SDNChannel/entry/mysql_tips_for_java_developers ) |