ZFSBench is a high-performance benchmarking tool designed to test the capabilities of ZFS datasets. It supports concurrent I/O operations, customizable configurations, and provides detailed performance metrics, including IOPS, throughput, and latency. ZFSBench is useful for testing ZFS configurations under various workloads to ensure optimal performance and reliability.
- Concurrent I/O Testing: Simulate multi-threaded read and write operations.
- Configurable Workloads: Set block size, data size, sync frequency, and more.
- Advanced ZFS Controls: Optionally disable ARC caching and compression.
- Detailed Reporting: IOPS, throughput, and latency percentiles.
- Logging: Generates a log file for each run with comprehensive metrics.
- Optional
gstat
Monitoring: Gather additional disk activity data.
- Go: Version 1.17 or later
- ZFS: Ensure ZFS is installed and configured on the system
- Sufficient Disk Space: Available space on the target ZFS dataset
Clone the repository and build the application:
git clone <repo-url>
cd zfsbench
go build -o zfsbench src/main.go
To start a benchmark, specify the ZFS dataset you want to test. Replace <zfs-dataset>
with your dataset (e.g., zroot/home
).
sudo ./zfsbench -dataset=<zfs-dataset>
For detailed instructions on configuring and running benchmarks, see USAGE.md.
ZFSBench offers a range of command-line options to customize the benchmark. Here are some of the primary options:
Option | Description | Default |
---|---|---|
-dataset |
(Required) Target ZFS dataset for benchmarking. | |
-blocksize |
Block size (in bytes) for I/O operations. | 4096 |
-datasize |
Total data size (in bytes) to write per benchmark iteration. | 128MB |
-syncfreq |
Frequency (in blocks) for syncing data during writes. | 10000 |
-goroutines |
Number of concurrent threads. | 4 |
-runs |
Number of iterations for the benchmark. | 5 |
-nocache |
Disable ZFS ARC caching for the duration of the test. | false |
-nocompress |
Disable ZFS compression on the dataset. | false |
-gstat |
Use gstat for additional disk metrics. |
false |
-randomio |
Perform random I/O operations. | false |
For a complete list of options and examples, refer to USAGE.md.
sudo ./zfsbench -dataset=zroot/home
sudo ./zfsbench -dataset=zroot/home -goroutines=8 -syncfreq=5000 -randomio -nocache
sudo ./zfsbench -dataset=zroot/home -blocksize=16384 -datasize=1073741824 -nocompress
For more examples, see USAGE.md.
The results from each run are displayed on the console and saved in a log file in the format zfsbench_<timestamp>.log
. Logs include:
- Write Performance: Average time for write operations.
- Read Performance: Average time for read operations.
- IOPS: Input/Output operations per second.
- Throughput: Data transfer rate in MB/sec.
Average Write Performance: 4.57s
Average Read Performance: 198ms
Average IOPS: 379,260
Average Throughput: 370.37 MB/sec
Comprehensive Report:
Write Duration: 4.57s
Read Duration: 198ms
Average IOPS: 379,260
Average Throughput: 370.37 MB/sec