vmstat:
顯示虛擬記憶體的統計資訊,還可以報告關於進程、記憶體、I/O等系統整體運行狀態。
選項:
-a:顯示記憶體活動
-f:顯示啟動後建立的進程總數
-s:以表格方式顯示時間計數器和記憶體狀態,不能重新整理顯示
-d:顯示磁碟狀態
-p:顯示指定的分區狀態
-S:指定輸出資訊的單位
-n:狀態資訊重新整理的時間間隔和次數
執行個體:
[root@master~]# vmstat
procs ----------memory------------- --swap-- ---io--- --system-- -----------cpu---------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 23016 62180 304304 0 0 69 30 584145 1 2 95 2 0
顯示內容分析:
Procs
r: The number of processes waiting for run time.
b: The number of processes in uninterruptible sleep.
Memory
swpd: 已用的虛擬記憶體。.
free: 閒置記憶體.
buff: 用作buffer的記憶體.
cache: 用作 cache的記憶體.
inact: 未啟用狀態的記憶體inactive memory. (-a option)
active: 啟用狀態的記憶體active memory. (-a option)
Swap
si: 從磁碟交換到記憶體的記憶體數量 (/s).
so: 交換到磁碟的記憶體數量(/s).
IO
bi: 從塊裝置接收的塊數量 (blocks/s).
bo: 發送到塊裝置的塊數量 (blocks/s).
System
in: 每秒的中斷數量,包括時鐘.
cs: 每秒的環境切換數量.
CPU
佔全部CPU時間的百分比:
本欄目更多精彩內容:http://www.bianceng.cn/database/MySQL/
us: 運行非核心(non-kernel)代碼花費的時間. (user time, including nice time)
sy: 運行核心代碼花費的時間. (system time)
id: 空閑時間Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
wa: 等待IO的時間. Prior to Linux 2.5.41, included in idle.
st: 從虛擬機器擷取的時間. Prior to Linux 2.6.11, unknown.
[root@master~]# vmstat -s
547428 total memory
524908 used memory
230284 active memory
247108 inactive memory
22520 free memory
62620 buffer memory
304316 swap cache
2096472 total swap
0 used swap
2096472 free swap
5071 non-nice user cpu ticks
199 nice user cpu ticks
11648 system cpu ticks
707535 idle cpu ticks
16799 IO-wait cpu ticks
195 IRQ cpu ticks
529 softirq cpu ticks
0 stolen cpu ticks
489932 pages paged in
216337 pages paged out
0 pages swapped in
0 pages swapped out
4337742 interrupts
1066186 CPU context switches
1341878613 boot time
42883 forks