How To
Archived

How do I configure the connection pool for the managed repository in OpenIDM 4.x?

Last updated Jan 5, 2021

The purpose of this article is to provide information on configuring the JDBC connection pool for the managed repository in OpenIDM. These configurations apply when you are using a JDBC database.


1 reader recommends this article

Archived

This article has been archived and is no longer maintained by ForgeRock.

Overview

IDM 5 and later

IDM 5 and later uses the Hikari connection pool by default. See Integrator's Guide › Understanding the JDBC Connection Configuration File and Hikari Project Page for further information on configuring the connection pool settings.

Pre-IDM 5

Pre-IDM 5 uses the BoneCP connection pool to manage connections to the managed repository. The 0.7.1 version of the BoneCP connection pool is bundled with OpenIDM. 

You can configure the connection pool settings by changing the values of the default settings in this connection section as required and by adding additional BoneCP properties. All the properties you can configure and/or add are described in BoneCP 0.7.1 - BoneCPConfig.java.

Partition properties are particularly useful; these can be used to group connections in the connection pool to minimize connection locks and improve performance. For example, you can add the following 3 partition properties:

  • partitionCount - this property defines the number of connection groups. By default, this property is set to 1 but you can increase it. The BoneCP configuration documents suggest a setting of 2-4, depending on your application. Other people suggest setting this to the number of cores, since this is a good indicator of how many threads can concurrently access the connection pool. In some cases where the threads are very short-lived, a higher partitionCount may yield better performance. You should try different settings to see what setting is most appropriate to your environment.
  • minConnectionsPerPartition - this property defines the number of connections immediately allocated per partition when the connection pool is created.
  • maxConnectionsPerPartition - this property defines the maximum number of connections per partition. The total number of connections available is therefore maxConnectionsPerPartition x partitionCount, although the number of connections initially created is determined by the minConnectionsPerPartition setting.

See the following section for an example.

Configuring the connection pool example

The following example shows the datasource.jdbc-default.json file (located in the /path/to/openidm/conf directory) for a MySQL™ database with the additional partition properties added:

{ "driverClass" : "com.mysql.jdbc.Driver", "jdbcUrl" : "jdbc:mysql://localhost:3306/openidm?allowMultiQueries=true&characterEncoding=utf8", "databaseName" : "openidm", "username" : "openidm", "password" : "openidm", "connectionTimeout" : 30000, "connectionPool" : { "type" : "bonecp", "partitionCount" : 3, "minConnectionsPerPartition" : 4, "maxConnectionsPerPartition" : 7 } }

These partition settings would give you a total of 21 connections with 12 being created initially.

See Also

BoneCP Configuration

BoneCP 0.7.1 - BoneCPConfig.java

Related Training

N/A

Related Issue Tracker IDs

N/A


Copyright and Trademarks Copyright © 2021 ForgeRock, all rights reserved.