IO Measurement: Difference between revisions

From VoIPmonitor.org
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
== Installation of the tools ==
{{DISPLAYTITLE:Benchmarking Disk I/O Performance}}


Debian/Ubuntu:
'''This guide explains how to use standard Linux tools to benchmark and measure the performance of your server's storage subsystem. Understanding your disk's I/O capabilities is critical for ensuring a stable, high-performance VoIPmonitor installation, especially when recording calls.'''


apt-get install fio ioping
== Why Disk Performance Matters ==
A VoIPmonitor sensor that records call audio (PCAP files) can generate a very high number of small, random write operations. If your storage cannot keep up, you may experience:
*Packet loss, as memory buffers on the sensor fill up.
*Incomplete or corrupted call recordings.
*General system instability.


Centos/RHEL:
The two most important metrics to measure are:
*'''IOPS (Input/Output Operations Per Second):''' The number of read or write operations a disk can perform per second. This is crucial for handling many concurrent calls.
*'''Latency:''' The time it takes for a single I/O operation to complete. Low latency is essential for a responsive system.


yum install epel-release
The tools `ioping` and `fio` can help you benchmark these metrics.
yum install fio ioping


== Usage ==
== Step 1: Install the Benchmarking Tools ==
First, install `ioping` and `fio` using your distribution's package manager.


====ioping====
;For Debian / Ubuntu:
<pre>sudo apt-get update
sudo apt-get install fio ioping</pre>


ioping -c 20 .
;For CentOS / RHEL / AlmaLinux:
4 KiB <<< . (xfs /dev/sda2): request=1 time=426.1 us (warmup)
<pre>sudo yum install epel-release
4 KiB <<< . (xfs /dev/sda2): request=2 time=1.06 ms
sudo yum install fio ioping</pre>
4 KiB <<< . (xfs /dev/sda2): request=3 time=1.05 ms
4 KiB <<< . (xfs /dev/sda2): request=4 time=1.06 ms
4 KiB <<< . (xfs /dev/sda2): request=5 time=1.06 ms
4 KiB <<< . (xfs /dev/sda2): request=6 time=1.07 ms
4 KiB <<< . (xfs /dev/sda2): request=7 time=147.7 us (fast)
4 KiB <<< . (xfs /dev/sda2): request=8 time=1.08 ms (slow)
4 KiB <<< . (xfs /dev/sda2): request=9 time=1.08 ms (slow)
4 KiB <<< . (xfs /dev/sda2): request=10 time=1.10 ms (slow)


For more options see
== Tool 1: `ioping` - Quick Latency Check ==
man ioping
`ioping` is a simple tool that works like the `ping` command, but for disk latency instead of network latency. It's an excellent way to get a quick feel for how responsive your storage is.


====fio====
=== Usage ===
Run the command from within the directory you want to test (e.g., your VoIPmonitor spool directory). This example sends 10 requests.
<pre>
# Navigate to the directory you want to test
cd /var/spool/voipmonitor


R/W:
# Run ioping
ioping -c 10 .
</pre>


fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75
=== Interpreting the Results ===
fio-2.16
<pre>
Starting 1 process
4 KiB <<< . (ext4 /dev/sda2): request=1 time=426.1 us
test: Laying out IO file(s) (1 file(s) / 4096MB)
4 KiB <<< . (ext4 /dev/sda2): request=2 time=1.06 ms
Jobs: 1 (f=1): [m(1)] [97.4% done] [93264KB/31068KB/0KB /s] [23.4K/7767/0 iops] [eta 00m:01s]
...
test: (groupid=0, jobs=1): err= 0: pid=20731: Thu Apr  4 11:37:35 2019
4 KiB <<< . (ext4 /dev/sda2): request=10 time=1.10 ms
  read : io=3070.4MB, bw=83364KB/s, iops=20840, runt= 37714msec
  write: io=1025.8MB, bw=27850KB/s, iops=6962, runt= 37714msec
  cpu          : usr=2.71%, sys=8.06%, ctx=207268, majf=0, minf=7
  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    : total=r=785996/w=262580/d=0, short=r=0/w=0/d=0, drop=r=0/w=0/d=0
      latency  : target=0, window=0, percentile=100.00%, depth=64
