Pgpgin and pgpgout - Linux counters in / proc / vmstat
I am writing an application that collects general system I / O statistics. I was wondering if there would be two counters for pages and pages,
pgpgin
pgpgout
in / proc / vmstat includes pages written and read from all disk based devices connected to the system.
Please let me know if you can!
source to share
I would not understand why not. I mean, when you get the pagefault file, the necessary blocks can come from anywhere, depending on what filesystems are mounted where in the VFS (i.e. in memory mapped to I / O) or the process space has changed to exchange file systems / files. I don't understand why not all blockers will be counted, because they can all be used for swap (but it depends on what filesystems you have and how you use them)
source to share
Pages are written to and from swap partitions; the numbers do not tell you to which section they were written, only that a paging event has occurred.
If you want to see disk IO statistics, you should look at / proc / diskstats or / sys / block / * / stat for block device I / O counters.
This article on vmstat helps you understand what the swap counters mean: http://www.linuxjournal.com/article/8178
source to share
See Linux source code, for example http://lxr.free-electrons.com/source/block/blk-core.c?v=4.6 . There we find that counters are supported in a function submit_bio()
that seems to count any disk i / o (see its usage, for example http://lxr.free-electrons.com/ident?v=4.6;i=submit_bio ), so as not to be confused with operating system paging ( https://en.wikipedia.org/wiki/Paging ).
source to share
it may not be timely, but i did
man vmstat
and found that the file can be read, or there is a box that can be called by the same name. It will give you all of the same, but you can ask for it in different ways with a suitable convenience. There's a small bunch of descriptions for the various counters that bin reports.
Hope this helps, Josh
source to share