top of page
Writer's pictureSiddhesh Kadam

Analyzing Disk I/O Performance with IOPING

ioping is a Linux utility that allows you to measure I/O latency of a storage device or file system. It's a simple tool but can be quite useful for assessing the performance of your disk subsystem. Here's a basic overview of using ioping:


Installation:

You can typically install ioping using your system's package manager. For example, on a Debian-based system:

[root@siddhesh ~]# apt-get install ioping

On Centos/Red Hat-based systems:

[root@siddhesh ~]# yum install ioping

Usage:

Once installed, you can use ioping to measure disk I/O latency. Here are a few examples:


1. I/O latency of a specific file or directory:

Below command will perform 10 I/O operations (by default, 10 I/O operations are performed) and display the average I/O time.

[root@siddhesh ~]# ioping -c 10 /tmp/
4 KiB <<< /tmp/ (xfs /dev/nvme0n1p1): request=1 time=778.7 us (warmup)
4 KiB <<< /tmp/ (xfs /dev/nvme0n1p1): request=2 time=468.7 us
4 KiB <<< /tmp/ (xfs /dev/nvme0n1p1): request=3 time=611.0 us
4 KiB <<< /tmp/ (xfs /dev/nvme0n1p1): request=4 time=722.3 us
4 KiB <<< /tmp/ (xfs /dev/nvme0n1p1): request=5 time=349.1 us
4 KiB <<< /tmp/ (xfs /dev/nvme0n1p1): request=6 time=573.0 us
4 KiB <<< /tmp/ (xfs /dev/nvme0n1p1): request=7 time=602.9 us
4 KiB <<< /tmp/ (xfs /dev/nvme0n1p1): request=8 time=526.7 us
4 KiB <<< /tmp/ (xfs /dev/nvme0n1p1): request=9 time=823.9 us (slow)
4 KiB <<< /tmp/ (xfs /dev/nvme0n1p1): request=10 time=600.7 us

--- /tmp/ (xfs /dev/nvme0n1p1) ioping statistics ---
9 requests completed in 5.28 ms, 36 KiB read, 1.71 k iops, 6.66 MiB/s
generated 10 requests in 9.00 s, 40 KiB, 1 iops, 4.44 KiB/s
min/avg/max/mdev = 349.1 us / 586.5 us / 823.9 us / 129.0 us
[root@siddhesh ~]#

Where,

9 requests completed in 5.28 ms, 36 KiB read, 1.71 k IOPS, 6.66 MiB/s: Provides summary statistics for the completed requests.

9 requests completed: The number of I/O requests successfully completed.

5.28 ms: The total time taken for these requests to complete.

36 KiB read: The total amount of data read.

1.71 k IOPS: Input/Output Operations Per Second.

6.66 MiB/s: The data transfer rate in megabytes per second.


2. I/O latency of the root filesystem:


The below command measures I/O latency on the root filesystem.

[root@siddhesh ~]# ioping -c 5 /
4 KiB <<< / (xfs /dev/nvme0n1p1): request=1 time=334.4 us (warmup)
4 KiB <<< / (xfs /dev/nvme0n1p1): request=2 time=690.5 us
4 KiB <<< / (xfs /dev/nvme0n1p1): request=3 time=711.0 us
4 KiB <<< / (xfs /dev/nvme0n1p1): request=4 time=346.6 us
4 KiB <<< / (xfs /dev/nvme0n1p1): request=5 time=357.4 us

--- / (xfs /dev/nvme0n1p1) ioping statistics ---
4 requests completed in 2.11 ms, 16 KiB read, 1.90 k iops, 7.42 MiB/s
generated 5 requests in 4.00 s, 20 KiB, 1 iops, 5.00 KiB/s
min/avg/max/mdev = 346.6 us / 526.4 us / 711.0 us / 174.6 us
[root@siddhesh ~]#

3. I/O latency in a continuous mode:


This command runs ioping in continuous mode, updating the results every second. This helps in measuring disk seek rate.

[root@siddhesh ~]# ioping -R /

--- / (xfs /dev/nvme0n1p1) ioping statistics ---
6.07 k requests completed in 2.97 s, 23.7 MiB read, 2.04 k iops, 7.97 MiB/s
generated 6.07 k requests in 3.00 s, 23.7 MiB, 2.02 k iops, 7.90 MiB/s
min/avg/max/mdev = 176.3 us / 490.1 us / 4.49 ms / 217.8 us
[root@siddhesh ~]#

In summary, this output gives you a detailed breakdown of the timing and performance characteristics of I/O operations on the root directory ("/") and its associated file system (xfs on /dev/nvme0n1p1).


4. Measure latency on /tmp using 10 requests of 1 megabyte each.

[root@siddhesh ~]# ioping -c 5 -s 1M /tmp
1 MiB <<< /tmp (xfs /dev/nvme0n1p1): request=1 time=5.23 ms (warmup)
1 MiB <<< /tmp (xfs /dev/nvme0n1p1): request=2 time=4.82 ms
1 MiB <<< /tmp (xfs /dev/nvme0n1p1): request=3 time=4.09 ms
1 MiB <<< /tmp (xfs /dev/nvme0n1p1): request=4 time=5.11 ms
1 MiB <<< /tmp (xfs /dev/nvme0n1p1): request=5 time=4.24 ms

--- /tmp (xfs /dev/nvme0n1p1) ioping statistics ---
4 requests completed in 18.3 ms, 4 MiB read, 218 iops, 219.0 MiB/s
generated 5 requests in 4.00 s, 5 MiB, 1 iops, 1.25 MiB/s
min/avg/max/mdev = 4.09 ms / 4.57 ms / 5.11 ms / 416.0 us
[root@siddhesh ~]#

Where,

-c 5: Specifies the number of I/O requests to be generated. In this case, it's set to 5, meaning that the command will generate and measure the performance of 5 I/O requests.


-s 1M: Specifies the size of each I/O request. In this case, each request will be 1 megabyte in size.


/tmp: Specifies the target location for the I/O requests. The command is measuring the performance of I/O operations on the /tmp directory

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page