How hard disk caching works for SSDs

Source: Internet
Author: User

With the popularization of SSD solid-state drives, now with the cache of SSD prices are gradually accepted by users, although we know that there is no cache of SSD in the price will be slightly more expensive than the cache, but the cache on the SSD solid state hard drive how the role played by not every user is aware.

In fact, the term "caching" is literally interpreted as delaying storage, simply saying "caching" exists to balance the speed difference between high-speed devices and low-speed devices. The function is to let low-speed equipment as far as possible not to drag the high-speed equipment back. Here the reason for the use of the word "as far as possible," mainly in various types of products in the cache capacity is limited, the algorithm can not be 100% accurate hit, so low-speed equipment or more or less will be towed high-speed equipment, the role of caching can only be "as far as possible" to reduce this phenomenon.

For example, CPU caching, whenever the CPU reads data from memory, a read instruction is issued to the memory controller requiring the memory controller to return the required data, but because the memory response rate is slow relative to the CPU, the CPU has nothing to do until the data returns, and if this happens frequently, The faster the CPU will also be dragged down by memory, efficiency will not improve.

Between the main memory (RAM) and the CPU, put a small volume of SRAM. When the CPU application RAM data, first in the SRAM search, if found the data, it does not take a lot of time to read in RAM (synchronous reading). If there is no data in the SRAM, and then the RAM to read, when the RAM returned to the data, not only return the original required data, and "incidentally" return the desired data "before and after" some seemingly unrelated data, and put the data into the SRAM.

The next time the CPU to read data in SRAM, if the required data just in the SRAM, you can "hit" the. It can be seen from the principle that the higher the hit rate, the higher the efficiency of the CPU. And the hit rate is the "incidentally" returned by the data determined, which data is returned by the return, this will depend on the CPU's internal cache algorithm. Thus, because the cache capacity is far less than the main memory capacity, and the cache algorithm can not 100% accurate hit.

The role of caching in mechanical hard drives:

The above is an example of CPU caching. But in computer systems, caching is not just CPU-specific, because the contradiction between high-speed devices and low-speed devices is not just between the CPU and the memory. Now, if I were to write data from memory to the hard drive, it would take a long time to complete the task because the hard drive was slow. Then the user experience is that the computer is very slow. In fact, here the CPU is not slow, memory is not slow, but the hard drive is too slow.

Solve the problem of mechanical hard disk speed is too slow, in its interior placed a small capacity of memory, that is, the hard disk cache, the data is first written to the cache. Then at the operating system level, it is thought that the data has been written, the user's feeling is fast. The hard drive then writes itself from the cache to the platter, and the process does not require user intervention.

However, it should be noted that, in fact, the hard disk cache is not all used for caching data, there are other uses, so it is not necessarily the larger the cache, the better performance. There is also a problem with caching algorithms. If the algorithm is not excellent, the hit rate will not be high, such a large-capacity cache in a nominal.

The role of caching in SSD solid-state drives:

We have just introduced what is the cache, and its role in the mechanical hard disk and memory, in fact, the cache in SSD solid-state drive play a different role. The cache on SSD is generally composed of 1 or 2 dram particles, which acts as a buffer for data exchange. Does an SSD product have a cache of this design, often manufacturers according to product positioning and use to make decisions, generally some entry-level products or low-speed products, in the design will consider without caching scheme, and some high-speed products due to the large number of data exchange, the design has a cache to improve the efficiency of the product read and write.

Typically, SSD with caching is slightly higher in price or than without cache, although SSD can read small files faster, but for SSDs it is too limited. In terms of reaction speed, the reaction speed of SSD is generally within 0.2 milliseconds, no slower than cache. Therefore, the increase of read speed with cache can be neglected almost. Second, with no cache does not affect the life of SSDs, determine the SSD life is NAND flash write times. Secondly, the quality of the main control chip is the key factor to determine the performance and service life of SSDs.

Article Summary:

Through the author's introduction I believe that the role of the cache has a deep understanding, in addition, we can see that the cache in memory, mechanical hard disk and SSD solid state hard drive is not the same strength. The cache is designed to balance the speed difference between high-speed devices and low-speed devices, and the effect is to keep low-speed devices from dragging the rear foot of high-speed equipment as far as possible.

The main function of caching is when the computer has data to the HDD, because the HDD mechanical operation is much slower than the computer, so put the cache on the HDD, temporary storage data so that the computer can continue to do other things, not because of the slow motion of the HDD, and slow down the performance of the computer.

The speed of the SSD has been greatly improved, and it has been able to process the data in real time, so the cache is not as fast. From this we can conclude that the SSD speed is not scientific according to the cache size, and the speed of solid-state hard disk is determined by the main control chip and the quality of flash particles.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.