database connections - sleeping = 20 typical?

Kevin Buchs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 26, 2014

We are running JIRA 6.2 connected to MySQL. A DBA came to me with a question about the 20 open connections JIRA is holding, which are all sleeping (we are not a busy instance). Are this number necessary? Performance enhancing? I see under Instrumentation: dbcp.maxActive Gauge 20 and related running = 0 and sleeping = 20. Can this be tuned?

1 answer

1 accepted

0 votes
Answer accepted
EddieW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 26, 2014

Yes, the size and properties can be tuned by editing dbconfig.xml in the root of the home directory.

I think this one, pool-min-idle may help your DBA's concern. WHich by default is == to max connections apprenently.


The minimum number of database connections that are allowed to remain idle in the pool.

Having this value set to that of Maximum Size (above), which is the case by default, means the pool will always have a fixed number of connections and idle connections will never be closed.

https://confluence.atlassian.com/display/JIRA/Tuning+Database+Connections

The trade off is that in the event of a spike in use, that the system could easily want to scale up to the max of 20 connections, but be delayed by the overhead of establishing new connections. (sounds trivial but db interactions should be on the multi-millisecond range to allow a modern app to be responsive)

Unless your DBA has real concerns, and isn't just curious I would encourage you to keep them equal. It should be common for apps connection to a DB to hold 10-30 connections, and the database servers should be scaled accordingly in my opinion.

But if you do want to tune them down, use a decent APM tool (a newrelic free account wwould suffice) and watch the response times of end to end transactions throughout the work week. Build a baseline first (with 20 idle pool) and then step down slowly (<5) and see if week over week changes for the worse.

Kevin Buchs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 27, 2014

Thanks, Eddie.

Kalpesh Pradhan (IN) May 14, 2019

Team,

I am looking for exact vaule for JIRA 

 

Maximum Idle
Mimnum Idle

Suggest an answer

Log in or Sign up to answer