Configuring the Dynamic LDAP connection pool
A 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 only available for connector directories and delegated authentication directories (see list below). It also supports StartTLS connections.
Connector directories include:
Microsoft Active Directory (AD directory) – this option provides a quick way to select AD which is the most popular LDAP directory type
LDAP directory — you'll be able to select from other LDAP directory types on the next screen
Delegated authentication directories include:
- Internal with LDAP Authentication
Before you begin
When you switch between the JNDI and Dynamic LDAP pools, or change the configuration of the Dynamic pool, you don’t need to restart Confluence.
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:
Go to Administration > General Configuration.
- Select User directories from the side menu.
From the list, choose a connector directory or delegated directory and select Edit.
Expand the LDAP Connection Pooling section.
Select the Dynamic pool option.
Configure the parameters. You can find more information about them in the table below.
- Select Quick Test to test your settings. You will receive a success message if the connection is able to be established.
- Select Save and Test to save your changes.
Screenshot: Setting Dynamic LDAP pool for an existing directory
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
Note that the following parameters are different to the 'Connection Timeout' parameter within the Advanced Settings expandable section.
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 any 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) |
Now that you've enabled a Dynamic LDAP connection pool, learn how to monitor it.