You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/disk-io-benchmark/_index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,10 @@ title: Microbenchmark storage performance with fio on Arm
3
3
4
4
minutes_to_complete: 30
5
5
6
-
who_is_this_for: This is an introductory topic for developers who want to optimize storage performance, reduce costs, identify bottlenecks, and evaluate storage options when migrating applications across platforms.
6
+
who_is_this_for: This is an introductory topic for developers looking to optimize storage performance, reduce costs, identify bottlenecks, and evaluate storage options when migrating applications across platforms.
7
7
8
8
learning_objectives:
9
-
- Describe how data flows through storage devices.
9
+
- Describe data flow through storage devices.
10
10
- Monitor storage performance using tools like iostat, iotop, and pidstat.
11
11
- Run fio to microbenchmark a block storage device.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/disk-io-benchmark/characterising-workload.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
-
title: Characterizing a workload
2
+
title: Analyzing I/O behavior with real workloads
3
3
weight: 3
4
4
5
5
### FIXED, DO NOT MODIFY
6
6
layout: learningpathall
7
7
---
8
8
9
-
## Basic attributes
9
+
## Workload attributes
10
10
11
11
The basic attributes of a given workload are the following:
12
12
@@ -16,13 +16,15 @@ The basic attributes of a given workload are the following:
16
16
- Read-to-write ratio.
17
17
- Random vs. sequential access.
18
18
19
-
While characteristics like latency are important, this section focuses on the high-level metrics listed above.
19
+
While latency is also an important factor, this section focuses on these high-level metrics to establish a foundational understanding.
20
20
21
21
## Run an example workload
22
22
23
23
Connect to an Arm-based server or cloud instance.
24
24
25
-
As an example workload, use the media manipulation tool, FFMPEG on an AWS `t4g.medium` instance. This is an Arm-based (AWS Graviton2) virtual machine with two vCPUs and 4 GiB of memory, designed for general-purpose workloads with a balance of compute, memory, and network resources.
25
+
As an example workload, use the media manipulation tool, FFMPEG on an AWS `t4g.medium` instance.
26
+
27
+
This is an Arm-based (AWS Graviton2) virtual machine with two vCPUs and 4 GiB of memory, designed for general-purpose workloads with a balance of compute, memory, and network resources.
Run the following command to begin transcoding the video and audio using the `H.264` and `aac` transcoders respectively. The `-flush_packets` flag forces FFMPEG to write each chunk of video data from memory to storage immediately, rather than buffering it in memory. This reduces the risk of data loss in case of a crash and allows disk write activity to be more observable during monitoring, making it easier to study write behavior in real-time.
44
+
Run the following command to begin transcoding the video and audio using the `H.264` and `aac` transcoders respectively. The `-flush_packets` flag forces FFMPEG to write each chunk of video data from memory to storage immediately, rather than buffering it in memory.
45
+
46
+
This reduces the risk of data loss in case of a crash and allows disk write activity to be more observable during monitoring, making it easier to study write behavior in real-time.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/disk-io-benchmark/introduction.md
+22-11Lines changed: 22 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,17 +10,27 @@ layout: learningpathall
10
10
11
11
Performance-sensitive application data - such as frequently-accessed configuration files, logs, or transactional state - should ideally reside in system memory (RAM) or CPU cache, where data access latency is measured in nanoseconds to microseconds. These are the fastest tiers in the memory hierarchy, enabling rapid read and write operations that reduce latency and improve throughput.
12
12
13
-
However, random-access memory (RAM) is volatile (data is lost on power down), limited in capacity, and more expensive per gigabyte than other storage types. Due to these constraints, most applications also rely on solid-state drives (SSDs) or hard disk drives (HDDs).
13
+
However, random-access memory (RAM) has the following constraints:
14
+
15
+
* It is volatile - data is lost on power down.
16
+
* It is limited in capacity.
17
+
* It is more expensive per gigabyte than other storage types.
18
+
19
+
For these reasons, most applications also rely on solid-state drives (SSDs) or hard disk drives (HDDs).
14
20
15
21
## High-level view of data flow
16
22
17
23
The diagram below shows a high-level view of how data moves to and from storage in a multi-disk I/O architecture. Each disk (Disk 1 to Disk N) has its own I/O queue and optional disk cache, communicating with a central CPU through a disk controller.
18
24
19
-
While memory is not shown, it plays a central role in providing fast temporary access between the CPU and persistent storage. Likewise, file systems (not depicted) run in the OS kernel and manage metadata, access permissions, and user-friendly file abstractions.
25
+
While memory is not shown, it plays a central role in providing fast temporary access between the CPU and persistent storage. Likewise, file systems (also not depicted) run in the OS kernel and manage metadata, access permissions, and user-friendly file abstractions.
20
26
21
-
This architecture enables parallelism in I/O operations, improves throughput, and supports scalability across multiple storage devices.
27
+
This architecture has the following benefits:
22
28
23
-

