JMX インターフェイス (Confluence 2.8 で導入) を使用すると、Confluence インスタンスのステータスをリアルタイムで監視できます。これにより、ご使用のインスタンスのリソース使用率やデータベース待ち時間など有益なデータを得られ、問題やパフォーマンス問題を診断することができます。JMX データを読み取るには、JMX クライアントを使用する必要があります。

If you experience any problems during Confluence startup that are related to JMX, it is possible to disable the JMX registration process. Please place jmxContext.xml in your <confluence-install>/confluence/WEB-INF/classes folder to do so.

JMX とは何か

JMX (Java Management eXtensions) is a technology for monitoring and managing Java applications. JMX uses objects called MBeans (Managed Beans) to expose data and resources from your application.

1. Tomcat で JMX リモートを有効化する

By default, Confluence uses the Apache Tomcat web server. To use JMX, you must enable it on your Tomcat server, by carrying out the steps under the Apache Tomcat documentation, entitled Enabling JMX Remote. With those steps completed, restart your Tomcat server.

For the stand-alone, add the startup parameter -Dcom.sun.management.jmxremote to setenv.sh or setenv.bat. See instructions for the Windows Service - enter it in the same place as PermGen Memory.

2. JMX クライアントを選択する

You need to use a JMX client in order to view the JMX output from Confluence. JConsole is a readily available JMX client that is included with Sun's Java Developer Kit (version 5 onwards). The full name is the 'Java Monitoring and Management Console', but we will refer to it as JConsole for the purposes of this document.

3. JMX クライアントをパスに追加する

You must add the location of the JConsole binary file to your 'path' environment variable. As JConsole resides in the 'bin' (binaries) folder under your Java directory, the path should resemble something like this:

JDK_HOME/bin/

この例では、 'JDK_HOME' をご使用の Java ディレクトリへの完全システムパスに置き換えます。

4. JConsole を設定する

To configure JConsole,

  1. JConsole アプリケーションを実行します。

  2. You will be prompted to create a new connection. Choose 'remote process', enter the hostname of your Confluence instance and a port of your choosing.

    簡単に接続するには、以下のスタートアップ パラメーターを setenv.bat または setenv.sh に追加します。
    -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8086 -Dcom.sun.management.jmxremote.authenticate=false
    ポート 8086 が使用される可能性はほとんどありません。したがって、ポート 8086 を使用してリモートで接続します。


  3. Click 'Connect'.

注意: JConsole 以外の他の JMX クライアントは、Confluence から JMX 情報を読み取ることができます。

JMX を使用して何を監視できますか?

JMX インターフェイスを使用することで、Confluence インスタンスの現時点の内部情報を以下の MBean を介して表示することができます。

IndexingStatistics

この MBean は検索インデックス作成に関連する情報を表示します。

プロパティ名

機能

Flushing

キャッシュの状態 (フラッシュの有無) を表示。

True/False

LastElapsedMilliseconds

最後のインデックス作成の所要時間。

ミリ秒

LastElapsedReindexing

最後の再インデックス作成の所要時間。

ミリ秒

TaskQueueLength

キューにあるタスクの数を表示。

整数

システム情報

This MBean shows information related to database latency. It also contains most of the information presented on the System Information page.

プロパティ名

機能

DatabaseExampleLatency

データベース対して実行されたクエリ例の待ち時間を表示。

ミリ秒

RequestMetrics

この MBean はシステム負荷と表示されたエラーページに関連する情報を表示します。

プロパティ名

機能

AverageExecutionTimeForLastTenRequests

最新 10 件の要求の平均実行時間。

ミリ秒

CurrentNumberOfRequestsBeingServed

この時点で提供されている要求の数。

整数

ErrorCount

Confluence エラーページが提供された回数。

整数

MailServer-SMTPServer

この MBean は、メールディスパッチの試行と失敗に関連する情報を表示します。Confluence インスタンスで設定された SMTP メールサーバーごとに MBean があります。

プロパティ名

機能

EmailsAttempted

Confluence が送信しようとしたメールメッセージの数。

整数

EmailsSent

正常に送信されたメールメッセージの数。

整数

MailTaskQueue

この MBean は、メールワークロードに関連する情報を示します。

プロパティ名

機能

ErrorQueueSize

キュー内のエラー数。

整数

Flushing

状態 (フラッシュの有無) を表示。

True/False

FlushStarted

稼働を開始した時間。

時間

RetryCount

実行された再試行の回数。

整数

TaskSize

ディスパッチのためにキューに入れられたメールメッセージの数。

整数

SchedulingStatistics

この MBean は現在のジョブ、スケジュール済みタスク、およびそれらが最後に実行された時間に関連する情報を表示します。

CPU 消費が高いスレッド

For Java 1.6, add the Top Threads Plugin to monitor whether CPU is spiking. Download it to a directory and run JConsole like this:
JConsole -pluginpath /pathto/topthreads.jar

This works only with jdk 1.6, but that can be on the remote machine if the server is running a lower version.

関連トピック