プロセスのCPU使用量を調べたい

UNIXサーバ構築 OnTheVMware

unixコマンド逆引きを例を用いて解説
HOME > UNIXコマンド逆引きリファレンス >

プロセスのCPU使用量を調べたい

プロセスのCPU使用量を調べたい


スポンサードリンク


【説明】
プロセスを確認したい場合は、psコマンドを使用します。すべてを表示して整列させたい場合などは、オプションにa(すべてのプロセス)、u(ユーザ名の表示)、x(TTYのないプロセスも表示)を指定して、sortコマンドを用いて表示させます。※psコマンドはシステムによって使用できるオプションも変わってきます。たとえばSolarisでは、2種類のpsコマンドが使用でき、デフォルトはSystemV系のpsコマンドになるのですべてのプロセスを表示させたい場合は、eオプションを指定します。
psコマンドの詳細を見る
sortコマンドの詳細を見る

例) CPU使用率の高い順にプロセスを表示します。
[root@localhost ~]# ps aux | sort -rn -k 3,3
xfs 2801 0.0 0.4 4108 1084 ? Ss Jun24 0:00 xfs -droppriv -daemon
smmsp 2719 0.0 0.6 8384 1624 ? Ss Jun24 0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
rpcuser 17807 0.0 0.2 2900 712 ? Ss Jun24 0:00 rpc.statd
rpc 2470 0.0 0.2 2532 544 ? Ss Jun24 0:00 portmap
root 23841 0.0 0.2 5848 528 pts/0 D+ 02:12 0:00 -bash
root 23840 0.0 0.3 2856 768 pts/0 R+ 02:12 0:00 ps aux
root 23579 0.0 0.5 5848 1480 pts/0 Ss 01:40 0:00 -bash
root 23577 0.0 0.8 8740 2292 ? Ss 01:40 0:00 sshd: root@pts/0
root 23187 0.0 0.5 6508 1480 pts/3 Ss+ 00:57 0:00 -bash
root 23185 0.0 0.8 8496 2292 ? Ss 00:57 0:00 sshd: root@pts/3
root 23096 0.0 0.5 6336 1448 pts/2 Ss+ 00:52 0:00 -bash
root 23094 0.0 0.9 7304 2300 ? Ss 00:52 0:00 sshd: root@pts/2
root 17944 0.0 0.9 5548 2308 ? Ss Jun24 0:23 hald
root 17926 0.0 0.1 2676 432 ? Ss Jun24 0:00 /usr/sbin/atd

スポンサードリンク
 HOME / 免責事項 / サイトマップ /  問い合わせ
Copyright (C) 2008  UNIXサーバ構築 OnTheVMware  All rights reserved





スポンサードリンク