How To Measure Disk Performance IOPS With Fio in Linux

How To Measure Disk Performance IOPS With Fio in Linux

The Fio is one of the best disk performance and benchmarking utility for Linux. The Fio is a free and open source.

IOPS (Input/Output Operations Per Second) is a common performance measurement used to benchmark computer storage devices like hard disk drives (HDD), solid state drives (SSD), and storage area networks (SAN).

Install Fio on Ubuntu:

$ sudo apt-get install fio



Install Fio on CentOS 7:

$ sudo yum install epel-release
$ sudo yum install fio

Measuring random IOPS with FIO Examples

Random read/write performance:

fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75

This command will create a 4 GB file, and perform 4KB reads and writes using a 75%/25%, with 64 operations running at a time. The 3:1 ratio is a rough approximation of your typical database.

Here is output example:

Random read write IOPS

My disk performance: 10889 read operations per second (IOPS) and 3630 write operations per second.

Random read performance:

To measure random read IOPS use command:

fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randread

Random read performance example output:

random read performance

Random write performance:

To perform randwrite instead of randread:

fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randwrite

Do not forget delete test files, because Fio creates temporary files for disk performance measurement.

Measuring latency with IOPing

To measure your disks I/O latency you can use IOPing tool.

Install IOPing on Ubuntu:

$ sudo apt-get install ioping

Install IOPing on CentOS 7:

$ sudo yum install epel-release
$ sudo yum install ioping

IOPing ussage example:

$ ioping .

To stop after 10 count, use the -c option:

$ ioping -c 10 .

Here is example output :

IOPing latency result

The average was 200 us. On a healthy system you should see low variation and an average below 1.0 ms.

Discuss article in ArsTech Forum

Read also: List of Best HDD’s for NAS

If you like what you are reading, please:

Buy me a coffeeBuy me a coffee

arstech

Leave a Reply