Bitbucket Server-JIRA integration is slow after Bitbucket Server upgrade using Oracle

Still need help?

The Atlassian Community is here for you.

Ask the community

 

Symptoms

Integration with JIRA becomes very slow after a Bitbucket Server upgrade. 

Diagnosis

This can happen in Bitbucket Server installations that use Oracle with automatic statistics collection disabled.

Using a browser or an HTTP client (such as curl) invoke the following URL:

http://[BITBUCKET_DOMAIN]/rest/remote-link-aggregation/latest/aggregation?globalId=[JIRA_ISSUE]

The invocation can take several minutes to complete or even timeout (specially if Bitbucket Server is running behind a proxy).

Cause

Oracle automatic statistics collection is disabled. This can cause Oracle to use the wrong index for the integration queries. 

Note automatic statistics collections is enabled by default.

Verify that automatic statistics collections is disabled:

  • Using Oracle visual tools check the section "Automated Maintenance Tasks" and make sure "Optimizer statistics gathering" is disabled.
  • Or run the following queries to confirm that automatic statistics collections is disabled and when it was last run:
Queries
SELECT client_name, status FROM dba_autotask_operation;
SELECT * FROM dba_autotask_schedule;
SELECT task_name, status, to_char(last_good_date, 'YYYY-MM-DD HH24:MI:SS') last_good_date, last_good_duration FROM dba_autotask_task WHERE client_name = 'auto optimizer stats collection'; 

Resolution

Calculate new statistics and possibly enable automatic statistics collection as suggested by Oracle's documentation.

Example of statistics collection instruction:

exec dbms_stats.gather_database_stats(estimate_percent => 100, method_opt => 'for all columns size auto',options => 'Gather' ,cascade => true, degree => 4);

Note this can be a very time and cpu consuming operation.

To enable automatic statistics collection refer to Oracle's documentation.

Last modified on Feb 19, 2016

Was this helpful?

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