Introduction to I/O Testing Tools
When evaluating storage performance, several I/O testing tools are available. Among the most popular are fio, iometer, and Orion. Each has its strengths: fio is particularly well-suited for Linux environments, iometer excels on Windows systems, and Orion specializes in simulating Oracle database workloads without requiring a full Oracle installation.
Instlaling fio
To install fio on Linux systems, you can either download the source code from the official website and compile it:
tar -xvf fio-2.1.10.tar
cd fio-2.1.10
./configure
make
make install
Or install it using your package manager:
yum -y install fio
Understanding fio Parameters
The fio tool offers numerous parameters to customize your I/O tests. Here are some key parameters:
filename: Specifies the target device or file (e.g., /dev/sdb or /dev/emcpowerb)direct=1: Bypasses system buffers for more accurate measurementsrw: Defines the I/O pattern (read, write, randread, randwrite, randrw)bs: Block size for I/O operationssize: Total size of data to be processednumjobs: Number of parallel jobs/threadsruntime: Duration of the test in secondsioengine: I/O engine to use (psync or libaio)group_reporting: Aggregates results from all jobs
Common I/O Test Scenarios
Here are some typical test scenarios using fio:
Random Read IOPS Test
fio -direct=1 -iodepth=128 -rw=randread -ioengine=libaio -bs=4k -size=1G -numjobs=1 -runtime=1000 -group_reporting -filename=/dev/sdb -name=Random_Read_Test
Random Write IOPS Test
fio -direct=1 -iodepth=128 -rw=randwrite -ioengine=libaio -bs=4k -size=1G -numjobs=1 -runtime=1000 -group_reporting -filename=/dev/sdb -name=Random_Write_Test
Sequential Write Throughput Test
fio -direct=1 -iodepth=64 -rw=write -ioengine=libaio -bs=1024k -size=1G -numjobs=1 -runtime=1000 -group_reporting -filename=/dev/sdb -name=Sequential_Write_Test
Sequential Read Throughput Test
fio -direct=1 -iodepth=64 -rw=read -ioengine=libaio -bs=1024k -size=1G -numjobs=1 -runtime=1000 -group_reporting -filename=/dev/sdb -name=Sequential_Read_Test
Interpreting fio Test Results
When analyzing fio output, several key metrics are important:
io: Total amount of data processedbw: Average I/O bandwidthiops: Input/Output Operations Per Secondrunt: Total runtimeclat: Completion latencylat: Total latencycpu: CPU utilizationIO depths: I/O queue depth distributionutil: Device utilization percentage
Understanding I/O Queue Depth
Queue depth refers to the number of I/O requests pending at any given time. Increasing queue depth can improve performance by keeping the storage device busy, but may increase latency. The optimal queue depth balances throughput and response time.
Linux systems allow you to view the default queue depth for storage devices:
lsscsi -l
Monitoring I/O Performance with iostat
The iostat command provides detailed insights into disk I/O performance:
iostat -xd 3
Key metrics from iostat include:
await: Average time for I/O requests (including queue time)svctm: Service time for I/O operations%util: Device utilization percentageavgqu-sz: Average queue lengthr/sandw/s: Read and write operations per secondrKB/sandwKB/s: Kilobytes read/written per second
For optimal performance, aim for low queue times and high utilization without excessive latency.