Scripts2026年5月26日·1 分钟阅读

fio — Flexible I/O Tester for Storage Benchmarking

fio is a configurable I/O workload generator used to benchmark and stress-test storage subsystems with precise control over read/write patterns, block sizes, and concurrency.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
fio Overview
直接安装命令
npx -y tokrepo@latest install 94698b64-5920-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

fio (Flexible I/O Tester) is the industry-standard tool for benchmarking storage devices and filesystems. Written in C, it can simulate virtually any I/O workload pattern by combining configurable block sizes, queue depths, access patterns, and I/O engines. It is used by storage vendors, kernel developers, and DevOps engineers to validate hardware and tune systems.

What fio Does

  • Generates sequential, random, or mixed read/write workloads at any block size
  • Supports dozens of I/O engines including libaio, io_uring, sync, mmap, and RDMA
  • Runs multiple parallel jobs to stress-test concurrency and queue depth scaling
  • Reports IOPS, bandwidth, and latency at configurable percentile levels
  • Accepts job files in INI format for repeatable, shareable benchmark definitions

Architecture Overview

fio spawns one or more worker threads or processes, each executing an I/O loop defined by a job specification. Each job selects an I/O engine (the syscall or library interface), an access pattern (sequential, random, zipf), and parameters like block size and queue depth. A central statistics collector aggregates per-job metrics and emits a summary with IOPS, bandwidth, and latency percentiles.

Self-Hosting & Configuration

  • Install via package manager or compile from source with ./configure && make
  • Define workloads in .fio job files (INI-style) for reproducible benchmarks
  • Use --direct=1 to bypass the page cache and measure raw device performance
  • Select the I/O engine matching your target: io_uring for modern Linux, libaio for legacy
  • Output results as JSON with --output-format=json for automated analysis pipelines

Key Features

  • Supports 30+ I/O engines including io_uring, libaio, POSIX AIO, and Windows IOCP
  • Configurable access patterns: sequential, random, strided, and custom distributions
  • Per-job and group reporting with latency histograms and percentile breakdowns
  • Verification mode writes checksums and reads them back to detect data corruption
  • Job file format allows sharing and version-controlling benchmark definitions

Comparison with Similar Tools

  • sysbench fileio — Simpler file I/O test but far fewer tuning options than fio
  • dd — Basic sequential throughput test, no random I/O or latency reporting
  • bonnie++ — Classic filesystem benchmark with fixed test patterns
  • Iometer — Windows-centric GUI benchmark, less flexible than fio on Linux
  • diskspd — Microsoft's storage benchmarking tool, Windows-focused

FAQ

Q: Should I use direct I/O or buffered I/O for benchmarks? A: Use --direct=1 to measure raw device speed. Buffered I/O benchmarks test the page cache, which is useful for application-level analysis.

Q: What I/O engine should I use on modern Linux? A: io_uring offers the best performance on Linux 5.1+. Fall back to libaio for older kernels.

Q: How do I benchmark NVMe devices? A: Use io_uring or libaio with high iodepth (64-256) and multiple jobs to saturate the device's internal parallelism.

Q: Can fio simulate real application workloads? A: Yes. Record an application's I/O trace with blktrace and replay it with fio's replay_redirect option.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产