Jira サーバーで再インデックス時間を短縮する
プラットフォームについて: サーバーと Data Center のみ。この記事は、サーバーおよび Data Center プラットフォームのアトラシアン製品にのみ適用されます。
問題
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
- 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 a 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.
ソリューション
最終的な目的は、システムのリソースを確認し、インデックス スレッドの数を限界まで増やすことです。1 つの要素にのみ目を向けることはおすすめしません。Lucene のディスク ライターはシングル スレッドであるため、この場合の目的は十分なデータを用意することになります。
再インデックス中にシステムの負荷を確認します。
- CPU 使用率 (50% 未満の場合、チューニングで改善を見込める可能性があります)
- ディスク使用率 (70% 未満の場合、チューニングで改善を見込める可能性があります)
- DB utilisation (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 (this file may not be present and will need to be created at this location for the config change):
Jira 7.x の場合
# jira.index.issue.threads = 10 (default for Jira 7.x)
jira.index.issue.threads = 20
Jira 8.x の場合 - CPU 数が許容される場合にのみ変更。例: 32 個の CPU のシステムでは値を 30 または 32 に設定
# jira.index.issue.threads = 20 (default for Jira 8.x)
jira.index.issue.threads = 30
チューニングのヒント
- 値を高くしすぎないようにします (例: CPU コア数の 2 倍~)
- 値 20 から開始し、少しずつ増やしながら再インデックスを都度実行します。大きな改善が見られない場合は変更をロールバックします。
詳細についてはこちらをご確認ください。 - 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 分になりました。