查看cpu利用率(top)
使用系統命令top即可看到如下類似信息:
說明如下:
top後按3即可選擇相應的numa查看對應的cpu信息:
cpu(s): 0.0%us, 0.5%sy, 0.0%ni, 99.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
意義如下:
us: is meaning of "user CPU time" 用戶空間佔用CPU百分比
sy: is meaning of "system CPU time" 內核空間佔用CPU百分比
ni: is meaning of" nice CPU time" 用戶進程空間內改變過優先級的進程佔用CPU百分比
id: is meaning of "idle" 空閒CPU百分比
wa: is meaning of "iowait" 等待輸入輸出的CPU時間百分比
hi:is meaning of "hardware irq" 硬件中斷
si : is meaning of "software irq" 軟件中斷
st : is meaning of "steal time" 實時
查看進程狀態(ps aux)
運行 ps aux 的到如下信息:
ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
smmsp 3521 0.0 0.7 6556 1616 ? Ss 20:40 0:00 sendmail: Queue runner@01:00:00 f
root 3532 0.0 0.2 2428 452 ? Ss 20:40 0:00 gpm -m /dev/input/mice -t imps2
dbus 3655 0.0 0.5 13840 1084 ? Ssl 20:41 0:00 dbus-daemon-1 --system
....................................
解釋如下:
VSZ–進程的虛擬大小
RSS–駐留集的大小,可以理解爲當前實際佔用的物理內存
TTY–控制終端的ID
STAT–當前進程的狀態
STRAT–該進程啓動的時間
TIME–進程已經消耗的CPU時間,注意是消耗CPU的時間
COMMOND–命令的名稱和參數
STAT中的參數意義如下:
D 不可中斷 Uninterruptible(usually IO)
R 正在運行,或在隊列中的進程
S 處於休眠狀態
T 停止或被追蹤
Z 殭屍進程
W 進入內存交換(從內核2.6開始無效)
X 死掉的進程
< 高優先級
N 低優先級
L 有些頁被鎖進內存
s 包含子進程
+ 位於後臺的進程組
l 多線程,克隆線程