Course contentsShow
← Linux
Lesson 311 of 1,8193. The Filesystem Hierarchy and POSIX StandardsFree lesson

Monitoring Disk I/O Performance

Analyze system-wide I/O throughput to identify bottlenecks in the filesystem pipeline.

In this lesson, you will learn how to analyze system-wide I/O throughput to identify bottlenecks within the filesystem pipeline.

When your applications interact with the filesystem, they don't talk directly to the physical spinning platters or flash cells. Instead, data travels through a complex pipeline involving memory buffers, the VFS (Virtual Filesystem) layer, and the block device drivers. If your system feels sluggish despite having a fast processor, the bottleneck is often here.

To monitor this, we look at the interaction between the kernel and the storage hardware. The most essential tool for a high-level view is iostat, which is part of the sysstat package.

Identifying the Bottleneck

When you run iostat -x 1, you will see output that reveals how hard your disks are working. Focus on these two key metrics:

  • %util: This is the percentage of time the disk was busy servicing requests. If this approaches 100%, your disk is saturated—it cannot physically process requests any faster.
  • await: This represents the average time (in milliseconds) for I/O requests to be served. High await times, especially when %util is high, indicate that your system’s I/O queue is backed up.

Consider a scenario where a database performs many small, random writes. If your await time spikes, it suggests the filesystem is struggling to commit these changes through its journaling mechanism or that the underlying hardware is hitting its IOPS (Input/Output Operations Per Second) limit.

# Monitor disk I/O every second
iostat -x 1

By watching these values, you can determine if a performance issue is caused by a massive throughput requirement (saturated bandwidth) or a latency issue (the disk is "seeking" or overwhelmed by too many simultaneous, disjointed requests). When you notice the await time climbing, you know the filesystem pipeline is congested, and you might need to investigate file-locking contention or optimize how your application handles data flushing to disk.

Key Takeaway: Monitor %util and await to distinguish between a hardware saturation point and a filesystem pipeline bottleneck.