Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Adaptavist Scriptrunner and Jira Database Connection Pool

Devin Foley
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 27, 2018

Software Versions:

  • Jira Sever v7.6.3
  • Scriptrunner for Jira v5.3.9

 

I'm utilizing scriptrunner scripts triggered as a post function of an Epic transition to generate a number of related Story issues. The general purpose of these scripts is to facilitate "templated" construction of pre-defined project steps defined by the created Stories. The script will iterate through an array of attributes to:

  • Create the stories
  • Populate several fields on the story issues
  • Relate the stories to the Epic
  • Create issues linkages to "predecessor" stories as blocking issues

The scripts will create anywhere from 5 - 90 Story issues depending on the use case.

The issue I have encountered is that the process consumes all available database connections from Jira's database connection pool. This can effectively render Jira unusable during construction of the larger templates. It also appears to take up to several minutes for the connections to be released back into the pool upon completion of the script execution.

My question is this - is there a way to gate the number of database connections used from Jira's DB connection pool during execution of a Scriptrunner script? I'm less concerned with duration of script execution as I am with overall performance of Jira.

 

 

 

1 comment

Comment

Log in or Sign up to comment
Sid
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.
December 23, 2018

Check existing usage of database connection pool

  1. Login to Jira as a Jira Administrator, and go to Settings >> System.
  2. Go to 'Database Monitoring' section and check your JIRA's database connection usage.
  3. If you see most of your connection pools getting used up, you would need to increase your DB Connection Pool size. By Default it is set to Maximum 20 connections.

          

Increase DB Connection Pool Size

  • We recommend increasing the Jira DB Connection Pool size to around 100.
    • To do that, edit the dbconfig.xml file located at: <JIRA_HOME_DIRECTORY>/dbconfig.xml
    • Change the <pool-max-size>20</pool-max-size>, property to 100
    • Save the updated dbconfig.xml file.
  • Change the "max_connections", database parameter in Jira DB as per the number of Jira users.
  • After making the above changes, restart the Jira and MySQL services.

Alternatively, you can also refer the Official Atlassian Documentation link here, for tuning the database connections.

TAGS
AUG Leaders

Atlassian Community Events