Increase speed of reindexing in Jira server
Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.
If you have a large JIRA instance (>300k issues) then Full reindex might take a couple of hours. Performance of reindex depends on many factors: CPU performance, Disk performance, DB performance. By default, JIRA 7.x runs only 10 threads and Jira 8.x - 20 threads respectively to do a Full reindex , so if you have a really good hardware, then it might be underutilized and you can reduce re-index time. This is not applicable to background re-index as it's always single threaded.
Goal is to review system resources and increase number of index threads until you reach saturation point. You shouldn't look at single factor only. Please note that Lucene disk writer is single threaded, so the goal to prepare just enough data for it.
Please check system load during re-index:
- CPU utilisation (if it's below 50%, then you might benefit from tuning)
- Disk utilisation (if it's below 70%, then you might benefit from tuning)
- DB utilisation (check with your DBA if you have capacity there) increase DB pool size if required.
Add/update the value of jira.index.issue.threads in the $JIRA_HOME/jira-config.properties:
For Jira 7.x
# jira.index.issue.threads = 10 (default for Jira 7.x) jira.index.issue.threads = 20
For Jira 8.x - change only if the number of CPUs allows, e.g. for a system with 32 CPUs set the value to 30 or 32
# jira.index.issue.threads = 20 (default for Jira 8.x) jira.index.issue.threads = 30
Ideas regarding tuning:
- Don't increase the value too high (eg: above 2x number CPU cores.)
- You can start with value 20 and then increase the value with small steps running full reindex each time. If you don't see significant improvement then rollback the change.
Some examples from the issue:
Did increase the number of threads to 50 this weekend, and the lockout-reindex time decreased from 50 min to 10 min. Average core utilization increased from 10% to 40%.
Here are my test results for 300k issues, 32 cores, 48 RAM instance: from 10 to 32 threads, time decreased 29m to 15m
Set threads to 20. We managed to reduce the indexing by 1 hour, from 3 hrs 40mins to 2hrs 40mins.