歡迎您光臨本站 註冊首頁

vmstat命令參數詳解

←手機掃碼閱讀     火星人 @ 2014-03-03 , reply:0

vmstat命令參數詳解


vmstat命令參數詳解

vmstat 命令參數詳解:

vmstat  n m  :每隔n秒鐘刷新,抓取m次數後退出。

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,服務高峰期可以接受
《解決方案》

謝謝分享
《解決方案》

性能調優的必備工具:mrgreen:

[火星人 ] vmstat命令參數詳解已經有552次圍觀

http://coctec.com/docs/service/show-post-898.html