您的位置:首页 > 其它

/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个时间片,要么被消耗掉(前三个数值),要么就空闲浪费掉(最后一个数值累加)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: