In this lesson, you will learn how to measure and interpret IOPS and bandwidth to identify performance bottlenecks in your storage layers.
When we talk about disk performance, we focus on two primary metrics: IOPS (Input/Output Operations Per Second) and Throughput/Bandwidth.
Understanding the Metrics
- IOPS: This measures the number of distinct read or write operations a storage system can handle in one second. This is critical for workloads involving many small, random I/O operations, such as high-frequency transactional database updates or lookups.
- Throughput (Bandwidth): This measures the volume of data transferred per second (e.g., MB/s or GB/s). This is the key metric for large, sequential data transfers, such as reading a massive columnar file (like Parquet) for an analytical scan or exporting a large dataset.
Identifying Bottlenecks
To diagnose a bottleneck, you must match your workload to these metrics. If your system is performing a full table scan on a large dataset and performance is sluggish, you are likely hitting a throughput limit. You can check your disk utilization in Linux using iostat:
# Display extended statistics every 2 seconds
iostat -x 2
Look at the rMB/s or wMB/s columns. If you are consistently hitting the maximum MB/s ceiling of your storage device (e.g., 500 MB/s for a standard SSD), you’ve found your bottleneck.
Conversely, if you are performing millions of small key-value lookups and notice high latency—the time it takes to complete a single I/O request—you are likely hitting an IOPS limit. When a disk is overwhelmed by requests, the queue length (avgqu-sz in iostat) grows, and the time spent waiting for the disk to process the operation increases. If your await (average wait time) is high while your IOPS are near the device's hardware limit, your application is "I/O bound."
Understanding the distinction allows you to optimize effectively: if you are IOPS-bound, you might cache frequently accessed keys in memory; if you are throughput-bound, you might increase parallelism or switch to faster storage hardware.
Key Takeaway: Distinguish between IOPS for random, small-scale operations and Throughput for large, sequential data movement to accurately diagnose whether your storage system is the source of a performance lag.