Disk benchmarking is the process of running software that accurately measures transfer speeds under various disk access scenarios (sequential, random 4K, deep queue depth, etc.). The aim is to produce figures in MBps that summarize the speed characteristics of a disk.
There are a plenty of software options available for CentOS 7, which you can easily install and run to to benchmark your server drives.
We assume that there are two kind of parameters that give a complete overview in disk benchmarking:
- IOPS (I/O Per Second)
In this article we will explain how to measure IOPS with fio, and disk latency with IOPing on a basic RHEL 7 system.
Let’s install FIO:
# yum install fio
If nothing happens, you should link a repo:
# wget https://mirrors.n-ix.net/fedora-epel/epel-release-latest-7.noarch.rpm # yum localinstall epel-release-latest-7.noarch.rpm
Request FIO to test with following command and parameters:
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=random_read_write.fio --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75 test: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=64 fio-3.1
The server will start creating 4Gb file and do read/write procedures. When testing will be done, check the report. In our case we have the following results:
test: Laying out IO file (1 file / 4096MiB) Jobs: 1 (f=1): [m(1)][100.0%][r=83.6MiB/s,w=27.8MiB/s][r=21.4k,w=7118 IOPS][eta 00m:00s] test: (groupid=0, jobs=1): err= 0: pid=16663: Thu Apr 04 23:43:45 2019 read: IOPS=20.7k, BW=80.9MiB/s (84.9MB/s)(3070MiB/37931msec) bw ( KiB/s): min=27808, max=88088, per=100.00%, avg=83084.92, stdev=10290.14, samples=75 iops : min= 6952, max=22022, avg=20770.96, stdev=2572.53, samples=75 write: IOPS=6924, BW=27.0MiB/s (28.4MB/s)(1026MiB/37931msec) bw ( KiB/s): min= 9248, max=29819, per=100.00%, avg=27762.60, stdev=3403.83, samples=75 iops : min= 2312, max= 7454, avg=6940.33, stdev=850.90, samples=75 cpu : usr=16.08%, sys=80.31%, ctx=2573, majf=0, minf=22 IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0% submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0% issued rwt: total=785920,262656,0, short=0,0,0, dropped=0,0,0 latency : target=0, window=0, percentile=100.00%, depth=64 Run status group 0 (all jobs): READ: bw=80.9MiB/s (84.9MB/s), 80.9MiB/s-80.9MiB/s (84.9MB/s-84.9MB/s), io=3070MiB (3219MB), run=37931-37931msec WRITE: bw=27.0MiB/s (28.4MB/s), 27.0MiB/s-27.0MiB/s (28.4MB/s-28.4MB/s), io=1026MiB (1076MB), run=37931-37931msec Disk stats (read/write): md126: ios=784396/262219, merge=0/0, ticks=0/0, in_queue=0, util=0.00%, aggrios=392960/262739, aggrmerge=0/27, aggrticks=121303/62780, aggrin_queue=183628, aggrutil=98.81% sda: ios=417381/262739, merge=0/27, ticks=126959/28128, in_queue=154557, util=96.55% sdb: ios=368539/262739, merge=0/27, ticks=115648/97433, in_queue=212700, util=98.81%
After checking IOPS we will have to calculate latency rates. To run a latency checker install IOPing to the server:
# yum install ioping
Now execute the IOPing with option ‘-c 100’:
# ioping -c 100 .
* The [-c 100] option is the number request ioping will make
The output will show you results. Closing line in terminal is showing the latency rates of the server disk.
Finally in this articles we installed and checked 2 useful tools which can give information and performance of server disks (speed and latencies).