linux下/proc/stat字段含义

  linux下/proc/stat字段含义 (2007-03-01 15:24:26)
          user         system nice         idle             iowait     irq        softirq
cpu   17906755 86377   53312329 1322524322 29311124 101704 1096939
cpu0 4665564   22883   13417357 330376020   7206071   99986   297154
cpu1 4488897   20352   13351971 330749128   7202582   0           271926
cpu2 4434851   22675   13302518 330622140   7455115   1718     245786
cpu3 4317443   20467   13240483 330777034   7447356   0           282073
第一行是总的情况
第二行到第五行分别代表每个cpu的情况
 
对这个文件需要读取两遍,我们用total表示累计总资源,那么user+sys就是我们想要知道的累计CPU占用的资源。每个变量后面的数字表示它是第几次读文件得到的,用如下方法可算出CPU占用率:
Total_1=user_1+nice_1+sys_1+idle_1
Total_2=user_2+nice_2+sys_2+idle_2
Rate={[(user_2+sys_2)-(user_1+sys_1)]/(total_2-total_1)}*100
由于我们两次读取的时间间隔比较短,我们就近似的认为这就是即时的CPU利用率。
 
 
page 141921816 270618577
               The number of pages the system paged in   and   the   number
                that were paged out (from disk).
进页面总数;出页面总数;

swap 162653 773227
               The   number   of   swap pages that have been brought in and
               out.
换入总数;换出总数

intr 554351143 356079077 38 0 11 11 0 5 3 1 0 0 0 146 0 2 0 0 0 0 0 145348702 4632843 0 0 48290304 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
               The number of interrupts received from the system boot.
中断总量
 
disk_io: (8,0):(48399919,26423829,283842508,21976090,541237126) 
               (major,minor):(noinfo,           read_io_ops,             blks_read,
               write_io_ops, blks_written)
单个磁盘I/O总数;单个磁盘I/O读;单个磁盘块读;单个磁盘I/O写;单个磁盘块写
ctxt 3551861649
               The number of context switches that the system underwent.
上下文切换数量

btime 1169169423
               boot time, in seconds since the epoch (January 1,   1970).
引导时间

processes 1547141
               Number of forks since boot.
进程总数
 
procs_running 1
procs_blocked 0
 

你可能感兴趣的:(linux,IO,user,System,disk,磁盘)