29
+
* It enables parallelism in I/O operations.
30
+
* It improves throughput.
31
+
* It supports scalability across multiple storage devices.
32
+
33
+

24
34
25
35
## Key Terms
26
36
@@ -33,9 +43,9 @@ This architecture enables parallelism in I/O operations, improves throughput, an
33
43
34
44
#### Input/Output Operations per Second (IOPS)
35
45
36
-
IOPS measures how many random read/write requests your storage system can perform per second. It depends on the block size or device type. For example, AWS does not show IOPS values for traditional HDD volumes.
46
+
IOPS measures how many random read/write requests your storage system can perform per second. It depends on the block size or device type. For example, AWS does not show IOPS values for traditional HDD volumes, as shown in the image below:
37
47
38
-

48
+

39
49
40
50
#### Throughput and bandwidth
41
51
@@ -49,14 +59,15 @@ You can calculate storage `throughput as IOPS × block size`.
49
59
50
60
*Queue depth* is the number of I/O operations a device can process concurrently. Consumer SSDs typically support a queue depth of 32–64, while enterprise-class NVMe drives can support hundreds to thousands of concurrent requests per queue. Higher queue depths allow more operations to be handled simultaneously, which can significantly boost throughput on high-performance drives — especially NVMe SSDs with advanced queuing capabilities.
51
61
52
-
#### I/O Engine
62
+
#### I/O engine
53
63
54
64
The I/O engine is the software layer in Linux that manages I/O requests between applications and storage. For example, the Linux kernel's block I/O scheduler queues and dispatches requests to device drivers, using multiple queues to optimize disk access. Benchmarking tools like `fio` let you choose different I/O engines:
55
65
56
-
*`sync`- synchronous I/O.
57
-
*`libaio` - Linux native asynchronous I/O.
58
-
*`io_uring` - a newer async I/O interface in newer Linux kernels.
66
+
*`sync` – Performs blocking I/O operations using standard system calls. Simple and portable, but less efficient under high concurrency.
67
+
*`libaio` – Uses Linux's native asynchronous I/O interface (`io_submit`/`io_getevents`) for non-blocking operations with lower overhead than `sync`.
68
+
*`io_uring` – A modern, high-performance async I/O API introduced in Linux 5.1. It minimizes syscalls and context switches, and supports advanced features like buffer selection and batched submissions.
69
+
59
70
60
-
#### I/O Wait
71
+
#### I/O wait
61
72
62
73
I/O wait is the time a CPU core spends waiting for I/O operations to complete. Tools like `pidstat`, `top`, and `iostat` can help identify storage-related CPU bottlenecks.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/disk-io-benchmark/using-fio.md
+22-9Lines changed: 22 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,28 +10,35 @@ layout: learningpathall
10
10
11
11
You can use the same `t4g.medium` instance from the previous section with two different types of SSD-based block storage devices as shown in the console screenshot below.
12
12
13
+
### Attach and Identify Block Devices
13
14
To add the required EBS volumes to your EC2 instance:
14
15
15
16
1. In the AWS Console, navigate to **EC2** > **Volumes** > **Create Volume**.
17
+
16
18
2. Create a volume with the following settings:
17
19
- Volume Type: io2 (Provisioned IOPS SSD).
18
20
- Size: 8 GiB.
19
21
- IOPS: 400.
20
22
- Availability Zone: The same as your EC2 instance
23
+
21
24
3. Create another volume with the following settings:
22
25
- Volume Type: gp2 (General Purpose SSD).
23
26
- Size: 8 GiB.
24
27
- Availability Zone: The same as your EC2 instance.
25
-
4. Once created, select each volume and choose **Actions** > **Attach Volume**
26
-
5. Select your t4g.medium instance from the dropdown and attach each volume
28
+
29
+
4. Once created, select each volume and choose **Actions** > **Attach Volume**.
30
+
31
+
5. Select your t4g.medium instance from the dropdown and attach each volume.
27
32
28
33
Both block devices have the same 8 GiB capacity, but the `io2` is optimized for throughput, while `gp2` is general-purpose.
In this section, you’ll measure real-world performance to help guide your storage selection.
33
38
34
-
Flexible I/O (fio) is a command-line tool to generate a synthetic workload with specific I/O characteristics. This serves as a simpler alternative to full record and replay testing. Fio is available through most Linux distribution packages, please refer to the [documentation](https://github.com/axboe/fio) for package availability.
39
+
Flexible I/O (fio) is a command-line tool to generate a synthetic workload with specific I/O characteristics. This serves as a simpler alternative to full record and replay testing.
40
+
41
+
Fio is available through most Linux distribution packages, see the [documentation](https://github.com/axboe/fio) for package availability.
35
42
36
43
```bash
37
44
sudo apt update
@@ -50,7 +57,7 @@ The version is printed:
50
57
fio-3.37
51
58
```
52
59
53
-
## Locate device
60
+
## Identify Device Names for Benchmarking
54
61
55
62
Fio allows you to microbenchmark either the block device or a mounted filesystem. Use the disk free, `df` command to confirm your EBS volumes are not mounted. Writing to drives containing critical data can result in data loss. In this tutorial, you're writing to blank, unmounted block devices.
56
63
@@ -76,15 +83,18 @@ If you have more than one block volume attached to an instance, the `sudo nvme l
76
83
77
84
## Generating a synthetic workload
78
85
79
-
Suppose you want to simulate a fictional logging application with the following characteristics observed using the tools from the previous section.
86
+
Let’s define a synthetic workload that mimics the behavior of a logging application, using metrics observed earlier.
80
87
81
88
{{% notice Workload%}}
82
89
This workload involves light, sequential reads and writes. The system write throughput per thread is 5 MB/s with 83% writes. There are infrequent bursts of reads for approximately 5 seconds, operating at up to 16MB/s per thread. The workload can scale the infrequent reads and writes to use up to 16 threads each. The block size for the writes and reads are 64KiB and 256KiB respectively (as opposed to the standard 4KiB Page size).
83
90
84
91
Further, the application is latency sensitive and given it holds critical information, needs to write directly to non-volatile storage through direct IO.
85
92
{{% /notice %}}
86
93
87
-
The fio tool uses simple configuration `jobfiles` to describe the characteristics of your synthetic workload. Parameters under the `[global]` option are shared among jobs. From the example below, you can create 2 jobs to represent the steady write and infrequent reads. Please refer to the official [documentation](https://fio.readthedocs.io/en/latest/fio_doc.html#job-file-format) for more details.
94
+
The fio tool uses simple configuration files - called `jobfiles` - to describe the characteristics of your synthetic workload. Parameters under the `[global]` option are shared among jobs. From the example below, you can create 2 jobs to represent the steady write and infrequent reads. Please refer to the official [documentation](https://fio.readthedocs.io/en/latest/fio_doc.html#job-file-format) for more details.
95
+
96
+
### Create fio Job Files
97
+
88
98
89
99
Create two job files, one for each device, by copying the configuration below and adjusting the filename parameter (`/dev/nvme1n1` or `/dev/nvme2n1`):
90
100
@@ -111,17 +121,20 @@ bs=64k ; Block size of 64KiB (default block size of 4 KiB)
111
121
name=burst_read
112
122
rw=read
113
123
bs=256k ; Block size of 256KiB for reads (default is 4KiB)
114
-
startdelay=25 ; simulate infrequent reads (5 seconds out 30)
124
+
startdelay=25 ; simulate a 5-second read burst at the end of a 30-second window
115
125
runtime=5
116
126
; -- end job file including.fio --
117
127
```
128
+
## Run the Benchmarks
118
129
119
130
120
131
{{% notice Note %}}
121
132
Running fio directly on block devices requires root privileges (hence the use of `sudo`). Be careful: writing to the wrong device can result in data loss. Always ensure you are targeting a blank, unmounted device.
122
133
{{% /notice %}}
123
134
124
-
Run the following commands to run each test back to back.
135
+
136
+
137
+
Run the following commands to execute each test sequentially:
0 commit comments