<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    qileilove

    blog已經(jīng)轉(zhuǎn)移至github,大家請訪問 http://qaseven.github.io/

    Linux CPU實時監(jiān)控命令mpstat介紹

    1,簡介
      mpstat是Multiprocessor  Statistics的縮寫,是實時系統(tǒng)監(jiān)控工具。其報告是CPU的一些統(tǒng)計信息,這些信息存放在/proc/stat文件中。在多CPUs系統(tǒng)里,其不但能查看所有CPU的平均狀況信息,而且能夠查看特定CPU的信息。mpstat最大的特點是:可以查看多核心cpu中每個計算核心的統(tǒng)計數(shù)據(jù);而類似工具vmstat只能查看系統(tǒng)整體cpu情況。
      2,安裝
    [root@ora10g ~]# mpstat
    -bash: mpstat: command not found
    [root@ora10g ~]# mount -o loop -t iso9660 /dev/cdrom /mnt/cdrom
    [root@ora10g ~]# cd /mnt/cdrom/Server/
    [root@ora10g Server]# rpm -ivh sysstat-7.0.2-3.el5.i386.rpm
    warning: sysstat-7.0.2-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
    Preparing...                ########################################### [100%]
    1:sysstat                ########################################### [100%]
      3,實例
      用法
      mpstat -V  顯示mpstat版本信息
      mpstat -P ALL 顯示所有CPU信息
      mpstat -P n 顯示第n個cup信息,n為數(shù)字,計數(shù)從0開始
      mpstat n m  每個n秒顯示一次cpu信息,連續(xù)顯示m次,最后顯示一個平均值
      mpstat n    每個n秒顯示一次cpu信息,連續(xù)顯示下去
      查看每個cpu核心的詳細當前運行狀況信息,輸出如下:
    [root@ora10g ~]# mpstat -P ALL
    Linux 2.6.18-194.el5 (ora10g.up.com)    11/05/14
    09:13:02     CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle    intr/s
    09:13:02     all    0.62    0.01    0.54    3.48    0.00    0.02    0.00   95.32   1039.58
    09:13:02       0    0.92    0.01    1.18    8.77    0.01    0.05    0.00   89.06   1030.23
    09:13:02       1    0.27    0.00    0.31    1.46    0.00    0.01    0.00   97.96      1.00
    ....
    09:13:02      14    1.12    0.02    0.45    2.99    0.00    0.01    0.00   95.39      7.74
    09:13:02      15    0.18    0.00    0.22    0.70    0.00    0.01    0.00   98.90      0.59
      查看多核CPU核心的當前運行狀況信息, 每2秒更新一次
      [root@ora10g ~]# mpstat -P ALL 2
      查看某個cpu的使用情況,數(shù)值在[0,cpu個數(shù)-1]中取值
      [root@ora10g ~]# mpstat -P 2
      Linux 2.6.18-194.el5 (ora10g.up.com)    11/05/14
      10:19:28     CPU   %user   %nice    %sys %iowait    %irq   %soft  %steal   %idle    intr/s
      10:19:28       2    0.08    0.00    0.04    0.22    0.00    0.01    0.00   99.64      0.55
      查看多核CPU核心的當前運行狀況信息, 每2秒更新一次,顯示5次
      [root@ora10g ~]# mpstat -P ALL 2 5
     4,字段含義如下
      英文解釋:
      CPU:Processor number. The keyword all indicates that statistics are calculated as averages among all processors.
      %user:Show the percentage of CPU utilization that occurred while executing at the user level (application).
      %nice:Show the percentage of CPU utilization that occurred while executing at the user level with nice priority.
      %sys:Show  the  percentage  of CPU utilization that occurred while executing at the system level (kernel). Note that
      this does not include time spent servicing interrupts or softirqs.
      %iowait:Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk  I/O request.
      %irq:Show the percentage of time spent by the CPU or CPUs to service interrupts.
      %soft:Show  the  percentage  of time spent by the CPU or CPUs to service softirqs.  A softirq (software interrupt) is
      one of up to 32 enumerated software interrupts which can run on multiple CPUs at once.
      %steal:Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was  ser-vicing another virtual processor.
      %idle:Show  the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.
      intr/s:Show the total number of interrupts received per second by the CPU or CPUs.
      參數(shù)解釋 從/proc/stat獲得數(shù)據(jù)
      CPU 處理器 ID
      user 在internal時間段里,用戶態(tài)的CPU時間(%),不包含 nice值為負 進程 (usr/total)*100
      nice 在internal時間段里,nice值為負進程的CPU時間(%)   (nice/total)*100
      system 在internal時間段里,核心時間(%)   (system/total)*100
      iowait 在internal時間段里,硬盤IO等待時間(%) (iowait/total)*100
      irq 在internal時間段里,硬中斷時間(%)      (irq/total)*100
      soft 在internal時間段里,軟中斷時間(%)    (softirq/total)*100
      idle 在internal時間段里,CPU除去等待磁盤IO操作外的因為任何原因而空閑的時間閑置時間(%)(idle/total)*100
      intr/s 在internal時間段里,每秒CPU接收的中斷的次數(shù)intr/total)*100
      CPU總的工作時間=total_cur=user+system+nice+idle+iowait+irq+softirq
      total_pre=pre_user+ pre_system+ pre_nice+ pre_idle+ pre_iowait+ pre_irq+ pre_softirq
      user=user_cur – user_pre
      total=total_cur-total_pre
      其中_cur 表示當前值,_pre表示interval時間前的值。上表中的所有值可取到兩位小數(shù)點。

    posted on 2014-11-26 15:09 順其自然EVO 閱讀(1071) 評論(0)  編輯  收藏 所屬分類: linux

    <2014年11月>
    2627282930311
    2345678
    9101112131415
    16171819202122
    23242526272829
    30123456

    導航

    統(tǒng)計

    常用鏈接

    留言簿(55)

    隨筆分類

    隨筆檔案

    文章分類

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲AV无码片一区二区三区| 亚洲色偷偷偷鲁综合| 亚洲丁香色婷婷综合欲色啪| 极品色天使在线婷婷天堂亚洲| 18禁止看的免费污网站| 亚洲精品无码永久中文字幕| 极品美女一级毛片免费| 女人张开腿等男人桶免费视频| 亚洲精品**中文毛片| 国产成人久久AV免费| 亚洲色偷偷偷鲁综合| 一级毛片免费毛片毛片| 免费一级毛片在线播放| 亚洲变态另类一区二区三区| 99久久精品日本一区二区免费| 亚洲AV无码久久精品成人| 久久久精品免费国产四虎| 亚洲中文久久精品无码| 国产精品免费αv视频| 亚洲第一福利网站在线观看| 日本亚洲中午字幕乱码 | 鲁大师在线影院免费观看 | 亚洲成在人线中文字幕| 亚欧免费一级毛片| 亚洲国产另类久久久精品| 国产精品免费大片| 老色鬼久久亚洲AV综合| 84pao国产成视频免费播放| 久久亚洲AV无码精品色午夜麻豆 | 最近中文字幕大全免费视频| 亚洲视频一区在线| 免费精品国偷自产在线在线| 亚洲jjzzjjzz在线观看| 无码视频免费一区二三区| 亚洲色无码专区一区| 国产老女人精品免费视频| 疯狂做受xxxx高潮视频免费| 亚洲女人被黑人巨大进入| 色播在线永久免费视频网站| 亚洲一区二区在线免费观看| 久久福利资源网站免费看|