Run status group 0 (all jobs):
    READ: io=3070.4MB, aggrb=83363KB/s, minb=83363KB/s, maxb=83363KB/s, mint=37714msec, maxt=37714msec
  WRITE: io=1025.8MB, aggrb=27849KB/s, minb=27849KB/s, maxb=27849KB/s, mint=37714msec, maxt=37714msec
Disk stats (read/write):
  sda: ios=781939/261286, merge=0/1, ticks=1141589/30342, in_queue=1173273, util=99.93%


Random read:
--- . (ext4 /dev/sda2) ioping statistics ---
9 requests completed in 8.52 s, 1 iops, 4.2 KiB/s
min/avg/max/mdev = 147.7 us / 946.7 us / 1.10 ms / 284.4 us
</pre>
*'''Key Metric:''' Look at the `time=` value for each request and the final `min/avg/max` statistics.
*'''What to Look For:''' For SSDs or NVMe drives, average latency should be well under 1 millisecond (`< 1.00 ms`). For spinning disks (HDDs), latencies of a few milliseconds are more typical. Consistently high latency spikes indicate a potential problem.


fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randread
== Tool 2: `fio` - Comprehensive Throughput & IOPS Test ==
fio-2.16
`fio` (Flexible I/O Tester) is the industry-standard tool for advanced storage benchmarking. It can simulate various types of workloads, including the mixed read/write patterns typical of a VoIPmonitor sensor.
Starting 1 process
test: Laying out IO file(s) (1 file(s) / 4096MB)
Jobs: 1 (f=1): [r(1)] [97.8% done] [113.1MB/0KB/0KB /s] [29.2K/0/0 iops] [eta 00m:01s]
test: (groupid=0, jobs=1): err= 0: pid=20999: Thu Apr  4 11:41:20 2019
  read : io=4096.0MB, bw=93818KB/s, iops=23454, runt= 44707msec
  cpu          : usr=1.76%, sys=5.82%, ctx=202402, majf=0, minf=73
  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    : total=r=1048576/w=0/d=0, short=r=0/w=0/d=0, drop=r=0/w=0/d=0
      latency  : target=0, window=0, percentile=100.00%, depth=64
Run status group 0 (all jobs):
    READ: io=4096.0MB, aggrb=93817KB/s, minb=93817KB/s, maxb=93817KB/s, mint=44707msec, maxt=44707msec
Disk stats (read/write):
  sda: ios=1046707/6, merge=0/1, ticks=1400096/8, in_queue=1401300, util=100.00%


For more options see
'''Warning:''' `fio` will create a large test file in the directory where you run it. Always run it in a directory with sufficient free space, and remember to delete the test file afterward.
man fio


Don't forgot to delete test file (--filename=test).
=== Example 1: Mixed Read/Write Test ===
This command simulates a workload that is 75% reads and 25% writes, which is a realistic scenario for a server running both the sensor and the GUI.
<pre>
# This command creates a 4GB test file named 'test'
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75
</pre>
 
=== Example 2: 100% Random Read Test ===
This command tests pure random read performance, which is important for GUI responsiveness when loading historical data.
<pre>
# This also creates a 4GB test file named 'test'
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randread
</pre>
 
=== Interpreting the Results ===
The output from `fio` is very detailed, but you should focus on these key lines:
<pre>
Run status group 0 (all jobs):
  READ: io=3070.4MB, aggrb=83363KB/s, minb=83363KB/s, maxb=83363KB/s, mint=37714msec, maxt=37714msec
  WRITE: io=1025.8MB, aggrb=27849KB/s, minb=27849KB/s, maxb=27849KB/s, mint=37714msec, maxt=37714msec
...
  read : io=3070.4MB, bw=83364KB/s, iops=20840, runt= 37714msec
  write: io=1025.8MB, bw=27850KB/s, iops=6962, runt= 37714msec
...
Disk stats (read/write):
  sda: ios=781939/261286 ... util=99.93%
