fioer: 用于 fio 的 Python 包装器,面向SSD测试,包括数据处理和可视化
git clone [repo.git]
cd fioer
pip install -e .
from fioer.job import FioTask
template_file = "bala/randrw.fio"
randrw = FioTask(work_path="./randrw",input_dict=None,)
randrw.input.from_input_file(template_file)
randrw.run(cli_params={"status-interval":"1"})
使用模板文件 template: randrw.fio 读写比例 r/w = 65/35
[global]
name=fio-rand-write
filename=fio-rand-write
rw=randrw
bs=4K
direct=1
numjobs=1
time_based=1
runtime=200
ioengine=libaio
iodepth=64
rwmixread=65
[file1]
size=10M
根据 SNIA-PTS说明, 第 2.1.1 节
SNIA | FIO | Description |
---|---|---|
blocksize |
bs |
block size |
Read/Write |
randrw(rwmixread=X) |
read/write |
OIO: Outstanding IO,/( Queue Depth) |
iodepth |
iodepth |
Thread Count(Workers, Process) |
numjobs |
number of jobs |
Latency |
slat, clat, lat |
latency |
Cache |
direct=1 |
direct IO |
从json输出得到图表,from data(parsed.json) 可以 读/写可视化
randrw.view.view_iops(mode="write")
randrw.view.view_latency(mode="write", lat_type="lat")
或者 读/写同时可视化
randrw.view.view_iops(mode="both")
randrw.view.view_latency(mode="both", lat_type="lat")
参照snia pts v2.0.1, 第七章psedo code
from fioer.flow import flow_snia_iops
flow_snia_iops(project_path="./wf",rwmix_mapping=[0,35,50,65,100], bs_mapping=[4,8,16,32])
如flow.flow_snia_iops.py所示, 每个根据工作流程生成的fio任务对应一个文件夹
tree ./wf
.
├── 02.precond
│ ├── input.fio
│ ├── output.json
│ ├── parsed.json
│ └── seq_write_meta
├── 03.mapping-rwmix0-bs16
│ ├── round-0
│ │ ├── input.fio
│ │ ├── output.json
│ │ ├── parsed.json
│ │ └── rw_meta
│ ├── round-1
│ │ ├── input.fio
│ │ ├── output.json
│ │ ├── parsed.json
│ │ └── rw_meta