|
Write caching improves server performance
With computing demands continually increasing, there is a
constant need for speed when it comes to accessing disk storage.
In addition to being fast mechanically (faster disk rotation
speeds and faster head movement) and offering higher data
densities, Hitachi Ultrastar disk drives employ read caching, and
now a new write caching feature called Hitachi Cache Optimizer. These
performance-enhancing techniques make system operations more
efficient by helping to speed up data retrieval and transfer.
Disk cache, solid-state memory located on a disk drive, has two
functions. First, it bridges data on the disk with data on the
interface to the computer. Data cannot travel directly between
the disk and the computer because each operates at a different
speed. The cache acts as a buffer, matching the speeds of the
two. Second, disk cache acts as a holding area for data being
written to or retrieved from the disk, improving the response
time of the disk, potentially increasing the performance of the
entire computing system.
What is read caching?
Read caching is commonly used on most hard disk drives today.
Retrieving data from cache takes much less time than from
disk--microseconds to read from solid-state memory compared to
milliseconds required for the disk read head to move and the disk
to rotate to where the data is located. When a read command
arrives at the hard drive, the drive first checks to see whether
the requested data is in the cache. If the cache does not contain
the requested data, the drive retrieves the data from the disk.
Drives also may read ahead on the disk for more data than was
requested. All that data is saved in the cache. Since many
applications process data sequentially, it is likely that the
next read request will be for data that follows the last request.
Thus, subsequent commands could access that prefetched data from
the cache instead of from the disk.
When data can be supplied from the cache, performance can be
greatly enhanced. Up to a point, larger caches provide greater
performance gains than smaller caches. For example, in server
benchmarks, Hitachi has seen significant increase in disk drive
cache hit rate with a 8 MB cache compared to a 2 MB cache.
What is write caching?
Like read caching, write caching is a way for the hard disk drive
to improve system performance by anticipating what the server
will do next. If write caching is enabled on the disk drive, when
the server sends a write command to the drive, it immediately
tells the computer that the write operation is completed (even
though the data has not yet been written to the disk). The data
is stored in the write cache and written to the disk later (when
the write head has been positioned over the data area and the
disk has rotated to the location where the data will be written).
By immediately telling the computer the data is written, the
computer does not have to wait and can go on with its computing
tasks. Eliminating the time the computer waits for writes to
complete may improve system performance.
Write caching allows sequential data to be transferred in a
continuous flow to the drive, rather than as individual blocks of
data separated by disk seek and rotation delays. This is achieved
by taking advantage of the ability to write blocks of data
sequentially on a disk that is formatted with a 1:1 interleave.
As the last byte of data is transferred out of the write buffer
onto the disk and the head passes over the next sector of the
disk, the first byte of the next block of data is ready to be
transferred. This makes it possible to achieve an
interruption-free sequential data transfer.
Figure 1: Steps involved in saving a spreadsheet file on a disk
with write caching.
| STEP
| ACTION
|
| 1 |
A user clicks "save" in the spreadsheet program. The file is located on a server
disk drive. |
| 2 |
The server sends information to the hard disk over the SCSI interface. This information
consists of several blocks of data that comprise the spreadsheet file. |
| 3 |
The server disk drive puts the first block of data into its write cache and tells the
computer that the write operation is complete. The drive moves the write head to the
specified track and records the data after the disk rotates to the specified sector. |
| 4 |
In the meantime, the computer immediately sends more blocks of information, each
time getting an immediate "operation complete" response from the disk drive. |
| 5 |
After the head and the disk platter are positioned at the specified location, writing
begins. Since the blocks are likely to be written to sectors that follow one another,
they are written out quickly. Subsequent blocks go into the cache and onto the
disk after the platter rotates to the specified location. |
| 6 |
This process continues without the server having to wait for seek or rotation delays
until all the blocks of data that contain the spreadsheet are written to the disk. |
Figure 1 shows a simplified example of write caching. Although
the example does not show every detail of how servers write to
disks, it does convey the overall concept of write caches.
Write caching can significantly improve server performance. It is
not unusual to see a 10 percent to 15 percent improvement in
performance by enabling write caching. The largest performance
gains with this new Hitachi Ultrastar feature are available when the
disk drive is doing relatively short-seek random write
operations. This is especially true for logical environments
where no queueing at all is used. These reordering algorithms
allow the drive to execute the disk transfers in an order which
minimizes disk access time. Without it, reordering effectiveness
is greatly reduced in those environments.
Issues and benefits of write caching
Overall system performance is improved by eliminating the server
having to wait for writes to complete. There is a small amount of
time where the host software thinks the data is safely written on
the disk, yet it is held in volatile cache memory on the disk
drive. The host server has no visibility that the information
sent to the disk drive was not written to the media since all
commands are returned with good status to the system.
If an error or power failure occurs, the host software must
verify what is actually written on the disk and take appropriate
steps to rewrite the data as part of the restart process. For
most computing environments, disk errors and power outages are
rare. In addition, many manufacturers are adding battery backup
to their computing systems so that even if a power outage or
equipment failure occurs, decreasing the chance that cached data
would be lost.
Write caching in Hitachi server disk drives
Hitachi began implementing full write caching, called Cache
Optimizer, as an option available on Hitachi disk drives in May 1999 with
the announment of the Ultrastar 18LZX and is currently available
in the Ultrastar 146Z10. The feature can
be turned on and off from the server through the SCSI interface.
This enables users to gain the performance benefits of write
caching while also having the ability to turn it off if the
exposure to data loss is a concern.
What's a cache?
A disk cache is solid-state memory on a disk drive that performs
two functions. First, it is used to simply match the data
transfer speed differences between high-speed computers and
slower-speed hard disks. Second, it is used as a holding area (or
cache) for data being written to or retrieved from a disk,
improving performance. The following are the two kinds of caching
used with hard disk drives:
With read caching, the hard disk drive reads more data than was
requested by the computer and saves it in the cache. Often, the
next read request references data that is adjacent to the last
request. Thus, system performance is improved because the disk
can provide the data very quickly from the cache.
If write caching is enabled on the disk drive, the disk drive
immediately tells the computer that the data was written to the
disk, even though it may take some time for the drive to actually
seek and the disk to rotate to the desire location. System
performance is improved because the computer is free to continue
processing rather than waiting for the disk drive to actually
write the data on the disk.
Other names are trademarks or registered trademarks of their
respective owners.
References in this publication to Hitachi products, programs, or
services do not imply that Hitachi intends to make them available in
all countries in which Hitachi operates.
Product description data represents design objectives and is
provided for comparative purposes; actual results may vary
depending on a variety of factors. Product claims are true as of
the date of the first printing. This product data does not
constitute a warranty. Questions regarding Hitachi warranty terms or
the methodology used to derive this data should be referred to an
Hitachi representative. Data subject to change without notice.
|