/proc/[pid]/io 中的计数器是什么意思? [英] What do the counters in /proc/[pid]/io mean?

查看:15
本文介绍了/proc/[pid]/io 中的计数器是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 Munin 创建一个插件来监控命名进程的统计信息.信息来源之一是 /proc/[pid]/io.但是我很难找出 rchar/wcharread_bytes/written_bytes 之间的区别.

I'm creating a plugin for Munin to monitor stats of named processes. One of the sources of information would be /proc/[pid]/io. But I have a hard time finding out what the difference is between rchar/wchar and read_bytes/written_bytes.

它们并不相同,因为它们提供不同的值.它们代表什么?

They are not the same, as they provide different values. What do they represent?

推荐答案

虽然 proc 手册页 严重落后(大多数手册页/文档与千篇一律的用户空间开发无关),幸运的是,这些内容完全记录在 Linux 内核源码 Documentation/filesystems/proc.rst.以下是相关位:

While the proc manpage is woefully behind (and so are most manpages/documentation on anything not relating to cookie-cutter user-space development), this stuff is fortunately documented completely in the Linux kernel source under Documentation/filesystems/proc.rst. Here are the relevant bits:

rchar
-----

I/O counter: chars read
The number of bytes which this task has caused to be read from storage. This
is simply the sum of bytes which this process passed to read() and pread().
It includes things like tty IO and it is unaffected by whether or not actual
physical disk IO was required (the read might have been satisfied from
pagecache)


wchar
-----

I/O counter: chars written
The number of bytes which this task has caused, or shall cause to be written
to disk. Similar caveats apply here as with rchar.


read_bytes
----------

I/O counter: bytes read
Attempt to count the number of bytes which this process really did cause to
be fetched from the storage layer. Done at the submit_bio() level, so it is
accurate for block-backed filesystems. <please add status regarding NFS and
CIFS at a later time>


write_bytes
-----------

I/O counter: bytes written
Attempt to count the number of bytes which this process caused to be sent to
the storage layer. This is done at page-dirtying time.

这篇关于/proc/[pid]/io 中的计数器是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