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
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,22 @@
1
1
---
2
-
title: Microbenchmark Storage Performance with Fio
2
+
title: Microbenchmark Storage Performance with fio
3
3
4
4
draft: true
5
5
cascade:
6
6
draft: true
7
7
8
8
minutes_to_complete: 30
9
9
10
-
who_is_this_for: A cloud developer who wants to optimize storage cost or performance of their application. Developers who want to uncover potential storage-bound bottlenecks or changes when migrating an application to a different platform.
10
+
who_is_this_for: This is an introductory topic for developers seeking to optimize storage costs and performance, identify bottlenecks, and navigate storage considerations during application migration across platforms.
11
11
12
12
learning_objectives:
13
-
- Understand the flow of data for storage devices
14
-
- Use basic observability utilities such as iostat, iotop and pidstat
15
-
- Understand how to run fio for microbenchmarking a block storage device
13
+
- Understand the flow of data for storage devices.
14
+
- Use basic observability utilities such as iostat, iotop and pidstat.
15
+
- Understand how to run fio for microbenchmarking a block storage device.
16
16
17
17
prerequisites:
18
-
- Access to an Arm-based server
19
-
- Basic understanding of Linux
18
+
- An [Arm based instance](/learning-paths/servers-and-cloud-computing/csp/) from a cloud service provider or an Arm Linux server.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/disk-io-benchmark/characterising-workload.md
+27-25Lines changed: 27 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Characterising a Workload
2
+
title: Characterizing a workload
3
3
weight: 3
4
4
5
5
### FIXED, DO NOT MODIFY
@@ -16,42 +16,44 @@ 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
-
There are many more characteristics to observe, just as latency but since this is an introductory topic we will mostly stick to the high-level metrics listed above.
19
+
There are many more characteristics to observe, such as latency, but since this is an introductory topic you will mostly stick to the high-level metrics listed above.
20
20
21
-
## Running an Example Workload
21
+
## Run an Example Workload
22
22
23
-
Connect to an Arm-based cloud instance. As an example workload, we will be using the media manipulation tool, FFMPEG on an AWS `t4g.medium` instance.
23
+
Connect to an Arm-based server or cloud instance.
24
24
25
-
First install the prequistite tools.
25
+
As an example workload, you can use the media manipulation tool, FFMPEG, on an AWS `t4g.medium` instance. The `t4g.medium` is an Arm-based (AWS Graviton2) virtual machine with 2 vCPUs, 4 GiB of memory, and is designed for general-purpose workloads with a balance of compute, memory, and network resources.
26
+
27
+
First, install the required tools.
26
28
27
29
```bash
28
30
sudo apt update
29
31
sudo apt install ffmpeg iotop -y
30
32
```
31
33
32
-
Download the popular reference video for transcoding, `BigBuckBunny.mp4` which is available under the [Creative Commons 3.0 License](https://creativecommons.org/licenses/by/3.0/).
34
+
Download the popular reference video for transcoding, `BigBuckBunny.mp4`, which is available under the [Creative Commons 3.0 License](https://creativecommons.org/licenses/by/3.0/).
Run the following command to begin transcoding the video and audio using the `H.264` and `aac` transcoders respectively. We use the `-flush_packets` flag to write each chunk of video back to storage from memory.
42
+
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 you to observe more frequent disk writes during the transcoding process.
Whilst the transcoding is running, we can use the `pidstat` command to see the disk statistics of that specific process.
50
+
While the transcoding is running, you can use the `pidstat` command to see the disk statistics of that specific process.
50
51
51
52
```bash
52
53
pidstat -d -p $(pgrep ffmpeg) 1
53
54
```
54
-
Since this example `151MB` video fits within memory, we observe no `kB_rd/s` for the storage device after the initial read. However, since we are flushing to storage we observe period ~275 `kB_wr/s`.
55
+
56
+
Since this example video (151 MB) fits within memory, you observe no `kB_rd/s` for the storage device after the initial read. However, because you are flushing to storage, you observe periodic writes of approximately 275 `kB_wr/s`.
55
57
56
58
```output
57
59
Linux 6.8.0-1024-aws (ip-10-248-213-118) 04/15/25 _aarch64_ (2 CPU)
@@ -67,11 +69,11 @@ Linux 6.8.0-1024-aws (ip-10-248-213-118) 04/15/25 _aarch64_
67
69
10:01:32 1000 24250 0.00 344.00 0.00 0 ffmpeg
68
70
```
69
71
70
-
{{% notice Please Note%}}
71
-
In this simple example, since we are interacting with a file on the mounted filesystem, we are also observing the behaviour of the filesystem.
72
+
{{% notice Note%}}
73
+
In this simple example, since you are interacting with a file on the mounted filesystem, you are also observing the behavior of the filesystem.
72
74
{{% /notice %}}
73
75
74
-
Of course, there may be other processes or background services that are writing to this disk. We can use `iotop` command for inspection. As per the output below, the `ffmpeg` process has the greatest disk utilisation.
76
+
There may be other processes or background services that are writing to this disk. You can use the `iotop` command for inspection. As shown in the output below, the `ffmpeg` process has the highest disk utilization.
75
77
76
78
```bash
77
79
sudo iotop
@@ -86,33 +88,34 @@ Current DISK READ: 0.00 B/s | Current DISK WRITE: 0.00 B/s
86
88
2 be/4 root 0.00 B/s 0.00 B/s [kthreadd]
87
89
```
88
90
89
-
Using the input, output statistics command (`iostat`) we can observe the system-wide metrics from the `nvme0n1` drive. Please Note that we are using a snapshot of this workload, more accurate characteristics can be obtained by measuring the distribution of a workload.
91
+
Using the input/output statistics command (`iostat`), you can observe the system-wide metrics from the `nvme0n1` drive. Please note that you are using a snapshot of this workload; more accurate characteristics can be obtained by measuring the distribution of a workload.
This is a simple transcoding workload with flushed writes, where most data is processed and stored in memory. Disk I/O is minimal, with an IOPS of just 3.81, low throughput (248.71 kB/s), and an average IO depth of 0.01 — all summarised in very low disk utilization. The 52% write merge rate and low latencies further suggest sequential, infrequent disk access, reinforcing that the workload is primarily memory-bound.
116
+
### Basic Characteristics of the Example Workload
115
117
118
+
This is a simple transcoding workload with flushed writes, where most data is processed and stored in memory. Disk I/O is minimal, with an IOPS of just 3.81, low throughput (248.71 kB/s), and an average IO depth of 0.01 — all summarized in very low disk utilization. The 52% write merge rate and low latencies further suggest sequential, infrequent disk access, reinforcing that the workload is primarily memory-bound.
The ideal storage activity of your system is 0. In this situation all of your application data and instructions are available in memory or caches with no reads or writes to a spinning hard-disk drive or solid-state SSD required. However, due to physical capacity limitations, data volatility and need to store large amounts of data, many applications require frequent access to storage media.
11
+
Ideally, your system's storage activity should be zero—meaning all application data and instructions are available in memory or cache, with no reads or writes to harddisk drives (HDDs) or solid-state drives (SSDs) required. However, due to physical capacity limits, data volatility, and the need to store large amounts of data, most applications frequently access storage media.
12
12
13
13
## High-Level Flow of Data
14
14
15
-
The diagram below is a high-level overview of how data can be written or read from a storage device. This diagram illustrates a multi-disk I/O architecture where each disk (Disk 1 to Disk N) has an I/O queue and optional disk cache, communicating with a central CPU via a disk controller. Memory is not explicitly shown but resides between the CPU and storage, offering fast access times with the tradeoff of volatile. File systems, though not depicted, operate at the OS/kernel level to handling file access metadata and offer a friendly way to interact through files and directories.
15
+
The diagram below provides a high-level overview of how data is written to or read from a storage device. It illustrates a multi-disk I/O architecture, where each disk (Disk 1 to Disk N) has its own I/O queue and optional disk cache, communicating with a central CPU via a disk controller. Memory, not explicitly shown, sits between the CPU and storage, offering fast but volatile access. File systems, also not depicted, operate at the OS/kernel level to handle file access metadata and provide a user-friendly interface through files and directories.
16
16
17
17

18
18
19
-
20
19
## Key Terms
21
20
22
21
#### Sectors and Blocks
23
22
24
-
Sectors are the basic physical units on a storage device. For instance, traditional hard drives typically use a sector size of 512 bytes, while many modern disks use 4096 bytes (or 4K sectors) to improve error correction and efficiency.
23
+
Sectors are the basic physical units on a storage device. Traditional hard drives typically use a sector size of 512 bytes, while many modern disks use 4096 bytes (4K sectors) for improved error correction and efficiency.
24
+
25
+
Blocks are logical groupings of one or more sectors used by filesystems for data organization. A common filesystem block size is 4096 bytes, meaning each block might consist of eight 512-byte sectors, or map directly to a 4096-byte physical sector if supported by the disk.
25
26
26
-
Blocks are the logical grouping of one or more sectors used by filesystems for data organization. A common filesystem block size is 4096 bytes, meaning that each block might consist of 8 of the 512-byte sectors, or simply map directly to a 4096-byte physical sector layout if the disk supports it.
27
+
#### Input/Output Operations per Second (IOPS)
27
28
28
-
#### Input Output Operations per second (IOPS)
29
-
IOPS is a measure of how much random read or write requests your storage system can manage. It is worth noting that IOPS can vary by block size depending on the storage medium (e.g., flash drives). Importantly, traditional hard disk drives (HDDs) often don't specify the IOPS. For example the IOPS value for HDD volume on AWS is not shown.
29
+
IOPS measures how many random read or write requests your storage system can handle per second. IOPS can vary by block size and storage medium (e.g., flash drives). Traditional HDDs often do not specify IOPS; for example, AWS does not show IOPS values for HDD volumes.
30
30
31
31

32
32
33
-
#### Throughput / Bandwidth
34
-
Throughput is the data transfer rate normally in MB/s with bandwidth specifying the maximum amount that a connection can transfer. IOPS x block size can be used to calculate the storage throughput of your application.
33
+
#### Throughput and Bandwidth
34
+
35
+
Throughput is the data transfer rate, usually measured in MB/s. Bandwidth specifies the maximum amount of data a connection can transfer. You can calculate storage throughput as IOPS × block size.
35
36
36
37
#### Queue Depth
37
-
Queue depth refers to the number of simultaneous I/O operations that can be pending on a device. Consumer SSDs might typically have a queue depth in the range of 32 to 64, whereas enterprise-class NVMe drives can support hundreds or even thousands of concurrent requests per queue. This parameter affects how much the device can parallelize operations and therefore influences overall I/O performance.
38
38
39
-
#### I/O Schedule Engine
39
+
Queue depth is the number of simultaneous I/O operations that can be pending on a device. Consumer SSDs typically have a queue depth of 32–64, while enterprise-class NVMe drives can support hundreds or thousands of concurrent requests per queue. Higher queue depth allows more parallelism and can improve I/O performance.
40
+
41
+
#### I/O Engine
40
42
41
-
The I/O engine is the software component within Linux responsible for managing I/O requests between applications and the storage subsystem. For example, in Linux, the kernel’s block I/O scheduler acts as an I/O engine by queuing and dispatching requests to device drivers. Schedulers use multiple queues to reorder requests optimal disk access.
42
-
In benchmarking tools like fio, you might select I/O engines such as sync (synchronous I/O), `libaio` (Linux native asynchronous I/O library), or `io_uring` (which leverages newer Linux kernel capabilities for asynchronous I/O).
43
+
The I/O engine is the software component in Linux that manages I/O requests between applications and the storage subsystem. For example, the Linux kernel’s block I/O scheduler queues and dispatches requests to device drivers, using multiple queues to optimize disk access. In benchmarking tools like fio, you can select I/O engines such as sync (synchronous I/O), `libaio` (Linux native asynchronous I/O), or `io_uring` (which uses newer Linux kernel features for asynchronous I/O).
43
44
44
45
#### I/O Wait
45
46
46
-
This is the perceived time spent waiting for I/O to return the value from the perspective of the CPU core.
47
+
I/O wait is the time a CPU core spends waiting for I/O operations to complete.
0 commit comments