Translated message

A translation of this page exists in English.

Warning message

This translation is outdated. For the most up-to-date information, please refer to the English version.

RHEL で負荷、I/O、またはメモリ消費が高くなった場合に調査に必要な情報

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux

Issue

  • サーバーがコマンドに応答しない場合があります。
  • CPU または I/O の消費が高いです。
  • メモリの空き領域が少なく、スワップの使用量が高いです。
  • (oom-killer によって) カーネルパニックが発生しました。

Resolution

1. システムをハングアップの状態から復元する前に、以下の出力を取得します。

注意: 可能な場合は、複数の端末を使用してすべての出力を同時に取得してみてください。

  # uname -a > /tmp/uname.out
  # ifconfig > /tmp/ifconfig.out
  # top -n 5 -b > /tmp/top.out
  # vmstat 1 50 > /tmp/vm.out
  # iostat -x 2 10 > /tmp/io.out
  # netstat -neap &> /tmp/netstat.out
  # ps aux > /tmp/ps.out
  # ps auxH > /tmp/psh.out
  # sar -A > /tmp/sar.out
  # free > /tmp/free.out
  # lsof > /tmp/lsof.out
  • システムまたはアプリケーションがハングアップした時間と箇所を正確に把握する必要があります。
  • そのためには、アプリケーションプロセスのコールトレースを取得する必要があります。
  • 以下のコマンドを実行して、sysrq を有効にします。
  # echo 1 > /proc/sys/kernel/sysrq
  • 次に、以下のコマンドを実行します。
  # echo p > /proc/sysrq-trigger 
  # echo m > /proc/sysrq-trigger 
  # echo t > /proc/sysrq-trigger 
  # echo w > /proc/sysrq-trigger 
  • このコマンドを実行すると、複数のトレースをメッセージファイルにダンプします。

  • さらなる調査のために、以下のように tar 書庫を 2 つ作成して、上の出力結果をすべて収集します。

  # tar -cjvf outputs.tar.bz2 /tmp/*.out
  # tar -cjvf message.tar.bz2 /var/log/message*

2. 問題発生時の sosreport を取得してください。

3. システムが完全にハングアップし応答しない場合は、kdump (RHEL5 以上)、netdump (RHEL4)、または diskdump (システムがパニックになった場合の RHEL4) を使用して vmcore を取得してください。

4. システムに OOM-killer イベントが発生している場合は、以下の出力結果を取得してください。

# dstat --top-oom > /tmp/dstat-oom.out
  • dstat コマンドは dstat パッケージで提供されています (RHEL5 の場合に限ります)。

参照情報

詳細については、Investigating Performance Issues のテクニカルブリーフを参照してください。

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments