2021-05-12 14:32:11
Linux vmstat 命令引數詳解
Linux vmstat 命令引數詳解
vmstat n m :每隔n秒鐘重新整理,抓取m次數後退出。
[Oracle@linuxidc properties]$ vmstat 2 3
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 96 655968 278912 2117884 0 0 0 10 1 1 18 2 80 0 0
1 0 96 655968 278912 2117884 0 0 0 0 1011 694 0 0 100 0 0
0 0 96 655968 278912 2117884 0 0 0 34 1013 338 0 0 100 0 0
FIELD DESCRIPTION FOR VM MODE
Procs
r: The number of processes waiting for run time. 處於執行佇列中的核心執行緒數目(進程數)。
b: The number of processes in uninterruptible sleep. 置於等待佇列(等待資源、等待輸入/輸出)的核心執行緒數目。 處於block佇列中不可中斷的進程數
Memory
swpd: the amount of virtual memory used. 可用的虛擬交換記憶體
free: the amount of idle memory. 空閒記憶體
buff: the amount of memory used as buffers. 已用緩衝數目
cache: the amount of memory used as cache. 已用快取數目
inact: the amount of inactive memory. (-a option) 不活動的記憶體數
active: the amount of active memory. (-a option) 活動記憶體數
Swap
si: Amount of memory swapped in from disk (/s). 從磁碟到記憶體的交換頁數目 (單位/S)
so: Amount of memory swapped to disk (/s). 從交換記憶體到磁碟的交換頁數目(單位/S)
IO
bi: Blocks received from a block device (blocks/s). 接收到塊裝置的塊數(塊/秒)
bo: Blocks sent to a block device (blocks/s). 傳送到塊裝置的塊數(塊/秒)
System
in: The number of interrupts per second, including the clock. 每秒中斷數,包括時鐘中斷
cs: The number of context switches per second. 每秒上下文切換數
CPU
These are percentages of total CPU time.
us: Time spent running non-kernel code. (user time, including nice time) 使用者時間 處於使用者模式的時間百分比
sy: Time spent running kernel code. (system time) 系統時間 處於核心模式的時間百分比
id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time. CPU空閒時間 空閒時間百分比
wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle. CPU 空閒時間,在此期間系統有未完成的磁碟/NFS I/O 請求
st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown. 來自於虛擬機器偷取的CPU所占的百分比 (這個不會翻譯...)
FIELD DESCRIPTION FOR DISK MODE
Reads
total: Total reads completed successfully
merged: grouped reads (resulting in one I/O)
sectors: Sectors read successfully
ms: milliseconds spent reading
Writes
total: Total writes completed successfully
merged: grouped writes (resulting in one I/O)
sectors: Sectors written successfully
ms: milliseconds spent writing
IO
cur: I/O in progress
s: seconds spent for I/O
----------------------------------------------------------------------------------------------------------
NOTICE:
procs r: 執行的進程比較多,系統很繁忙
bi/bo: 磁碟寫的資料量稍大,如果是大檔案的寫,10M以內基本不用擔心,如果是小檔案寫2M以內基本正常
cpu us: 持續大於50%,服務高峰期可以接受, 如果長期大於50 ,可以考慮優化
cpu sy: 現實核心進程所占的百分比,這裡us + sy的參考值為80%,如果us+sy 大於 80%說明可能存在CPU不足。
cpu wa: 列顯示了IO等待所佔用的CPU時間的百分比。這裡wa的參考值為30%,如果wa超過30%,說明IO等待嚴重,這可能是磁碟大量隨機存取造成的, 也可能磁碟或者磁碟存取控制器的頻寬瓶頸造成的(主要是塊操作)。
cpu id: CPU 空閒時所佔百分比 平常持續小於50,服務高峰期可以接受。
本文永久更新連結地址:http://www.linuxidc.com/Linux/2016-12/138598.htm
相關文章