How to increase the speed of full reindex in Jira
プラットフォームについて: サーバーと Data Center のみ。この記事は、サーバーおよび Data Center プラットフォームのアトラシアン製品にのみ適用されます。
要約
If you have a large JIRA instance (>300k issues) then Full reindex might take a couple of hours. The performance of reindexing depends on many factors:
- CPU performance
- Disk performance
- DB performance
- Number and type of custom fields
By default, full reindex on JIRA 7.x runs only 10 threads, and Jira 8.x runs on 20 threads. If you have really good hardware then it might be underutilized and you may be able to reduce reindexing time. This is not applicable to background reindex which it's always single-threaded.
The indexing operation is very database-intensive. If increasing the number of threads doesn't improve the performance, chances are that the database is the bottleneck.
Make sure that latency between Jira and the database is low and that DB index maintenance is done on a regular basis.
ソリューション
Goal is to review system resources and increase number of index threads until you reach saturation point. You shouldn't look at a single factor only. Please note that Lucene disk writer is single-threaded, so the goal to prepare just enough data for it.
再インデックス中にシステムの負荷を確認します。
- CPU utilization (if it's below 50%, then you might benefit from tuning)
- Disk utilization (if it's below 70%, then you might benefit from tuning)
- DB utilization (check with your DBA if you have capacity there) increase DB pool size if required
Regarding Custom field indexers, they may be analyzed using the metrics described on this page (available for Jira 8.1 and later):
チューニング
Add/update the value of jira.index.issue.threads in the $JIRA_HOME/jira-config.properties.
Optionally, also add jira.index.sharedentity.threads to tune the number of threads that reindex the filters ("SearchRequests") after the issues are indexed.
In new Jira installations, this file may not initially exist and if so, it needs to be created manually.
Jira 7.x の場合
# jira.index.issue.threads = 10 (default for Jira 7.x)
jira.index.issue.threads = 20
For Jira 8.x and above - 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
# jira.index.sharedentity.threads = 10 (default filter reindex threads for Jira 8.x)
jira.index.sharedentity.threads = 30
チューニングのヒント
- It's necessary to restart the application to apply any changes done on
jira-config.properties
- Don't increase the value too high (eg: above 2x number of CPU cores.)
- You can start with value 20 and then increase the value with small steps running a full reindex each time. If you don't see significant improvement then roll back the change.
詳細についてはこちらをご確認ください。 - JRA-38598Getting issue details... STATUS - JRA-25788Getting issue details... STATUS
Below are some examples of reindexing time reduction due to better tuning:
1
週末にスレッドの数を 50 個に増やしたところ、ロックアウトのインデックス時間が 50 分から 10 分に短縮されました。平均コア使用率は 10% から 40% に増えました。
2.
300,000 件の課題、32 コア、48 RAM インスタンスでのテストの結果です。10 から 32 スレッドにすることで、時間が 29 分から 15 分に短縮されました。
3.
スレッドを 20 に設定しました。インデックス時間を 1 時間軽減できました。これまで 3 時間 40 分だったのが 2 時間 40 分になりました。