获取机器的基本参数cat /proc/stat

简介: 获取机器的基本参数cat /proc/stat Note : This guide is applicable to Linux kernels 2.6.14 and above, which adds support for smaps, per-mapping data, including data on each mapping's rss usage.

获取机器的基本参数cat /proc/stat

Note : This guide is applicable to Linux kernels 2.6.14 and above, which adds support for smaps, per-mapping data, including data on each mapping's rss usage.

分别是usernice,system,idle,irq,iowait,irq,softirq.具体参数解释如下:

user()表示自系统启动开始累计到当前时刻,用户态的cpu时间(单位:jiffies,不包含nice值为负的进程。1jiffies=0.01秒。

nice()表示自系统启动开始累计到当前时刻,nice值为负的进程所占用的cpu时间(单位:jiffies)。

system()表示自系统启动开始累计到当前时刻,系统态的cpu时间(单位:jiffies)

idle()表示自系统启动开始累计到当前时刻,除硬盘io等待时间以外的其他等待时间(单位:jiffies)。

iowait()表示自系统启动开始累计到当前时刻,硬盘io等待时间(单位:jiffies)

irq()表示自系统启动开始累计到当前时刻,硬中断时间(单位iejiffies)

softirq()表示自系统启动开始累计到当前时刻,软中断时间(单位:jiffies)

cpu时间=user+nice+system+idle+iowait+irq+softirq.

"intr"这行给出中断的信息,第一个为自系统启动以来,发生的所有的中断的次数,后每个数对应一个特定的中断自系统启动以来发生的中断次数。

"ctxt"表示自系统启动以来cpu发生的上下文转换的次数。

"btime"表示自197011日开始到当前时刻的时间,单位秒。

"processes(total_forks) "表示自系统启动以来创建的进程总数。

"procs_running"表示当前运行队列的任务的数目。

"procs_blocked"表示当前被阻塞的任务的数目。

原文

http://unixlive.editboard.com/t4-memory-usage-retrieval-on-linux-process-wise-and-general

http://yanyinhong716.blog.163.com/blog/static/1724398812011101621453721/

详细讲解了cpu使用率的计算方法

http://www.blogjava.net/fjzag/articles/317773.html

目录
相关文章
|
Linux
proc文件
参考代码: #include #include #include #include #include #include #include #include #include #define STRING_LEN 1024 c...
867 0
|
Linux
proc文件(OLD)
写一个模块测试proc文件的读写: 1 #include linux/module.h 2 #include linux/kernel.h 3 #include linux/proc_fs.
769 0
|
Linux
CDH Cloudera 建议将 /proc/sys/vm/swappiness 设置为最大值 10
CDH Cloudera 建议将 /proc/sys/vm/swappiness 设置为最大值 10
438 0
CDH Cloudera 建议将 /proc/sys/vm/swappiness 设置为最大值 10
proc源码解析(五)--proc的管理函数
http://blog.csdn.net/xhy_851221/article/details/4958840
631 0

热门文章

最新文章