Confluence 5.6 のサポートは終了しています。
ドキュメントの最新バージョンを確認してください。
There is a plugin for Confluence 2.2 and later which allows easy profiling using the YourKit profiler. No license is required to generate a memory or CPU snapshot, but you will need at least an evaluation license to analyse the results.
On this page:
Download YourKit 6.0 for your platform and follow the installation instructions to install it.
Note: YourKit version 7 is not compatible with the Confluence yourkit plugin.
次の説明は、Oracle (以前の Sun) JDK を使用した Confluence および Tomcat のインストールに適用されます。これらは、他のアプリケーション サーバーや JVM では簡単に適用することができます。詳細は YourKit ドキュメントを参照してください。
Windows では、YourKit インストール ディレクトリの下の bin/win32/ ディレクトリの PATH 環境変数を追加します。たとえば、[コントロール パネル] > [システム] > [詳細] > [環境変数] 経由で、PATH に "C:\Program Files\YourKit Java Profiler 6.0.12\bin\win32" を追加することができます。
Confluence の JVM が YourKit エージェントを使用するように設定するには、Confluence のアプリケーション ディレクトリの bin/setenv.bat ファイルの CATALINA_OPTS にパラメーターを追加する必要があります。このファイルは Tomcat の startup パラメーターを制御するため、変更後に再起動する必要があります。
末尾に、次のような 'agentlib' パラメーターを追加します。
set CATALINA_OPTS=%CATALINA_OPTS% -Xms1024m -Xmx1024m -XX:MaxPermSize=256m -XX:+UseG1GC -agentlib:yjpagent
Unix ベースのシステムでは、次のように、ライブラリパス環境変数にインストール ディレクトリが含まれます。
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/path/to/yourKitAgentexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/yourKitAgent一般に、JDK を設定するには、agentlib パラメーターを追加します。
java -agentlib:yjpagent ...
これを、Tomcat の bin/setenv.sh に追加できます。例:
CATALINA_OPTS="$CATALINA_OPTS -Djava.awt.headless=true"-agentlib:yjpagent "
YourKit の実行はパフォーマンスに影響を与える可能性があります。
パフォーマンスの問題を最小限に抑えるため、agentlib パラメーターで次の変更を使用します。
-agentlib:yjpagent=disablecounts,disablealloc,disablej2ee
See also Profiling overhead: how to reduce or avoid in the YourKit documentation.
Download the plugin and upload it into Confluence through the Administration, Plugins page.
新しいメニュー オプション「YourKit プロファイル」が「管理」見出しの下に表示されます。これをクリックスト、メモリまたは CPU スナップショットへ移動するオプションが表示されます。
このプロファイラー ダンプはローカルの一時ディレクトリに保存され、完了するとパスを示します。CPU スナップショットの場合は、30 秒以上かかります。メモリ スナップショットの場合は、10~15 秒かかります。
スクリーンショット: メモリまたは CPU スナップショットへ移動できます
この操作を行う理由
Analysing a profiler dump enables Atlassian Support (or you, if you are interested) to see exactly what is happening in your application: what classes are using the memory, what is using CPU and so on. This can help us debug tricky performance problems which would otherwise be impossible to analyse remotely.
次の場合に CPU スナップショットを作成します。
次の場合にメモリ スナップショットを作成します。
If you run into situations where Confluence is unresponsive and you are not able to trigger a memory snapshot, please ensure that you start Confluence with the
onexit=memory parameter in the JVM options (as in the example below) and simply shut down Confluence. Before shutting down a memory snapshot will be created.
-agentlib:yjpagent=onexit=memory
The source code for this Confluence plugin is available from Subversion and browseable in Fisheye. The JAR produced by 'mvn package' includes a copy of the YJP redistributable bundled in META-INF/lib/.