Configuring the Dynamic LDAP connection pool
Dynamic LDAP connection pool provides support for detailed pool configuration on a per-directory basis and adds parameters to control the validation and maintenance of each connection pool. It's available only for directories of type Connector and Delegated Authentication. It also supports StartTLS connections.
Before you begin
When you switch between the JNDI and Dynamic pools, or change the configuration of the Dynamic pool, you don’t need to restart Crowd.
However, we recommend that you change the configuration only outside of working hours. Any change might terminate all actions that are being performed on a directory, resulting in short outages.
Enable the connection pool
To enable the Dynamic LDAP connection pool for a directory:
Log in to the Crowd Administration Console.
In the top navigation bar, click Directories.
The Directory Browser opens.Select an existing Connector or Delegated Directory.
Select the LDAP Connection Pooling tab.
Select Dynamic pool option for LDAP connection pooling.
Configure the parameters. You can find more information about them in the table further below.
Pool parameters
You can configure the following parameters for each Dynamic connection pool.
Pool size
Dynamic pool parameter | Description | Default value |
---|---|---|
Max total | The maximum number of active connections (for all types) that can be allocated from the pool at the same time. A non-positive value sets the number to unlimited. | -1 |
Max total per type | The limit of connection slots allocated by the pool (checked out or idle), per key. Each key type determines a sub-pool of read-only or read-write connections. When the limit is reached, the sub-pool is exhausted. A non-positive value sets the number to unlimited. | -1 |
Max idle per type | The maximum number of active connections of each key type (read-only and read-write) that can remain idle in the pool without extra connections being released. Each key type determines a sub-pool of read-only and read-write connections. A non-positive value sets the number to unlimited. | -1 |
Min idle per type | The minimum number of active connections of each key type (read-only and read-write) that can remain idle in the pool, without extra connections being created. Each key type determines a sub-pool of read-only and read-write connections. A non-positive value sets the number to unlimited. | 0 |
Pool behavior when exhausted
The following parameters are different from the 'Connection timeout' parameter that you can find in the Connector tab.
Dynamic pool parameter | Description | Default value |
---|---|---|
Wait when exhausted | If enabled, the pool waits for a connection to be returned if none are available. Otherwise, it saves an error into the log file saying the pool has been exhausted. If the Max wait parameter is configured with a positive value, then a NoSuchElementException is thrown if there aren’t new available connection slots after the waiting period is exceeded. | true |
Max wait | Determines the maximum time the pool waits for a connection to be returned if the ‘Wait when exhausted’ option is enabled. Choose a non-positive value to wait indefinitely. This is only applicable when the Wait when exhausted option is enabled. | -1 |
Testing connections
Dynamic pool parameter | Description | Default value |
---|---|---|
Test when creating a connection | Validates connections when they’re created. If the connection fails to validate, it can’t be borrowed. | false |
Test when borrowing a connection | Validates connections when borrowing them from the pool. If the connection fails to validate, it’s dropped from the pool and an attempt to borrow another one is made. | true |
Test when returning a connection | Validates connections when returning them to the pool. | false |
Test idle connections | Validates idle connections. If a connection fails to validate, it’s dropped from the pool. | false |
Evicting idle connections
Dynamic pool parameter | Description | Default value |
---|---|---|
Eviction frequency (seconds) | Determines the frequency of evicting connections that are eligible for eviction. The value must be a positive integer. | 300 sec (5 minutes) |
Eviction eligibility time (seconds) | Determines how long a connection needs to be idle to be eligible for eviction. | 300 sec (5 minutes) |
Monitor the connection pool
You can monitor the LDAP connection pool by using REST API or a JMX interface. For more info, see Monitoring the Dynamic LDAP connection pool.