Editing IO accounting
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | This page describes | + | This page describes how IO activity of VE processes is accounted. This feature is available since OpenVZ kernels version <code>028test008</code> |
− | |||
− | |||
− | |||
− | |||
− | |||
== New resources == | == New resources == | ||
The following resources are accounted: | The following resources are accounted: | ||
; read bytes | ; read bytes | ||
− | : is the | + | : is the amount of bytes read by tasks. Reads are always synchronous in kernel so this type of resources is the easiest one |
; dirty bytes | ; dirty bytes | ||
− | : is the | + | : is the amount of bytes that were dirty since VE start, i.e. data that isn't yet flushed to disk. This type of resources is accounted using [[RSS_fractions_accounting|page beancounters]] and the context the page was dirtied by is determined like this: |
− | + | * if page is mapped it's "mapper" is used as this may happen in any context (unmapping of page under memory pressure) | |
− | + | * if page is not mapped - current BC is used as this can happen during usual write (writev) only | |
; written bytes | ; written bytes | ||
− | : is the | + | : is the amount of bytes flushed to disk. The beancounter to charge this to is the one the page was dirtied by |
; canceled bytes | ; canceled bytes | ||
− | : is the | + | : is the amount of bytes that were dirty but weren't flushed to disk |
; missed bytes | ; missed bytes | ||
− | : is the | + | : is the amount of bytes that were dirtied but the context (beancounter) wasn't saved due to lack of memory |
== Proc interface == | == Proc interface == | ||
− | |||
=== General information === | === General information === | ||
− | As was described in [[BC proc entries|another | + | As it was described in [[BC proc entries|another artice]] each beancounter has it's own <code>/proc/bc/$BCID</code> directory where subsystems add their entries. IO accounting adds <code>ioacct</code> entry to show IO information. This entry contains the following information: |
<pre> | <pre> | ||
# cat /proc/bc/101/ioacct | # cat /proc/bc/101/ioacct | ||
Line 39: | Line 33: | ||
</pre> | </pre> | ||
− | Note that <code>dirty</code> is not the size of dirty data at the moment | + | 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 === | === Debugging information === | ||
− | When <code>CONFIG_UBC_DEBUG_IO</code> | + | 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. |
<pre> | <pre> | ||
# cat /proc/bc/ioacct_debug | # cat /proc/bc/ioacct_debug | ||
Line 55: | Line 49: | ||
== Auxiliary information == | == Auxiliary information == | ||
− | Along with VFS | + | Along with VFS IO activity the following information is gathered |
; sync counts | ; sync counts | ||
− | : The number of <code>sync(2)</code>, <code>fsync(2)</code>, <code>fdatasync(2)</code> and <code>sync_file_range</code>. | + | : The number of <code>sync(2)</code>, <code>fsync(2)</code>, <code>fdatasync(2)</code> and <code>sync_file_range</code> is accounted. |
<pre> | <pre> | ||
# cat /proc/bc/101/ioacct | # cat /proc/bc/101/ioacct | ||
Line 73: | Line 67: | ||
; write/read calls counts | ; write/read calls counts | ||
− | : | + | : Then 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> | <pre> | ||
# cat /proc/bc/101/ioacct | # cat /proc/bc/101/ioacct | ||
Line 83: | Line 77: | ||
</pre> | </pre> | ||
− | ; number of page beancounters pinned by | + | ; number of page beancounters pinned by IO |
: 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. | : 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> | ||
Line 107: | Line 101: | ||
io_pbs 0 | io_pbs 0 | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |