Configuring the Dynamic LDAP connection pool

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

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.

Tell me more...

When you change the connection settings (URL, secure mode, credentials) or the pool configuration, Confluence creates a new connection pool with your updated configuration. The pool is created almost immediately, but there’s still a chance that actions performed by your users will require borrowing connections from the old pool, which will fail during this short period of time. The problem isn’t guaranteed — the connections already borrowed from the old pool will continue to work, it’s only the new connections that fail. To prevent any problems, it’s safer to wait until there aren’t many users around.

Enable the connection pool

To enable the Dynamic LDAP connection pool for a directory:

  1. Go to Administration menu , then General Configuration.

  2. Select User directories from the side menu.
  3. From the list, choose a connector directory or delegated directory and select Edit.

  4. Expand the LDAP Connection Pooling section.

  5. Select the Dynamic pool option.

  6. Configure the parameters. You can find more information about them in the table below.

  7. Select Quick Test to test your settings. You will receive a success message if the connection is able to be established.
  8. 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 parameterDescriptionDefault 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.

How 'Connection Timeout' works for your directory type...

The 'Connection Timeout' parameter works differently depending on your directory type:

  • Dynamic pool – it specifies the time limit for connecting to a directory.
  • JNDI pool – it specifies the time limit for connecting to a directory and the maximum time the pool waits for a connection to be returned after the pool has been exhausted.

For the dynamic pool, the maximum time the pool waits for a connection to be returned is separated and controlled by 'Max wait', described below.

Dynamic pool parameterDescriptionDefault 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 parameterDescriptionDefault value
Test when creating a connectionValidates connections when they’re created. If the connection fails to validate, it can’t be borrowed.false
Test when borrowing a connectionValidates 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 connectionValidates connections when returning them to the pool.false
Test idle connectionsValidates idle connections. If a connection fails to validate, it’s dropped from the pool.false

Evicting idle connections

Dynamic pool parameterDescriptionDefault 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.

Last modified on Dec 19, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.