/proc/stat
2009-04-07 11:08
225 查看
[root@Eniak root]# cat /proc/stat
cpu 174 0 2974 79656
cpu0 174 0 2974 79656
page 15272 8781
swap 1 0
intr 102369 82804 2 0 0 0 0 3 0 1 0 0 0 0 0 14 2796 771 21 15957 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 0 0 0 0 0 0
disk_io: (3,0):(1,1,8,0,0)
ctxt 10837
btime 1174871603
processes 1215
官方说明: man proc
stat kernel/system statistics. Varies with architecture. Common
entries include:
cpu 3357 0 4313 1362393
The number of jiffies (1/100ths of a second) that the
system spent in user mode, user mode with low priority
(nice), system mode, and the idle task, respectively.
The last value should be 100 times the second entry in
the uptime pseudo-file.
page 5741 1808
The number of pages the system paged in and the number
that were paged out (from disk).
swap 1 0
The number of swap pages that have been brought in and
out.
intr 1462898
The number of interrupts received from the system boot.
disk_io: (2,0):(31,30,5764,1,2) (3,0):...
(major,minor):(noinfo, read_io_ops, blks_read,
write_io_ops, blks_written)
ctxt 115315
The number of context switches that the system underwent.
btime 769041601
boot time, in seconds since the epoch (January 1, 1970).
processes 86031
Number of forks since boot.
从man手册摘录出的内容可以知道,我们关心的数据在stat文件头两行已经标示出来了(单CPU)
cpu 174 0 2974 79656
cpu0 174 0 2974 79656
第一行是总的CPU资源状况,第二行是第一个CPU的资源状况,多CPU的以此类推
计算方法很简单,原理是系统每秒会有一个固定的时间片值,比如100,也就是说,
每秒CPU产生的100个时间片,要么被消耗掉(前三个数值),要么就空闲浪费掉(最后一个数值累加)
cpu 174 0 2974 79656
cpu0 174 0 2974 79656
page 15272 8781
swap 1 0
intr 102369 82804 2 0 0 0 0 3 0 1 0 0 0 0 0 14 2796 771 21 15957 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 0 0 0 0 0 0
disk_io: (3,0):(1,1,8,0,0)
ctxt 10837
btime 1174871603
processes 1215
官方说明: man proc
stat kernel/system statistics. Varies with architecture. Common
entries include:
cpu 3357 0 4313 1362393
The number of jiffies (1/100ths of a second) that the
system spent in user mode, user mode with low priority
(nice), system mode, and the idle task, respectively.
The last value should be 100 times the second entry in
the uptime pseudo-file.
page 5741 1808
The number of pages the system paged in and the number
that were paged out (from disk).
swap 1 0
The number of swap pages that have been brought in and
out.
intr 1462898
The number of interrupts received from the system boot.
disk_io: (2,0):(31,30,5764,1,2) (3,0):...
(major,minor):(noinfo, read_io_ops, blks_read,
write_io_ops, blks_written)
ctxt 115315
The number of context switches that the system underwent.
btime 769041601
boot time, in seconds since the epoch (January 1, 1970).
processes 86031
Number of forks since boot.
从man手册摘录出的内容可以知道,我们关心的数据在stat文件头两行已经标示出来了(单CPU)
cpu 174 0 2974 79656
cpu0 174 0 2974 79656
第一行是总的CPU资源状况,第二行是第一个CPU的资源状况,多CPU的以此类推
计算方法很简单,原理是系统每秒会有一个固定的时间片值,比如100,也就是说,
每秒CPU产生的100个时间片,要么被消耗掉(前三个数值),要么就空闲浪费掉(最后一个数值累加)
相关文章推荐
- /proc/interrupts /proc/stat 查看中断信息
- linux下用/proc/stat文件来计算cpu的利用率(附源码)
- /proc/interrupts 和 /proc/stat 查看中断的情况 (转载)
- 使用/proc/stat文件,用php计算CPU使用率、内存使用率
- Linux-系统管理-/proc/pid/stat
- 整理----通过/proc/diskstat 计算android I/O数据
- /proc/stat
- Linux中通过/proc/stat等文件计算Cpu使用率
- /proc/stat 详解
- PROC系列之---/proc/loadavg、/proc/pid/stat、/proc/pid/statm等
- linux /proc/stat 文件介绍及应用
- linux 、proc/pid/stat 文件分析
- /proc/[pid]/stat 文件解释
- linux proc/id/stat和cpu使用率计算
- linux下/proc/stat 计算CPU利用率
- PROC系列之/proc/pid/stat
- /proc/[pid]/stat 文件解释
- PROC系列之---/proc/pid/stat
- PROC系列之/proc/pid/stat
- linux下/proc/stat 计算CPU利用率