Introduction
Storage performance directly impacts database latency, application responsiveness, and user experience. Whether you are provisioning a new NAS, evaluating cloud block storage, or validating an NVMe array, systematic benchmarking reveals the true capabilities of your storage infrastructure — beyond manufacturer specifications.
This guide compares three battle-tested open-source storage benchmarking tools: FIO (Flexible I/O Tester), Sysbench, and Bonnie++. Each excels at different aspects of storage evaluation, from raw I/O performance to database-simulated workloads to filesystem metadata operations.
Feature Comparison
| Feature | FIO | Sysbench | Bonnie++ |
|---|---|---|---|
| GitHub Stars | 6,255 | 6,354 | Community |
| Language | C | C | C++ |
| License | GPL-2.0 | GPL-2.0 | GPL-2.0 |
| I/O Engine Support | sync, libaio, io_uring, mmap, SPDK | sync, libaio | sync |
| Workload Types | Sequential/random read/write, mixed | OLTP, filesystem | Sequential/random, file create/delete |
| Multi-thread Support | Yes (native jobs) | Yes (native threads) | Yes (fork-based) |
| Network Storage | Yes (NBD, iSCSI) | No | No |
| Report Format | JSON, JSON+, Terse, Normal | Tabular, CSV | Tabular, CSV |
| Docker Support | Yes (Official Image) | Yes (Community) | Manual Setup |
| Learning Curve | High (100+ options) | Medium | Low (simple CLI) |
| Best For | Detailed I/O profiling | Database workload simulation | Filesystem metadata testing |
FIO: The Swiss Army Knife of I/O Benchmarking
FIO (Flexible I/O Tester) is the industry standard for storage performance testing. Originally written by Jens Axboe (Linux kernel block layer maintainer), FIO can simulate virtually any I/O workload pattern — from a simple sequential read to a complex mix of random reads and writes across multiple threads, block sizes, and I/O depths.
Key Capabilities
- I/O engines: Support for sync, libaio, io_uring, mmap, POSIX aio, Solaris aio, Windows aio, SPDK, and more
- Workload customization: Define read/write ratios, random/sequential mix, block size distribution, think time
- Multi-job parallelism: Run multiple independent I/O streams simultaneously with different parameters
- Verification: Built-in data verification (md5, crc32, etc.) to validate write integrity
- Latency percentiles: Report p50, p90, p95, p99, p99.9 latency statistics
- Steady-state detection: Run tests until performance stabilizes (required for enterprise SSD certification)
Docker Deployment
| |
Common FIO Workload Profiles
Sequential Read (Throughput Test):
| |
Random Write (IOPS Test for SSDs):
| |
Mixed Workload (Real-World Simulation):
| |
Interpreting FIO Results
A typical FIO JSON output includes these key metrics:
| |
For databases, pay attention to p99 latency — it represents the “worst normal case” your application will experience.
Sysbench: Database and System-Level Benchmarking
Sysbench started as a MySQL benchmarking tool and evolved into a general-purpose system performance testing framework. While it includes CPU, memory, and mutex tests, its strongest feature remains filesystem and database benchmarking with realistic OLTP workloads.
Key Capabilities
- File I/O test: Sequential and random read/write with configurable file sizes and thread counts
- OLTP benchmark: Simulates database workloads with transactions, point selects, range queries
- CPU benchmark: Prime number calculation for CPU performance testing
- Memory benchmark: Memory read/write throughput testing
- Thread/mutex benchmark: Concurrency and locking performance
Installation
| |
Filesystem Benchmarking
| |
OLTP Database Simulation
| |
Bonnie++: Filesystem Metadata Performance
Bonnie++ focuses on filesystem-level operations that other tools overlook — creating and deleting thousands of files, directory listing performance, and metadata operations per second. This matters because many real-world workloads (mail servers, web caches, container image storage) are metadata-intensive rather than throughput-bound.
Key Capabilities
- Sequential output: Write speed for large files
- Sequential input: Read speed for large files
- Random seeks: Random access latency
- Sequential create: File creation rate (files per second)
- Random create: Creating files in random directories
- Sequential delete: File deletion rate
- Random delete: Deleting files from random directories
Installation and Usage
| |
Understanding Bonnie++ Output
| |
The sequential create section shows how many files per second the filesystem can create, read, and delete — crucial metrics for applications that handle many small files.
Choosing the Right Benchmark
| Scenario | Recommended Tool | Key Metrics |
|---|---|---|
| Database storage evaluation | FIO + Sysbench | IOPS, p99 latency, TPS |
| NAS/SAN procurement | FIO + Bonnie++ | Throughput, metadata ops |
| NVMe SSD validation | FIO (steady-state) | 4K random IOPS, endurance |
| Kubernetes persistent volume test | FIO | Mixed workload IOPS |
| Email server storage sizing | Bonnie++ | Files/sec create/delete |
| Gaming server storage | FIO (low queue depth) | 4K randread QD1 latency |
Why Self-Host Your Storage Benchmarking?
Cloud providers and storage vendors publish benchmark numbers from ideal conditions — clean drives, no other workloads, optimal configurations. Your production environment shares storage with other tenants, runs on virtualized hardware, and contends with noisy neighbors. Self-hosted benchmarks reflect YOUR reality, not a vendor’s marketing sheet.
For DevOps teams managing on-premises storage, regular benchmarking establishes baselines and detects degradation early. A monthly FIO run on each storage node can reveal a failing drive before SMART data reports errors. For more on infrastructure monitoring, see our self-hosted NTP monitoring guide and hardware monitoring with IPMI.
FAQ
How long should I run benchmarks for reliable results?
For quick comparisons, 60 seconds can be sufficient. For production validation, run each test for at least 5 minutes, and preferably until steady-state is reached. Enterprise SSD certification (per SNIA specification) requires running FIO until performance stabilizes — often 30-60 minutes per test.
Should I use direct I/O or buffered I/O?
Use direct I/O (--direct=1 in FIO) for benchmarking raw storage performance. Buffered I/O goes through the Linux page cache, which masks actual disk performance with memory speed. Direct I/O bypasses the cache and measures what the storage device can actually deliver.
Why do my FIO numbers not match the manufacturer’s specs?
Manufacturers typically quote peak performance under ideal conditions — QD32, 4 jobs, sequential workload, clean drive. Real-world workloads rarely match those parameters. Also, storage performance degrades as drives fill up. Run benchmarks on a drive that’s 50-80% full to get realistic production numbers.
Can these tools damage SSDs?
All three tools write data during testing. FIO’s verify mode writes and reads back, providing wear-level-appropriate stress. For SSD endurance testing, use FIO’s steady-state mode which is designed for NAND flash. For production drives, limit write testing to reasonable sizes (1-10 GB) rather than filling the entire drive repeatedly.
Which tool is best for comparing cloud block storage (EBS, Persistent Disk)?
FIO with direct I/O and a moderate I/O depth (4-16) provides the most accurate comparison. Cloud storage has variable performance depending on volume size and provisioned IOPS. Run the same FIO job file on each cloud provider to get apples-to-apples comparisons.
💰 想测试你的市场判断力?我用 Polymarket 做预测市场交易——这是全球最大的预测市场平台,从大选结果到技术监管时间线,什么都可以押注。和赌博不同,这是真正的信息市场:你懂的信息越多,胜率越高。我靠预测技术相关事件的走向已经赚了不少。用我的邀请链接注册:Polymarket.com