With the model in hand, we can put numbers to disk performance. I/O time is the sum of the three costs:
The rate of I/O β handy for comparing drives β is the transfer size over that time:
Aside: Dimensional Analysis
Given only RPM, how long is one rotation in ms? Cancel units, chemistry- class style. For a 10K RPM drive: . The same trick turns a 100 MB/s rate into βhow long for a 512 KB block?β β just line up the units so they cancel.Two drives, two workloads
To feel the numbers, compare two Seagate drives across two workloads: a random workload (small 4 KB reads scattered across the disk β common in databases) and a sequential one (one long contiguous transfer).
| Cheetah 15K.5 | Barracuda | |
|---|---|---|
| Capacity | 300 GB | 1 TB |
| RPM | 15,000 | 7,200 |
| Average seek | 4 ms | 9 ms |
| Max transfer | 125 MB/s | 105 MB/s |
| Platters | 4 | 4 |
| Cache | 16 MB | 16/32 MB |
| Connects via | SCSI | SATA |
On the Cheetah, a random 4 KB read costs a 4 ms seek, a 2 ms average rotation (15,000 RPM β 4 ms/rotation β 2 ms average), and a vanishing ~30 Β΅s transfer β so and . A sequential 100 MB read pays one seek + rotation and then transfers for ~800 ms, hitting nearly the peak 125 MB/s. The result is staggering:
| Cheetah | Barracuda | |
|---|---|---|
| R_I/O Random (4 KB reads) | 0.66 MB/s | 0.31 MB/s |
| R_I/O Sequential (100 MB) | 125 MB/s | 105 MB/s |
| Sequential Γ· Random | β 190Γ | β 340Γ |
Sequential vs. random throughput (MB/s). The random bar is there β itβs just ~190Γ smaller.
Tip: Use Disks Sequentially
Whenever possible, transfer data to and from disk sequentially. If not, at least use large chunks β the bigger the better. Little random I/Os make performance suffer dramatically (and so, the authors warn, will you, knowing the suffering your careless random I/Os have wrought).Aside: Why βAverage Seek β 1/3 Of Fullβ
Youβll often see average seek quoted as one-third of the full-stroke seek. It comes from average seek distance: over all pairs of tracks in , the mean of works out (by integrating and dividing by ) to . So the average seek spans a third of the disk β hence a third of the full seek time.Next: given that random I/O is so costly, the OS can reorder requests to minimize it β disk scheduling.
Check yourself: I/O time math
1.A 10,000 RPM disk β how long is one rotation, and what's the average rotational delay?
2.On the Cheetah, a random 4 KB read achieves only ~0.66 MB/s. Why so slow?
3.How does sequential throughput compare to random on these drives?
4.What is the single most important disk performance tip from this section?
5.Why is the average seek often quoted as about one-third of a full-stroke seek?