Troubleshoot Jira Server performance with thread dumps

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。

目的

This page provides a way of collecting thread dumps (a breakdown of what every thread is doing for a Java process) and the output of top (shows what each native OS thread is consuming as far as resources are concerned). This breakdown could normally be collected with something like jProfiler as per Use jProfiler to analyse Jira application performance - in this example we're using native (free) tools to collect information.

This will only work for *nix systems and needs jstack to be installed (should be by default).  Another option for a high level overview is Using jvmtop to analyze JIRA performance.

症状

JIRA application is behaving slowly, and you need more information as to what part of it is being slow.

ソリューション

  1. Optional: Install the Thready plugin, if it is supported by your JIRA version. This will provide additional details on the Tomcat threads (namely the URI) and will allow for faster troubleshooting. 

    1. This is preferred, but if your system is currently in a bad state, please skip step 1 and proceed forward to generate thread dumps.
  2. Download and install the scripts located in https://bitbucket.org/atlassianlabs/atlassian-support/.

  3. Execute the scripts during periods of slowness or unresponsiveness and provide the resulting tar.gz file to support.
  4. Select 'Y' to thread dumps.
    1. Select 'N' to heap dump
  5. Optional: Run the disk speed tests with the same scripts, which are covered in more detail in our Testing Disk Access Speed KB.

To analyze them:

  • Look in the resulting CPU usage files to identify which threads are consistently using a lot of CPU time.

  • Use a tool such as TDA and check the native ID to correspond it to the thread dump.
  • Review the stack traces and search for known bugs on jira.atlassian.com.

回避策

How to manually run the tools

  • Identify the JIRA application PID by using a command such as:

    JIRA_PID=`ps aux | grep -i jira | grep -i java | awk  -F '[ ]*' '{print $2}'`;

    Alternatively you can use the following command to identify the process ID of JIRA when it is currently running:


    JIRA_PID=$(cat <JIRA_INSTALL>/work/catalina.pid)
  • Then run the following command - it generates 6 snapshots of CPU usage and thread dumps with 10 seconds interval for a minute.

    Linux (tested with Ubuntu / Debian):

    for i in $(seq 6); do top -b -H -p $JIRA_PID -n 1 > jira_cpu_usage.`date +%s`.txt; jstack -l $JIRA_PID > jira_threads.`date +%s`.txt; sleep 10; done

    Unix (tested with Solaris):

    for i in $(seq 6); do prstat -L -p $JIRA_PID -n 500 1 1 > jira_cpu_usage.`date +%Y-%m-%d_%H%M%S`.txt; jstack -l $JIRA_PID > jira_threads.`date +%Y-%m-%d_%H%M%S`.txt; sleep 10; done
  • Look in the resultingcpuusage files to identify which threads are consistently using a lot of CPU time.

  • Use a tool such as TDA and check the native ID to correspond it to the thread dump.
  • Alternatively, take the PID of the top 10 threads which are using CPU time and convert them to hexadecimal. Eg: 11159 becomes 0x2b97.
  • Search up the Hex values in the thread dumps to figure out which threads are using up all the CPU.


説明This page provides a way of collecting thread dumps (a breakdown of what every thread is doing for a Java process) and the output of top (shows what each native OS thread is consuming as far as resources are concerned). This breakdown could normally be collected with something like jProfiler as per Using jProfiler to analyse a JIRA application performance. In this example, we're using native tools to collect information.
製品Jira
プラットフォームサーバー
最終更新日 2019 年 9 月 25 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.