Changes

Jump to: navigation, search

IO accounting

321 bytes added, 19:46, 8 July 2015
See also: added I/O limits
This page describes how IO accounting for I/O activity of VE CT processes is accounted, on a VFS I/O level. This The feature is available since beginning with OpenVZ kernels version <code>028test008</code>. If you are interested in [[I/O priorities for containers]], it is described in a separate article. If you are looking for IO scheduler (i.e. lower level) statistics, see [[IO statistics]] instead.
== New resources ==
The following resources are accounted:
; read bytes
: is the amount number of bytes read by tasks. Reads are always synchronous in the kernel so this type of resources resource is the easiest one.
; dirty bytes
: is the amount number of bytes that were dirty since VE start, i.&nbsp;e. data that isn't yet flushed to disk. This type of resources resource is accounted accumulated using [[RSS_fractions_accounting|page beancounters]] and the context the page was dirtied by is determined like this::* if a page is mapped it's "mapper" is used as this may happen in any context (unmapping of a page under memory pressure);:* if a page is not mapped - current BC is used as this can happen during usual write (writev) only.
; written bytes
: is the amount number of bytes flushed to disk. The beancounter to charge charged with this to is the one by which the page was dirtied by.
; canceled bytes
: is the amount number of bytes that were dirty but weren't flushed to disk.
; missed bytes
: is the amount number of bytes that were dirtied but the context (beancounter) wasn't saved due to lack of memory.
== Proc interface ==
 
=== General information ===
As it was described in [[BC proc entries|another articearticle]] each beancounter has it's its own <code>/proc/bc/$BCID</code> directory where subsystems add their entries. IO I/O accounting adds an <code>ioacct</code> entry to show IO I/O information. This entry contains the following information:
<pre>
# cat /proc/bc/101/ioacct
</pre>
Note that <code>dirty</code> is not the size of dirty data at the moment , but is the size of dirty data seen so far.
=== Debugging information ===
When <code>CONFIG_UBC_DEBUG_IO</code> , is on <code>/proc/bc/ioacct_debug</code> is added. This entry contains a snapshot of current dirty pages with its beancounter in system. E.g.For example:
<pre>
# cat /proc/bc/ioacct_debug
== Auxiliary information ==
Along with VFS IO I/O activity the following information is gathered
; sync counts
: The number of <code>sync(2)</code>, <code>fsync(2)</code>, <code>fdatasync(2)</code> and <code>sync_file_range</code> is accounted.
<pre>
# cat /proc/bc/101/ioacct
; write/read calls counts
: Then The number of <code>read(2)</code>, <code>readv(2)</code>, <code>write(2)</code>, <code>writev(2)</code> , etc . and the number of bytes passed is also accounted.
<pre>
# cat /proc/bc/101/ioacct
</pre>
; number of page beancounters pinned by IOI/O
: This is the number of page beancounters that save information about page dirtier. This is actually the number of dirty pages within beancounter at the moment.
<pre>
</pre>
== See also ==* [[IO statistics]]* [[I/O priorities]]* [[I/O limits]] [[Category:UBCResource management]]

Navigation menu