</pre>
*'''Key Metrics:'''
    * `iops`: This is the most important number. It tells you how many read and write operations per second your storage handled. For VoIPmonitor, random write IOPS are particularly critical. A modern SSD should deliver tens of thousands of IOPS.
    * `bw` (or `aggrb`): This is the throughput or bandwidth in KB/s or MB/s. It shows how much data per second was moved.
*'''What to Look For:''' The `util` (utilization) metric should be close to 100%. If it is, it means `fio` successfully pushed your storage to its maximum limit, and the resulting `iops` and `bw` numbers are a true representation of its peak performance.
 
=== Final Step: Clean Up ===
After you are finished with your tests, remember to delete the large file created by `fio`.
<pre>rm test</pre>
 
== AI Summary for RAG ==
'''Summary:''' This guide explains how to benchmark disk I/O performance on a VoIPmonitor server using the standard Linux tools `ioping` and `fio`. It begins by clarifying why disk performance, particularly IOPS and latency, is critical for stable call recording. The guide provides step-by-step instructions for installing these tools on both Debian/Ubuntu and CentOS/RHEL systems. It then details the use of `ioping` as a simple tool for quick disk latency checks. The main part of the article focuses on `fio`, the flexible I/O tester, providing and explaining command-line examples for both a mixed read/write workload and a pure random read test. Crucially, it includes an "Interpreting the Results" section that instructs the user on which specific metrics to focus on in the `fio` output, such as `iops` (I/O Operations Per Second) and `bw` (bandwidth), and how to verify that the disk was pushed to its maximum (`util=100%`). The guide concludes with the important final step of deleting the test file created by `fio`.
'''Keywords:''' performance, benchmark, disk, storage, i/o, iops, latency, throughput, bandwidth, fio, ioping, test, randrw, randread, `ioengine=libaio`, `direct=1`
'''Key Questions:'''
* How can I test the disk speed of my server?
* What are `fio` and `ioping`?
* How do I benchmark my storage for VoIPmonitor?
* What do the `iops` and `bw` metrics in the `fio` output mean?
* How can I check my disk latency from the command line?
* What is a good number of IOPS for a VoIPmonitor server?
* How to run a mixed random read/write test with `fio`?

Latest revision as of 23:30, 30 June 2025


This guide explains how to use standard Linux tools to benchmark and measure the performance of your server's storage subsystem. Understanding your disk's I/O capabilities is critical for ensuring a stable, high-performance VoIPmonitor installation, especially when recording calls.

Why Disk Performance Matters

A VoIPmonitor sensor that records call audio (PCAP files) can generate a very high number of small, random write operations. If your storage cannot keep up, you may experience:

  • Packet loss, as memory buffers on the sensor fill up.
  • Incomplete or corrupted call recordings.
  • General system instability.

The two most important metrics to measure are:

  • IOPS (Input/Output Operations Per Second): The number of read or write operations a disk can perform per second. This is crucial for handling many concurrent calls.
  • Latency: The time it takes for a single I/O operation to complete. Low latency is essential for a responsive system.

The tools `ioping` and `fio` can help you benchmark these metrics.

Step 1: Install the Benchmarking Tools

First, install `ioping` and `fio` using your distribution's package manager.

For Debian / Ubuntu
sudo apt-get update
sudo apt-get install fio ioping
For CentOS / RHEL / AlmaLinux
sudo yum install epel-release
sudo yum install fio ioping

Tool 1: `ioping` - Quick Latency Check

`ioping` is a simple tool that works like the `ping` command, but for disk latency instead of network latency. It's an excellent way to get a quick feel for how responsive your storage is.

Usage

Run the command from within the directory you want to test (e.g., your VoIPmonitor spool directory). This example sends 10 requests.

# Navigate to the directory you want to test
cd /var/spool/voipmonitor

# Run ioping
ioping -c 10 .

Interpreting the Results

4 KiB <<< . (ext4 /dev/sda2): request=1 time=426.1 us
4 KiB <<< . (ext4 /dev/sda2): request=2 time=1.06 ms
...
4 KiB <<< . (ext4 /dev/sda2): request=10 time=1.10 ms

