[转载] blktrace 分析 IO
前言
上篇博客介绍了 iostat 的一些输出,这篇介绍 blktrace 这个神器。上一节介绍 iostat 的时候,我们心心念念希望得到块设备处理 io 的 service time,而不是 service time + wait time,因为对于评估一个磁盘或者云磁盘而言,service time 才是衡量磁盘性能的核心指标和直接指标。很不幸 iostat 无法提供这个指标,但是 blktrace 可以。
blktrace 是一柄神器,很多工具都是基于该神器的:ioprof、seekwatcher、iowatcher,这个工具基本可以满足我们的对块设备请求的所有了解。
blktrace 的原理
一个 I/O 请求,从应用层到底层块设备,路径如下图所示 …
more ...[转载] 使用 blktrace 统计磁盘块 IO 访问频率
如果我们想知道,在一段时间内,那一个磁盘块被读写的频率最高,怎么办?我问这个问题是看到 taobao kernel wiki 上面有这么一段话,看了我十分心痒:
通过对 blktrace 的输出结果进行分析,我们可以对特定时间段内发生的
读、写操作的磁盘块进行 I/O 频次统计。结合通过将磁盘块 I/O 频度统计和
page cache 命中率统计相结合,就可以比较有效的判断服务器节点的 cache
使用效率。通过这套工具,CDN 系统修正了一个固态硬盘上 cache 管理的缺陷,
显著提高了I/O性能(详细信息)
淘宝大神给了一个 …
more ...[转载] Debugging disk issues with blktrace, blkparse, btrace and btt in Linux environment
blktrace is a block layer IO tracing mechanism which provides detailed information about request queue operations up to user space. There are three major components: a kernel component, a utility to record the i/o trace information …
more ...iowatcher - Create visualizations from blktrace results
- blktrace.git
- man iowatcher
iowatcher [options] [--] [program arguments ...]
blktrace/
iowatcher/
├── blkparse.c
├── blkparse.h
├── COPYING
├── fio.c
├── fio.h
├── list.h
├── main.c
├── Makefile
├── mpstat.c
├── mpstat.h
├── plot.c
├── plot.h
├── tracers.c
└── tracers.h
iowatcher graphs the results of a blktrace run. It can graph the result of …
more ...blkrawverify & verify_blkparse
- blktrace.git
- man blkrawverify
- man verify_blkparse
blkrawverify 和 verify_blkparse 都是 verifies an output file produced by blkparse
blkrawverify
The blkrawverify utility can be used to verify data retrieved via blktrace. It will check for valid event formats, forward progressing sequence numbers and time stamps, also does reasonable checks for other …
more ...blkparse - produce formatted output of event streams of block devices
- blktrace.git
- man blkparse
The blkparse utility will attempt to combine streams of events for various devices on various CPUs, and produce a formatted output of the event information. Specifically, it will take the (machine-readable) output of the blktrace utility and convert it to a nicely formatted and human-readable form …
more ...blktrace userspace tools - Initial commit
- d0ca268 Initial commit of blktrace
Inital commit of blktrace userspace tools 包含下列几个文件:
├── blkparse.c
├── blktrace.c
├── blktrace.h
├── Makefile
└── README
README
% blktrace <dev>
--- run task to generate load to be traced ---
<SIGINT to kill>
--- Generates:
<dev>_dat.[0..ncpus] : Contains binary pdu data
<dev>_out.[0..ncpus] : Contains binary trace …