Databases Reference
In-Depth Information
If we take a look at the iostat output for the same machine (again omitting the first
sample, which shows averages since boot), you can see that disk utilization is less
than 50%:
$ iostat -dx 5
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
sda 0 3859 54 458 2063 34546 71 3 6 1 47
dm-0 0 0 54 4316 2063 34532 8 18 4 0 47
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
sda 0 2898 52 363 1767 26090 67 3 7 1 45
dm-0 0 0 52 3261 1767 26090 8 15 5 0 45
This machine is not I/O-bound, but it's still doing a fair amount of I/O, which is not
unusual for a database server. On the other hand, a typical web server will consume a
lot of CPU resources but do very little I/O, so a web server's output will not usually
look like this sample.
An I/O-Bound Machine
In an I/O-bound workload, the CPUs spend a lot of time waiting for I/O requests to
complete. That means vmstat will show many processes in uninterruptible sleep (the
b column), and a high value in the wa column. Here's an example:
$ vmstat 5
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
5 7 740632 22684 43212 13466436 0 0 6738 17222 1738 16648 19 3 15 63
5 7 740632 22748 43396 13465436 0 0 6150 17025 1731 16713 18 4 21 58
1 8 740632 22380 43416 13464192 0 0 4582 21820 1693 15211 16 4 24 56
5 6 740632 22116 43512 13463484 0 0 5955 21158 1732 16187 17 4 23 56
This machine's iostat output shows that the disks are always busy: 16
$ iostat -dx 5
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
sda 0 5396 202 626 7319 48187 66 12 14 1 101
dm-0 0 0 202 6016 7319 48130 8 57 9 0 101
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
sda 0 5810 184 665 6441 51825 68 11 13 1 102
dm-0 0 0 183 6477 6441 51817 8 54 7 0 102
The %util value can be greater than 100% because of rounding errors.
What does it mean for a machine to be I/O-bound? If there's enough buffer capacity
to serve write requests, it generally—but not always—means the disks can't keep
up with read requests, even if the machine is doing a lot of writes. That might seem
counterintuitive until you think about the nature of reads and writes:
16. In the second edition of this topic, we conflated “always busy” with “completely saturated.” Disks that
are always doing something aren't necessarily maxed out, because they might be able to support some
concurrency, too.
 
Search WWH ::




Custom Search