Databases Reference
In-Depth Information
• Write requests can be either buffered or synchronous. They can be buffered at any
of the levels we've discussed elsewhere in this topic: the operating system, the RAID
controller, and so on.
• Read requests are synchronous by nature. It's possible for a program to predict
that it'll need some data and issue an asynchronous prefetch (read-ahead) request
for it. However, it's more common for programs to discover they need data before
they can continue working. That forces the request to be synchronous: the program
must block until the request completes.
Think of it this way: you can issue a write request that goes into a buffer somewhere
and completes at a later time. You can even issue many of these per second. If the buffer
is working correctly and has enough space, each request can complete very quickly,
and the actual writes to the physical disk can be batched and reordered for efficiency.
However, there's no way to do that with a read—no matter how few or how small the
requests are, it's impossible for the disk to respond with “Here's your data, I'll do the
read later.” That's why reads are usually responsible for I/O wait.
A Swapping Machine
A machine that's swapping might or might not show a high value in the swpd column.
However, you'll see high values in the si and so columns, which you don't want. Here's
what the vmstat output looks like on a machine that's swapping heavily:
$ vmstat 5
procs -----------memory------------- ---swap---- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 10 3794292 24436 27076 14412764 19853 9781 57874 9833 4084 8339 6 14 58 22
4 11 3797936 21268 27068 14519324 15913 30870 40513 30924 3600 7191 6 11 36 47
0 37 3847364 20764 27112 14547112 171 38815 22358 39146 2417 4640 6 8 9 77
An Idle Machine
For the sake of completeness, here's the vmstat output on an idle machine. Notice that
there are no runnable or blocked processes, and the idle column shows that the CPUs
are 100% idle. This sample comes from a machine running Red Hat Enterprise Linux
5, and it shows the st column, which is time “stolen” from a virtual machine:
$ vmstat 5
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 108 492556 6768 360092 0 0 345 209 2 65 2 0 97 1 0
0 0 108 492556 6772 360088 0 0 0 14 357 19 0 0 100 0 0
0 0 108 492556 6776 360084 0 0 0 6 355 16 0 0 100 0 0
 
Search WWH ::




Custom Search