歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux vmstat 命令參數詳解

Linux vmstat 命令參數詳解

日期:2017/2/28 13:45:48   编辑:Linux教程

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,服務高峰期可以接受。

Copyright © Linux教程網 All Rights Reserved