When the data requested is available in the cache, a cache hit is said to have occurred; otherwise, the attempted access is referred to as a cache miss. The ratio of cache hits to the total number of accesses is referred to as the cache hit rate. The higher the hit rate, the greater the benefit provided by the cache. The cache in the main memory is examined here; the cache integrated in the storage system works “invisibly” in the background.
The following caching modes are available (in the diagrams below, accesses are depicted by arrows, with read accesses on the left and write accesses on the right):
Read cache
Figure 12: I/O processes for a read cache
Read hit:
The data is available in the cache when accessed and is read from there.
Read miss:
The data is read from the storage system and entered into the cache at the same time so that subsequent read requests can be resolved from there.
Write:
Write accesses are always to the storage system. If the relevant data block is already in the cache (“write hit”), the contents of the block are updated without making the write operation any faster.
Write cache
Figure 13: I/O processes for a write cache
Read hit:
The requested data is read directly from the cache (as in a read cache)
Read miss:
The data is read from the storage system but not entered in the cache.
Write:
The data is always written to the cache irrespective of whether or not the data block exists there. The application writing the data considers the output process to have been concluded as soon as the data has entered the cache. The writing of the data to the storage system is generally initiated immediately afterwards.
Read/write cache
Figure 14: I/O processes for a read/write cache
Read hit: Like read cache
Read miss: Like read cache
Write: Like write cache