This document describes tuning your application for improved performance. It is not a guide to troubleshooting Confluence outages. Check Troubleshooting Confluence hanging or crashing for help if Confluence is crashing.

あらゆるサーバーアプリケーションと同様に、Confluence は頻繁に利用されるため、何らかのチューニングが必要になる場合があります。弊社では、Confluence が多種多様な環境下で十分なパフォーマンスを実現できるように最善を尽くしていますが、あらゆる人の環境や利用パターンに最適な単一の設定は存在しません。

If you are having problems with the performance of Confluence and need our help resolving them, you should read Requesting Performance Support.

Performance Data Collector

The Performance Data Collector is a server-side, standalone application that exposes a number of REST APIs for collecting performance data. It can be used to collect data, such as thread dumps, disk speed and CPU usage information, to troubleshoot performance problems.

See How to use the Performance Data Collector for more information. 

On this page:

ツールの最新バージョンを使用する

ご使用のアプリケーションサーバーおよび Java ランタイム環境の最新バージョンを使用します。通常、より新しいバージョンのほうが、パフォーマンス向上のために最適化されています。

RAM 不足に起因するスワッピングを回避する

Always watch the swapping activity of your server. If there is not enough RAM available, your server may start swapping out some of Confluence's heap data to your hard disk. This will slow down the JVM's garbage collection considerably and affect Confluence's performance. In clustered installations, swapping can lead to a Cluster Panic due to Performance Problems. This is because swapping causes the JVM to pause during Garbage Collection, which in turn can break the inter-node communication required to keep the clustered nodes in sync.

同じインフラストラクチャーを使用している他のシステムにも注意する

1 台の強力なサーバーのみでデータベースやアプリケーションサーバーをホスティングし、そのサーバーですべての重要なプログラムを実行するというのは、魅力的に聞こえるかもしれません。もし、システムが完璧に設定されていればおそらく問題ないでしょう。しかし、何かが欠けていている可能性があれば、1つのアプリケーションのバグが他のアプリケーションに影響を与え始めるかもしれません。また、Confluence が毎日正午頃に遅くなるのであれば、その時間に別のアプリケーションが共有データベースを使用して複雑なレポートを生成していることが原因の場合もあるでしょう。いずれにしても、アプリケーションが同じインフラストラクチャーを共有していても相互に害を及ぼすことができないようにするか、アプリケーションを別々のインスタンスに移動して制御しやすくするなど、これらのシステムが錯綜しないようにします。

データベースの選択

The embedded H2 database is provided in development versions of software. It is for evaluating Confluence, not for production Confluence sites. After the evaluation finishes, you must switch to a supported external database. We recommend using what you are familiar with, because your ability to maintain the database will probably make far more difference to what you get out of it than the choice of database itself.

データベース接続プール

Confluence に対する負荷が高い場合、データベースへの同時接続を増やす必要が生じることもあります。

データベースに直接アクセスするように Confluence を構成した場合は、hibernate.c3p0.max_size プロパティと hibernate.hikari.maximumPoolSize プロパティ (存在する場合) を手動で編集する必要があります。これらのプロパティは、confluence.home ディレクトリにある confluence.cfg.xml ファイル内にあります。このファイル内の URL を変更した後、Confluence を再起動します。

To assess whether you need to tune your database connection pool, take thread dumps during different times (including peak usage). Inspect how many threads have concurrent database connections.

一般的なデータベース

Confluence の実行が遅い場合、最も可能性が高い原因の一つは、データベース(または周辺)にいくつかボトルネックがあるという点です。

The first item you should check is the "Database Latency" field in the System Information tab in the admin console.
The latency is calculated by sending a trivial request to the database, querying a table which is known to have only one column and one row.  ("select * from CLUSTERSAFETY"). Obviously this query should be blazing fast, and return within 1 or 2 milliseconds. If the value displayed is between 3 and 5 milliseconds, you might already have an issue. If the value is above 10ms, then you definitely need to investigate and improve something! A few milliseconds may not sound so bad, but consider that Confluence sends quite a few database queries per page request, and those queries are a lot more complex too! High latency might stem from all sorts of problems (slow network, slow database, connection-pool contention, etc), so it's up to you to investigate. Don't stop improving until latency is below 2ms on average.

