Confluence creates too many Oracle DB connections when c3p0.preferredTestQuery differs in different nodes

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


When the confluence.cfg.xml  parameter:

<property name="hibernate.c3p0.preferredTestQuery">select 1</property>

differs in a multi node cluster, the instance tends to create thousands of connections within an hour. Though there is no clear indication where these connections originate from. The default value is set as  "select 1" and if this value defers from node to node, we do tend to see high number of connections with no obvious clue from the server logs.

Environment

Confluence 7.4.7.

C3P0 connection pool is used in Confluence 7.13 and earlier. Confluence 7.14 and later uses Hikari hence the solution in this article doesn't apply to Confluence 7.14 and later.

Diagnosis

If users notice several thousand connections originating from the application in a short duration and if any typical causes such as plugins, automated APIs or user-action is not causing the issue, please check the following parameter value from all nodes. Also ensure that other factors such as external plugins, automated scripts/APIs or other user actions or not causing this pattern. There may not be any discernible root cause identified from the server logs related to these connections. 

<property name="hibernate.c3p0.preferredTestQuery">select 1</property>

Cause


Not identified at this time.

Solution


Shut down the instances (one node at a time in case of a multi node environment ) and ensure that the following value is the same across nodes and also configure the c3p0 value 0. Restart the node(s)

<property name="hibernate.c3p0.timeout">0</property>
<property name="hibernate.c3p0.preferredTestQuery">select 1</property>
Last modified on May 22, 2024

Was this helpful?

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