Difference between revisions of "I/O sniffing"

From Linuxintro
imported>ThorstenStaerk
imported>ThorstenStaerk
Line 1: Line 1:
I coined an expression I/O sniffing for listening to the system at block level like this:
+
Sometimes, for example when [[troubleshooting]] performance problems you need to understand how your system interacts with its [[hard disk]]s. You may have used [[ioMeter]] to measure your disks' speed and [[ioStat]] and [[sar]] to gather statistics. However sometimes you need to drill down deeper into the analysis, you need to understand what happens on the block level. I call this I/O sniffing. The goal is to observe packets like this:
  
initiator XYZ requests block 4711 from device 0815
+
initiator XYZ requests block 4711 from device 0815
initiator BLA writes block 1234 to device 9876  
+
initiator BLA writes block 1234 to device 9876  
 +
block 4711 arrives from device 0815
  
 
You can do I/O sniffing using the command blktrace. blktrace will show you every request that goes to the disk.
 
You can do I/O sniffing using the command blktrace. blktrace will show you every request that goes to the disk.

Revision as of 13:55, 26 December 2013

Sometimes, for example when troubleshooting performance problems you need to understand how your system interacts with its hard disks. You may have used ioMeter to measure your disks' speed and ioStat and sar to gather statistics. However sometimes you need to drill down deeper into the analysis, you need to understand what happens on the block level. I call this I/O sniffing. The goal is to observe packets like this:

initiator XYZ requests block 4711 from device 0815
initiator BLA writes block 1234 to device 9876 
block 4711 arrives from device 0815

You can do I/O sniffing using the command blktrace. blktrace will show you every request that goes to the disk.

Example:

# blktrace -d /dev/sdg -o - | blkparse -i - 
[...]
  8,96   7      106     0.373952974 11364  D   W 0 + 8 [kworker/7:2]
  8,96   7      107     0.374456639    47  C   W 0 + 8 [0]


The RWBS(D) field can be a combination of

R : Read
W : Write
D : Block discard
B : Barrier operation
S : Synchronous operations

See also