If you want to know what the hard disk cache is and how it works, this article is for you. You will learn what it is, what functions it performs and how it affects the operation of the device, as well as the advantages and disadvantages of the cache.
Hard Disk Cache Concept
The hard drive itself is a fairly leisurely device. Compared to RAM, the hard drive is several orders of magnitude slower. The same causes a drop in computer performance with a lack of RAM, since the shortage is compensated by the hard drive.
So, the cache of the hard disk is a kind of random access memory. It is built into the hard drive and serves as a buffer for reading information and its subsequent transfer to the system, and also contains the most frequently used data.
Consider what the cache of the hard disk is for.
As noted above, reading information from the hard drive is very leisurely, since moving the head and finding the necessary sector takes a lot of time.
It must be clarified that the word "slow" refers to milliseconds. And for modern technology, the millisecond is a lot.
Therefore, like RAM, the cache of the hard disk stores data physically read from the surface of the disk, and also reads and stores sectors, which will probably be requested later.
This reduces the number of physical accesses to the drive, while increasing productivity. Winchester can work even if the host bus is not free. The transmission speed can increase hundreds of times with the same type of request.
How Hard Disk Cache Works
We will dwell on this in more detail. You already have some idea what the cache of the hard drive is for. Now find out how it works.
Imagine that the hard drive receives a request to read information in 512 KB from one block. The necessary information is taken from the disk and transferred to the cache, but along with the requested data, several neighboring blocks are read at the same time. This is called prefetching. When a new disk request arrives, the microcontroller of the drive first checks for the presence of this information in the cache and if it finds them, it instantly transfers it to the system without resorting to the physical surface.
Since the cache memory is limited, the oldest blocks of information are replaced by new ones. This is a circular cache or circular buffer.
Methods for increasing the speed of a hard disk due to buffer memory
- Adaptive segmentation. Cache memory consists of segments with the same amount of memory. Since the size of the requested information cannot always be the same size, many segments of the cache will be used irrationally. Therefore, manufacturers began to make cache memory with the ability to replace the size of the segments and their number.
- Prefetch. Winchester processor analyzes previously requested and currently requested data. Based on the analysis, it transfers information from the physical surface, which is more likely to be requested at the next moment in time.
- User control More advanced hard drive models enable the user to control the operations performed in the cache. For example: disabling the cache, setting the size of segments, switching the adaptive segmentation function, or disabling prefetching.
What gives the device more cache memory
Now we find out what volumes are equipped and what gives the cache memory in the hard drive.
Most often you can find hard drives with a cache size of 32 and 64 MB. But they also remained at 8 and 16 MB. Recently, they began to be released only on 32 and 64 MB. A significant breakthrough in performance occurred when 16 MB was used instead of 8 MB. And between the caches of 16 and 32 MB, there is no special difference anymore, as well as between 32 and 64.
The average computer user will not notice the difference in the performance of hard drives with 32 and 64 MB cache. But it is worth noting that the cache periodically experiences significant loads, so it is better to purchase a hard drive with a higher cache size, if there is a financial opportunity.
Key Benefits of Cache
Cache has many advantages. We will consider only the main ones:
- It greatly increases the speed of programs that repeatedly access the same small files. Therefore, users with this usage scenario are advised to buy the drive with the largest cache. The rest does not make sense to overpay, since the increase in efficiency will not be worth the money spent.
- Cache is a full-fledged computer accelerator. With its help, data buffering occurs, which gives a significant increase in performance.
- Winchesters with the largest buffer memory slightly reduce the load on the processor, which in turn affects the overall performance of the system.
- The system can receive information even if the host bus is busy. For example, a program running in the background that uses the same data in a buffer will not lose performance, even if you perform different tasks in other applications.
Cache disadvantages
- The speed of the hard drive does not increase if the data is written to disks randomly. This makes it impossible to prefetch information. This problem can be partially avoided if periodically defragmented.
- The buffer is useless when reading files larger than can fit in the cache. So, when accessing a file size of 100 MB, a cache of 64 MB will be useless.
Additional Information
You now know what the hard disk cache is and what it affects. What else do you need to know? Currently, there is a new type of drive - SSD (solid state). They use synchronous memory instead of disk plates, as in flash drives. Such drives are ten times faster than ordinary hard drives, because the presence of a cache is useless. But such drives have their drawbacks. Firstly, the price of such devices increases in proportion to the volume. Secondly, they have a limited margin of rewriting memory cells.
There are also hybrid drives: a solid state drive with a conventional hard drive. The advantage is the ratio of high speed and large amount of stored information with a relatively low cost.