Confluence 5.8 のサポートは終了しています。
ドキュメントの最新バージョンを確認してください。
f Confluence stops responding and you can't create a thread dump within Confluence (via Support Tools), you can create thread dumps outside the application. External thread dumps are also useful if you require information on locks being held or waited upon by threads.
スレッドダンプを複数取得する
通常、約 10 秒間隔でダンプを取得します。その場合、複数のダンプや出力されたスタックトレースを以下のように1つのファイルに生成することができます。
On this page:
Linux でスレッド ダンプを生成する
Linux (または Solaris やその他の Unix) でスレッド ダンプを精製するには:
Identify the java process that Confluence is running in.: This can be achieved by running a command similar to:
ps -ef | grep java.
上記からプロセス ID を使用してスレッド ダンプを生成します。
kill -3 <pid>
このコマンドではサーバーは終了しません (スペース間に入れずに "-3" オプションを使用している限り)。
出力
スレッド ダンプは、アプリケーション ログ フォルダーの catalina.out ファイル内に表示されます。ログ ファイルで「thread dump」を検索して、ダンプの出発点を探します。
ウィンドウでスレッド ダンプを生成する
Generating a thread dump using our scripts
We now have scripts for generating a series of thread dumps externally on Windows. Check out this BitBucket Repository for more information.
コンソールからスレッド ダンプを生成する
サービスとして Confluence を実行していない場合は、コンソールで直接スレッド ダンプを作成することができます。
コンソール ウィンドウをクリックし、<CTRL>+BREAK (または一部のキーボードでは SHIFT+CTRL+PAUSE) を押します。スレッド ダンプは、直接コンソールに表示されます。
jstack を使用したスレッド ダンプの生成
The JDK (Java Development Kit) includes jstack, which is used for generating thread dumps.
注: Confluence インストーラーにバンドルされている JRE (Java Runtime Environment) には、jstack は含まれません。JDK 一式をインストールしておく必要があります。
jstack を使用してスレッド ダンプを生成するには:
- Identify the process. Launch the task manager by, pressing
Ctrl + Shift + Escand find the Process ID of the Java (Confluence) process. (If you can't see the PID column right click a column heading in Task Manager and choose PID). jstack <pid> を実行して、 単一のスレッドダンプを取得します。このコマンドで、プロセス ID <pid> の1個のスレッドダンプが取得出来ます。この場合のプロセス ID は22668です。
adam@track:~$ jstack 22668 > threaddump.txt
このコマンドにより、現在のディレクトリに threaddump.txt というファイルが出力されます。
jstack のよくある問題
- jstack は Confluence を起動しているユーザーと同じユーザーで起動する必要があります。
- 実行が可能な jstack が $PATH にない場合、<JDK_HOME>/bin ディレクトリで探します。
java.lang.NoClassDefFoundError: sun/tools/jstack/JStackが発生したら、JDK の lib ディレクトリ tools.jar があるかどうかを確認します。tools.jar がない場合、JDK のフル バージョンをダウンロードします。- If you see the following message: 'Not enough storage is available to process this command,' see this article.
- If you get the error "Not enough storage is available to process this command", download the 'psexec' utility from here, then run the following command using:
psexec -s jstack <pid> >> threaddumps.txt
出力
Thread dumps appear in the catalina.out file in the application directory's logs folder. You can search for the term "thread dump" in the log file for the beginning of the dump. Submit this along with the atlassian-confluence.log in your support ticket.
各ダンプに何が含まれているかを比較し、パフォーマンスの問題の原因となった可能性のある、長期間実行中のスレッドを探すことができるよう、サポートから、短期間、スレッド ダンプのシーケンスを生成するよう求められることがよくあります。
You can manually generate multiple thread dumps by executing the command repeatedly, but it is often easier to use a small script to automate the process. Here's an example that you can adapt to run on your server:
for i in `seq 1 10` ; do
echo ${i}
your/path/to/jstack `ps aux | grep java | grep confluence | grep -v grep | awk '{print $2}'` >> threaddump.log
sleep 10
done