User authentication is massively slow

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

You notice user authentication is getting massively slow when you have a few users trying to connect at same time. Almost like Confluence is letting just one user to login at a time.

Environment

Confluence Server or Data Center with LDAP user directory.

Diagnosis

Go to LDAP Connection Pool Configuration and check the value of Maximum Pool Size:

  1. Click on the cog icon, then choose General Configuration

  2. Click 'User Directories' in the left-hand panel.

  3. Click 'LDAP Connection Pool Configuration' in the 'Additional Configuration' section.



If you see Maximum Pool Size as “0 (new value: )” it means the value is not valid.

Cause

The default value for Maximum Pool Size is 0, which means the pool can grow unlimited. This is not an issue as it grows on demand, and after Pool Timeout is reached Confluence reduces the pool size until Preferred Pool Size.

On this issue, Maximum Pool Size is set to NULL. Confluence starts the pool with the size defined on Initial Pool Size and it is not able to grow because Maximum Pool Size has an invalid value.

Note that the situation above was described based on Confluence default values for those parameters.

Solution

Where a workaround involves running SQL scripts directly on your database, we strongly recommend you do this first on a non-production, staging or test environment before running the scripts on your production database. We also strongly recommend you take a backup of your data before making any modifications via SQL scripts.

As Maximum Pool Size is set to an invalid value, it will not be possible to use UI to update the value. That's why we will need to update the value on database.

Step 1: Stop Confluence

As we are manipulating data, the instance must be stopped before proceeding.

Step 2: Update the Maximum Pool Size

Run the following statement on Confluence database to update Maximum Pool Size

update cwd_application_attribute set attribute_value = 0 where attribute_name = 'com.sun.jndi.ldap.connect.pool.maxsize';

Step 3: Start Confluence

Start Confluence and validate if there was a performance improvement during authentication.


Last modified on Aug 10, 2022

Was this helpful?

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