Open main menu

OpenVZ Virtuozzo Containers Wiki β

Editing IO statistics

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 the IO statistics that is collected at the IO-scheduler level. It describes the information about the container's real work with disks. This is different from what shown by [[IO accounting]].
+
This page describes the IO statistics that is collected at the IO-scheduler level. It describes the information about the container's real work with disks.
  
 
== Kernel interface  ==
 
== Kernel interface  ==
  
The stats are reported via the proc files. Currently it is available in kernels starting from 028stab069.1.
+
The stats in question are reported via the proc files. Currently it is available in kernels starting from 028stab069.1.
  
 
=== Files ===
 
=== Files ===
  
* <code>/proc/bc/$id/iostat</code>
+
* /proc/bc/$id/iostat  
 
: statistics for beancounter $id
 
: statistics for beancounter $id
* <code>/proc/bc/iostat</code>
+
* /proc/bc/iostat  
 
: statistics for all beancounters
 
: statistics for all beancounters
  
Line 20: Line 20:
 
! N !! name !! type !! description
 
! N !! name !! type !! description
 
|-
 
|-
| 1 || disk || string || Disk device name, e.g. sda or hda, or a special queue (like fuse or flush)
+
| 1 || disk || string || Disk device name, e.g. sda or hda
 
|-
 
|-
 
| 2 || ub id || integer || Beancounter id
 
| 2 || ub id || integer || Beancounter id
 
|-
 
|-
| 3 || state || char || currently unused (always '.')
+
| 3 || state || char || currently unused
 
|-
 
|-
 
| 4 || busy queues || integer || The number of queues with requests (see below)
 
| 4 || busy queues || integer || The number of queues with requests (see below)
 
|-
 
|-
| 5 || on dispatch || integer || currently unused (always '0')
+
| 5 || on dispatch || integer || The number of requests dispatched to a hardware
 
|-
 
|-
| 6 || activations count || integer || currently unused (always '0')
+
| 6 || activations count || integer || The number of switches to active state
 
|-
 
|-
 
| 7 || wait time || integer || Total time in waiting state in milliseconds
 
| 7 || wait time || integer || Total time in waiting state in milliseconds
Line 41: Line 41:
 
|}
 
|}
  
New columns might be added at the end of row in future.
+
New columns might be added at the end of row in future!
 
 
Separate stats exist for fuse and flush, that only report requests and sectors stats (others are always 0).
 
 
 
Example of parsing code: parse_proc_iostat() function in [https://src.openvz.org/projects/OVZ/repos/vzstat/browse/src/vzstat.c vzstat.c]
 
 
 
=== I/O schedulers ===
 
Check available/active I/O schedulers for block device "sda":
 
# cat /sys/block/sda/queue/scheduler
 
noop deadline [cfq]
 
 
 
* for "cfq" I/O scheduler: a separate block device line is added in iostat proc file
 
# cat /proc/bc/100/iostat
 
flush 100 . 0 0 0 0 0 7389 1893968 0 0
 
fuse 100 . 0 0 0 0 0 0 0 0 0
 
sda 100 . 0 0 0 9000 1843380 245216 55845488 245028 188
 
 
 
* for "deadline" I/O scheduler: no additional per-device line is added, iops counters for such devices are added to "flush" line counters (iops limit works)
 
 
 
* for "noop" I/O scheduler: iops are not counted (iops limit does not work)
 
 
 
* for devices with no I/O scheduler (like logical devices, ceph rbd devices, etc): iops are not counted (iops limit does not work)
 
# cat /sys/block/dm-0/queue/scheduler
 
none
 
 
 
# cat /sys/block/rbd0/queue/scheduler
 
none
 
  
 
=== Queues ===
 
=== Queues ===
Line 86: Line 60:
  
 
  active  = sum(b.used_time - a.used_time) * 100 / interval;
 
  active  = sum(b.used_time - a.used_time) * 100 / interval;
  waiting = sum(b.wait_time - a.wait_time) * 100 / interval;
+
  waiting = sum(b.wait_time - b.wait_time) * 100 / interval;
 
  idle    = 100 - (active + waiting);
 
  idle    = 100 - (active + waiting);
  
Line 108: Line 82:
  
 
denotes the average request size for a beancounter to a particular disk.
 
denotes the average request size for a beancounter to a particular disk.
 
== See also ==
 
* [[IO accounting]]
 
* [[I/O priorities]]
 
* [[I/O limits]]
 

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)