Understanding Disk Types, I/O Basics, and Performance Monitoring on Linux
This article explains what disks are, compares mechanical HDDs and SSDs, describes disk I/O concepts, outlines key performance metrics such as IOPS, throughput, utilization and latency, and introduces Linux tools like iostat, iotop, sar for monitoring and analyzing storage performance.
1. What is a Disk
Before discussing disk I/O, a brief introduction to disks: disks are persistent storage devices, classified by media into mechanical disks and solid‑state disks.
1.1 Mechanical Disk
Mechanical disks, also called Hard Disk Drives (HDD), consist of platters and read/write heads. Data is stored in concentric tracks; the head must move to the correct track before accessing data. Continuous I/O avoids seek time and yields the best performance, while random I/O incurs frequent head movement and is slower.
1.2 Solid‑State Disk
Solid‑State Disks (SSD) are built from electronic components and have no seek latency, so both sequential and random I/O are much faster than on HDDs.
1.3 Comparison
For both HDD and SSD, random I/O is slower than sequential I/O. HDD suffers from head‑seeking and platter rotation; SSD, although faster, still incurs write‑amplification and garbage‑collection overhead for random writes. Sequential I/O can benefit from pre‑fetching.
On HDD, random I/O is slower due to extra head seeks and spindle rotation.
On SSD, random writes trigger erase‑before‑write and garbage collection, reducing performance compared with sequential writes.
Sequential I/O can be accelerated by pre‑reading, which many optimization techniques exploit.
Both disk types have a minimum read/write unit: 512 bytes per sector for HDDs and a page (typically 4 KB, 8 KB, etc.) for SSDs.
Linux groups contiguous sectors or pages into logical blocks (commonly 4 KB) to improve efficiency.
1.4 Classification by Interface
Disks can also be classified by interface: IDE, SCSI, SAS, SATA, Fibre Channel, etc. Different interfaces receive different device name prefixes (e.g., hd for IDE, sd for SCSI/SATA) and are numbered a, b, c … when multiple disks of the same type exist.
1.5 Disk Architecture
When attached to a server, disks can be used in various architectures:
Standalone disk devices, optionally partitioned (e.g., /dev/sda1, /dev/sda2).
Multiple disks combined into a logical volume such as a RAID array (RAID 0, 1, 5, 10, …) to improve performance and reliability.
Network‑attached storage clusters exposed via NFS, SMB, iSCSI, etc.
In Linux, a disk appears as a block device; each block device has a major and minor number used by the kernel.
2. What is Disk I/O
Disk I/O (Input/Output) refers to read and write operations between the computer and storage devices. The CPU issues read/write requests; the disk locates the data and transfers it to or from memory. Programs must load code from disk into memory before execution.
When a program accesses files, the operating system provides system calls to open, read, and write data, similar to opening a book before reading its contents. While the CPU waits for the I/O operation, it may continue executing other instructions.
Note 1: When the CPU waits for disk I/O, its utilization drops because it is idle, highlighting the impact of I/O on CPU performance. Note 2: Memory acts as a bridge between CPU and disk; programs load code into memory, the CPU processes it, and results are written back to memory and eventually to disk.
3. Disk Performance Metrics
The five common metrics are utilization, saturation, IOPS, throughput, and response time.
IOPS – number of I/O requests processed per second.
Throughput – amount of data transferred per second (e.g., MB/s). Typical sequential speeds: HDD 80‑150 MB/s, SAS 150‑200 MB/s, SSD 400‑600 MB/s.
Response time – latency from request issuance to completion.
Utilization – percentage of time the disk is handling I/O; high utilization (>80 %) may indicate a bottleneck, but it does not consider request size.
Saturation – degree to which the disk is busy; at 100 % saturation the disk cannot accept new requests.
Metrics should be evaluated together with read/write ratios, I/O type (random vs. sequential), and request size. For example, IOPS matters most for random‑heavy workloads such as databases, while throughput is more relevant for sequential workloads like media streaming.
4. Observing Disk I/O
After understanding metrics, you need tools to monitor them.
4.1 Monitoring per‑disk statistics with iostat
# iostat belongs to sysstat package. Install directly. yum install sysstat -yCommon options:
-c Show CPU utilization only
-d Show disk I/O only
-k Display output in KB/s
-t Add timestamp to output
-m Show values in MB/s
-p Show only block devices and their partitions
-V Show version and exit
-x Show extended statisticsKey fields in iostat output: %util – disk I/O utilization. r/s + w/s – IOPS. rkB/s + wkB/s – throughput. r_await or w_await – response time.
Also consider request size fields ( rareq‑sz, wareq‑sz) when analyzing.
4.2 Monitoring per‑process I/O with iotop
Install: # yum -y install iotop Useful options:
--version Show version
-h, --help Show help
-o, --only Show only processes actually doing I/O
-b, --batch Run in non‑interactive mode
-n NUM, --iter=NUM Number of iterations in batch mode
-d SEC, --delay=SEC Delay between updates
-p PID, --pid=PID Show only specified PID
-u USER, --user=USER Show only processes of a user
-P, --processes Show processes (default shows threads)
-a, --accumulated Show accumulated I/O since start
-k, --kilobytes Display in kilobytes
-t, --time Add timestamp to each line
-q, --quiet Suppress header linesSample output:
$ iotop
Total DISK READ : 0.00 B/s | Total DISK WRITE : 7.85 K/s
Actual DISK READ: 0.00 B/s | Actual DISK WRITE: 0.00 B/s
TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
15055 be/3 root 0.00 B/s 7.85 K/s 0.00 % 0.00 % systemd-journald4.3 Historical I/O with sar
The sar command can record and replay historical I/O statistics stored in /var/log/sa/.
# sar -d -p 1 2 # real‑time view
# sar -d -p -f /var/log/sa/sa16 # view saved data5. Summary
This article covered disk types, Linux I/O concepts, key performance metrics, and practical tools such as iostat, iotop, and sar for monitoring storage performance. Effective analysis requires correlating IOPS, throughput, utilization, saturation, and latency with workload characteristics.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