確実に、レイテンシーは最初に見るべき項目です。レイテンシーがゼロになっても、例えばテーブルのインデックスが十分に付けられていない場合など、大規模なデータベースの問題が発生します。そのため、レイテンシーが低いからといって惑わされないでください。

データベース統計とクエリ分析

最近のデータベースには現在のデータの統計情報の収集に基づくクエリ オプティマイザーが搭載されています。SQL EXPLAIN ステートメントを使用すると、クエリ オプティマイザーがどれくらい有効に働いているかを示す情報を得ることができます。コスト見積もりが不正確な場合、データベースの統計情報の収集を実行する必要があります。実際のコマンドはデータベースとバージョンによって異なります。多くの場合、Confluence の実行中に統計情報の収集を実行することができますが、データベースの負荷が増加するため、営業時間後、または週末に実施するのが良いでしょう。

Confluence および Apache におけるキャッシュのチューニング

データベースの負荷を減らし、多くの操作をスピード アップさせるため、Confluence はデータのキャッシュを保持しています。このキャッシュのサイズをチューニングすることで、Confluence をスピード アップ(キャッシュが非常に小さい場合)させたり、使用するメモリ量を減らす(キャッシュが非常に大きい場合)ことができる場合があります。

Please have a look at our documentation on Cache Performance Tuning for information on how to tune Confluence caches.

アンチウイルス ソフトウェア

アンチウイルス ソフトウェアによって、Confluence のパフォーマンスは大幅に低下します。ハードディスクへのアクセスを遮断するウィルス対策ソフトウェアの場合は特に有害であり、Confluence でエラーを引き起こす可能性もあります。Confluence ホーム ディレクトリ、インデックス ディレクトリ、およびすべてのデータベース関連ディレクトリを無視するように、アンチウイルス ソフトウェアを設定する必要があります。

HTTP 圧縮を有効にする

If bandwidth is responsible for bottlenecking in your Confluence installation, you should consider enabling HTTP compression. This may also be useful when running an external facing instance to reduce your bandwidth costs.

Take note of the known issues with HTTP compression in versions of Confluence prior to 2.8, which may result in high memory consumption.

パフォーマンスをテストする

すべての設定変更をデモ システム上で試す必要があります。理想的には、ユーザーの振る舞いをシミュレートするカスタマイズ負荷テストを実施するべきです。 

アクセス ログ

You can find out which pages are slow and which users are accessing them by enabling Confluence's built-in access logging.

組み込みプロファイラー

You can identify the cause of page delays using Confluence's built-in profiler according to Troubleshooting Slow Performance Using Page Request Profiling.

アプリケーション サーバーのメモリ設定

See Fix java.lang.OutOfMemoryError in Confluence.

Web サーバー設定

For high-load environments, performance can be improved by using a web server such as Apache in front of the application server. There is a configuration guide to Running Confluence behind Apache.

新しい web サーバーを設定する場合、負荷を処理するのに十分なスレッド/プロセスを設定するようにしてください。これは、web サーバーおよびアプリケーション サーバー コネクターの両方に適用されますが、通常は別々に設定されます。可能であれば、アプリケーション サーバーに対する web サーバー コネクション内のコネクション プーリングを有効にする必要があります。

利用可能なメモリリークのトラブルシューティング

Some external plugins, usually ones that have been written a long time ago and that are not actively maintained anymore, have been reported to consume memory and never return it. Ultimately this can lead to a crash, but first this manifests as reduced performance. The Troubleshooting Confluence hanging or crashing guide is a good place to start. Some of the known causes listed there could result in performance issues short of a crash or hang.

権限の迅速化を有効にする 

Confluence は表示する内容を決定するために、現在のユーザーの権限を定期的に確認する必要があります。権限の迅速化サービスではデータベースでの権限情報の保管方法を変更して、権限チェックを最適化します。多少の負荷がかかりますが、多数のコンテンツを持つ権限が複雑なサイトのパフォーマンスが大幅に改善します。逆に、コンテンツが少ない、または権限が単純な場合 (グループがごくわずかである、または入れ子ページの制限が少ない)、このサービスによって Confluence サイトの速度が大幅に改善される見込みは低くなります。

高速化された権限サービスの詳細