--- . (ext4 /dev/sda2) ioping statistics ---
9 requests completed in 8.52 s, 1 iops, 4.2 KiB/s
min/avg/max/mdev = 147.7 us / 946.7 us / 1.10 ms / 284.4 us
  • Key Metric: Look at the `time=` value for each request and the final `min/avg/max` statistics.
  • What to Look For: For SSDs or NVMe drives, average latency should be well under 1 millisecond (`< 1.00 ms`). For spinning disks (HDDs), latencies of a few milliseconds are more typical. Consistently high latency spikes indicate a potential problem.

Tool 2: `fio` - Comprehensive Throughput & IOPS Test

`fio` (Flexible I/O Tester) is the industry-standard tool for advanced storage benchmarking. It can simulate various types of workloads, including the mixed read/write patterns typical of a VoIPmonitor sensor.

Warning: `fio` will create a large test file in the directory where you run it. Always run it in a directory with sufficient free space, and remember to delete the test file afterward.

Example 1: Mixed Read/Write Test

This command simulates a workload that is 75% reads and 25% writes, which is a realistic scenario for a server running both the sensor and the GUI.

# This command creates a 4GB test file named 'test'
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75

Example 2: 100% Random Read Test

This command tests pure random read performance, which is important for GUI responsiveness when loading historical data.

# This also creates a 4GB test file named 'test'
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randread

Interpreting the Results

The output from `fio` is very detailed, but you should focus on these key lines:

Run status group 0 (all jobs):
   READ: io=3070.4MB, aggrb=83363KB/s, minb=83363KB/s, maxb=83363KB/s, mint=37714msec, maxt=37714msec
  WRITE: io=1025.8MB, aggrb=27849KB/s, minb=27849KB/s, maxb=27849KB/s, mint=37714msec, maxt=37714msec
...
  read : io=3070.4MB, bw=83364KB/s, iops=20840, runt= 37714msec
  write: io=1025.8MB, bw=27850KB/s, iops=6962, runt= 37714msec
...
Disk stats (read/write):
  sda: ios=781939/261286 ... util=99.93%
  • Key Metrics:
   * `iops`: This is the most important number. It tells you how many read and write operations per second your storage handled. For VoIPmonitor, random write IOPS are particularly critical. A modern SSD should deliver tens of thousands of IOPS.
   * `bw` (or `aggrb`): This is the throughput or bandwidth in KB/s or MB/s. It shows how much data per second was moved.
  • What to Look For: The `util` (utilization) metric should be close to 100%. If it is, it means `fio` successfully pushed your storage to its maximum limit, and the resulting `iops` and `bw` numbers are a true representation of its peak performance.

Final Step: Clean Up

After you are finished with your tests, remember to delete the large file created by `fio`.

rm test

AI Summary for RAG

Summary: This guide explains how to benchmark disk I/O performance on a VoIPmonitor server using the standard Linux tools `ioping` and `fio`. It begins by clarifying why disk performance, particularly IOPS and latency, is critical for stable call recording. The guide provides step-by-step instructions for installing these tools on both Debian/Ubuntu and CentOS/RHEL systems. It then details the use of `ioping` as a simple tool for quick disk latency checks. The main part of the article focuses on `fio`, the flexible I/O tester, providing and explaining command-line examples for both a mixed read/write workload and a pure random read test. Crucially, it includes an "Interpreting the Results" section that instructs the user on which specific metrics to focus on in the `fio` output, such as `iops` (I/O Operations Per Second) and `bw` (bandwidth), and how to verify that the disk was pushed to its maximum (`util=100%`). The guide concludes with the important final step of deleting the test file created by `fio`. Keywords: performance, benchmark, disk, storage, i/o, iops, latency, throughput, bandwidth, fio, ioping, test, randrw, randread, `ioengine=libaio`, `direct=1` Key Questions:

  • How can I test the disk speed of my server?
  • What are `fio` and `ioping`?
  • How do I benchmark my storage for VoIPmonitor?
  • What do the `iops` and `bw` metrics in the `fio` output mean?
  • How can I check my disk latency from the command line?
  • What is a good number of IOPS for a VoIPmonitor server?
  • How to run a mixed random read/write test with `fio`?