Jira Label performance grows slow linearly as Jira scales

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

There are some scenarios when slowness is observed when there are operations related to labels. A common scenario is that it takes Jira a long time to display suggestions when typing on or clicking on the Label field of an issue.

Often times, performance issues with labels can be due to the sheer volume of labels that the Jira operation has to search through.

There is no fixed number that would be considered as large amount of labels, as it would be dependent on each Jira environment's processing power and capacity.

Diagnosis:

  • Thread dumps reveal that we’re spending a lot of time loading the label suggestions:

URL: /rest/api/1.0/labels/suggest
  • In the stack trace, we see that we’re first loading ALL the UNIQUE labels - followed by sorting the most used ones to show label suggestions to the users:
    at com.atlassian.jira.web.bean.StatisticAccessorBean.getWrapper(StatisticAccessorBean.java:126)
	at com.atlassian.jira.web.bean.StatisticAccessorBean.getAllFilterBy(StatisticAccessorBean.java:283)
	at com.atlassian.jira.issue.label.suggestions.PopularLabelsProvider.findMostPopular(PopularLabelsProvider.java:20)
	at com.atlassian.jira.issue.label.suggestions.LabelSuggester.getSuggestions(LabelSuggester.java:55)
	at com.atlassian.jira.issue.label.suggestions.LabelSuggester.getSuggestedLabels(LabelSuggester.java:26)
	at com.atlassian.jira.issue.label.DefaultLabelManager.getSuggestedLabels(DefaultLabelManager.java:149)
	at com.atlassian.jira.bc.issue.label.DefaultLabelService.getSuggestedLabels(DefaultLabelService.java:178)
  • We were able to reproduce the scalability issue with Label performance as the instance size grows and we can see the linear degradation of the label suggestion performance:


Solution/Workaround

There is a bug ticket JRASERVER-7376: Label suggestions performance grows slow linearly as Jira scales and a suggestion ticket JRASERVER-23656: Labels suggestion should be scoped by project for improving label performance.

If you're looking for a workaround to try and improve label related performance, the only known way to improve this would be to reduce the volume of labels.
A common approach to carry this out is to either merge or delete labels.

Merge Labels

Labels are case sensitive. If you know of labels that seem to be duplicates of each other because of the difference in case, you have the option to

  1. Create a new label (that does not exist yet) called example;
  2. Replace all occurrences of labels Example and EXAMPLE with the newly created label example.

Delete Labels

Another approach would be to delete labels used in few issues. Once a label is not present in any issue, it ceases to exist.

Query Labels

For both cases, the SQL query below lists all labels and the number of issues with references to them:

SELECT COUNT(*) FROM label;
SELECT COUNT(DISTINCT l.label) FROM label l;
SELECT count(*) from "label" l group by l."label" order by count DESC limit 10;


Bulk Merge or Delete Labels

Once you find out which labels need to be merged or deleted, the third-party app below may be useful to perform the needed bulk changes in issues:

  • Bulk Operation Enhancer for Jira
    (info) We recommend reaching out to the app support team if you have any questions about its functionality, or if you run into issues when using this app, as Atlassian Support does not cover third-party apps or software.





Last modified on Sep 28, 2023

Was this helpful?

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