RAID5 and RAID10, what kind of RAID is better for you (UP)

Source: Internet
Author: User

"IT168 Zhuangao" storage is a hot spot in the development of IT industry, and RAID technology is the basic technology of constructing high performance, mass storage, and also the foundation of network storage. Experts believe that the performance benefits of disk array benefit from the parallelism of disk operation, improve the parallelism of device running can improve disk performance and data security.

For more than 20 years, RAID has introduced a range of levels, including RAID 0, RAID 1, RAID 2, RAID 3, RAID4, RAID 5, and a variety of combinations such as RAID 0+1. The most extensive of these include RAID5 and RAID10. But there have been a lot of disputes about the performance of RAID5 and RAID10, and even many people, including many companies, have taken out test data. And these test data complex difficult to understand contradictory, more let users feel confused, do not know how to choose.

Here, I'll analyze the internal workings of these two types of RAID to see where we should be fit to choose the raid mode. According to my experience and analysis: like small IO database type operation, such as ERP and so on, the proposed use of RAID10, and large file storage, data Warehouse, such as medical PACs system, video editing system from the perspective of space utilization, the proposed use of RAID5. See detailed performance comparisons below:

This article is divided into two, the above focus on the analysis of the two RAID internal operating principles, the following will be based on the different factors affecting the performance of the disk analysis, the impact of the RAID scheme on the disk system, refer to "RAID5 and RAID10, which raid more suitable for you (next) "

For the sake of comparison, I take the same disk to compare the same drive, RAID5 select 3d+1p RAID scheme, RAID10 choose 2d+2d Raid Scheme, respectively


So, we analyze the following three processes: Read, write continuously, random write, but before I introduce these three processes, I need to introduce another important concept in the disk array: cache.

One of the keys to disk read and write speed: Cache

Cache technology in recent years, the development of disk storage technology is very rapid, as a high-end storage, the cache has been the core of the entire storage, is low-end storage, there is a large cache, including the simplest RAID card, usually contains dozens of, or even hundreds of trillion raid Cache

What is the main role of the cache? As a buffer, the role of the cache is specific in reading and writing two different aspects: as a write, the general storage array only requires data to write to the cache even if the write operation, when the write cache data accumulated to a certain extent, the array to the data to the disk, can achieve bulk write. So, the writing of the array is very fast. As for the protection of the cache data, it is generally dependent on the mirror and the battery (or the UPS).

The role of the cache in reading data is not negligible, because if the data that needs to be read can be hit in the cache, it will significantly reduce the time it takes to find the disk. Because the disk from the beginning of the search to find data, generally more than 6ms, and this time, for those intensive I/O applications may not be ideal. However, if you can hit the data stored in the cache, the general response time can be reduced to less than 1ms.

don't be superstitious about the storage vendor's IOPS (IO per second) data, they may all be on the cache hit basis, but in fact, your cache hit rate may be only 10%.

After the introduction of the cache, we can explain RAID5 and RAID10 in different modes, the efficiency of the problem, then we have to analyze the read operation, continuous writing and discrete write three aspects of the problem.

Performance differences in read operations
As I described earlier, the key to disk array read operations is more on the cache hit ratio. So, RAID5 and RAID10 read the data, they are basically no difference, unless the data read can affect the cache hit rate, resulting in a different hit ratio.

Performance differences in continuous writing
The process of continuous writing, generally means writing continuous large amounts of data, such as media data streams, large files, and so on. The continuous write operation is mostly produced in the application environment of medical PACS system, higher Education library system, video editing system and so on.

According to my own experience, in the continuous writing process, if there is write cache exists, and the algorithm is not a problem, RAID5 than RAID10 even better, although perhaps not too much difference. (This assumes that there are enough write caches for a certain size, and that the CPU that calculates the checksum does not have a bottleneck).

Since this time the raid check is done in the cache, such as 4 disk RAID5, you can first calculate the checksum in memory, and write 3 data + 1 checksum. RAID10 can only write 2 data + 2 mirrors at a time.

As shown, the 4-disk RAID5 can write 1, 2, 3 to the cache at the same time, and after the cache has computed the checksum, I'm assuming 6 (the actual checksum calculation is not the case, I'm just assuming), and the three data is written to disk. The 4-disk RAID10, regardless of whether the cache exists or not, writes 2 data and 2 mirrors at a time.

According to my previous introduction to the principle of caching, write cache can be cached write operations, wait until the cache write data accumulated to a certain period of time and then write to disk. However, the process of writing to the disk array is going to happen sooner or later, so the RAID5 and RAID10 in the case of sequential writes, the speed of write operations from cache to disk will be slightly different. However, if it is not the continuity of strong continuous writing, as long as the disk does not reach the write limit, the difference is not too large.

Performance differences in discrete writes
This may be difficult to understand, but this part is also the most important part. Most of the database applications in the enterprise, such as the ERP system, are all discrete written when the data is written.

For example, the Oracle database writes one block of data at a time, such as 8K, because the amount of each write is not very large and the number of writes is very frequent, so the online log looks like a sequential write. However, since there is no guarantee that a stripe of RAID5 can be filled (guaranteed to be written to every disk), it is often more biased towards discrete writes.


When we look at discrete writing, RAID5 and RAID10 work differently. For example, if we assume that we want to turn a number 2 into a number 4, then for RAID5, it actually takes 4 IO:
Read 2 and checksum 6, read hit may occur
The new checksum is then calculated in the cache
Write the new number 4 with the new checksum 8

As we can see: for RAID10, the same single operation, the final RAID10 requires only 2 Io, and RAID5 requires 4 io.

Here I ignore the case where the read-hit operation may occur when the RAID5 is in the two read operations. That is, if the data that needs to be read is already in the cache, it may not require 4 IO. This also proves the importance of the cache to RAID5, not just the need to compute the checksum, but also the improvement in performance. I've tested it myself, and in the RAID5 array, if you turn off write CACHE,RAID5, the performance will be many times worse.

Of course, I am not saying that the cache is not important to RAID10, because write buffer, read hit, etc., are the key to improve speed, but the RAID10 of the cache is not RAID5 so obvious dependence.

Here, we should also generally understand the principle and difference between RAID5 and RAID10, in general, like small IO database type operation, the proposed use of RAID10, and large file storage, data Warehouse, from the perspective of space utilization, can be used RAID5.

It mainly analyzes the similarities and differences between RAID5 and RAID10 from the internal running details of the disk system, as well as the respective scopes of application. In this article, we will continue to analyze the bottleneck of the storage system from the raid principle.

We know that in the storage system procurement process, vendors often can provide beautiful performance parameters, but in practice, the actual performance of the system does not achieve the desired state, then in the operating environment, the actual performance of the storage system is affected by what links and bottlenecks?

The reason why I want to discuss this problem with you is because I have encountered a real case in my work, in this case, a very stressful standby (here is mainly written, and is small IO write), using the RAID5 scheme, found poor performance, Later changed the RAID10, it is very good to avoid the problem of performance.

It is recommended that before reading this article, first read the article "RAID5 and RAID10, which raid is right for you ", because the performance bottleneck itself and the raid mode is still very important, and the basis of the performance discussion in this article itself, based on some of the above conclusions.

The bottleneck of the array is mainly in 2 aspects, bandwidth and IOPS (the amount of data transmitted per unit of time, and the number of I/OS completed per unit time).

Key factors that affect bandwidth

The bandwidth of the storage system depends primarily on the architecture of the array, the size of the Fibre Channel (the array we are discussing today is typically a fiber array, an SSAS array such as SCSI, temporarily out of the scope of the discussion), and the number of hard disks.

The so-called array architecture affects the storage system bandwidth, which means that the internal architecture of the storage system will have some internal bandwidth, similar to the PC's system bus, although the structure of the array for different manufacturers different models of products and different, but in general, the internal bandwidth is designed to be adequate, will not be the bottleneck.

The effect of fibre Channel on the bandwidth is still relatively large, such as data Warehouse environment, the traffic requirements for data is very large, and a 2Gb fiber-optic card, can support the maximum flow should be 2gb/8=250mb/s actual traffic, must be equipped with 4 fiber-optic card to reach the actual flow of 1gb/s, Therefore, for the data Warehouse environment, upgrading to fiber 4Gb is not a manufacturer too advanced product updates, in the high-traffic data environment is absolutely necessary to consider the replacement of 4GB fiber optic card.

But for the bandwidth of the storage system, the bandwidth limit of the hard disk interface is the most important. When the front bottleneck no longer exists, the bandwidth is entirely dependent on the number of hard disks, I listed below the different specifications of the hard drive can support the size of the traffic, data from the hard disk manufacturer's standard parameters:

If we assume that an array has 120 optical drives with 15K rpm, the largest data traffic on the hard disk is 120*13=1560mb/s and the current end interface is not a bottleneck, 1560mb/s is theoretically the maximum data traffic.

If you want to achieve the maximum bandwidth above, if the front-end with 2GB fiber-optic card, you may need to configure 6 blocks to be able, and 4GB of fiber-optic card, configuration 3-4 blocks is enough. So we can see that the fiber interface of the front end must match the number of back-end disks.

But is it enough to consider these factors, the overall performance of the storage system is also affected by a number of factors, and we will analyze another important performance indicator of the storage system: IOPS.

Key factors that affect IOPS

As we have already said, the IOPS value provided by the vendor is tested in an ideal state, and the reference to the actual operating performance is not significant, so it is necessary to measure the possible performance of the actual IOPS of the system in the following ways.

The main factors that determine IOPS depend on the array's algorithm, the cache hit rate, and the number of disks.

Array algorithms are also different for different manufacturers of different models of products, such as we recently encountered on the HDS USP, may be due to Ldev (LUN) there is a queue or resource constraints, and a single Ldev IOPS will not go up. Therefore, it is necessary to understand some of the algorithm rules and limitations of this storage before deciding to purchase a certain type of storage.

The cache hit rate has a decisive effect on the actual IOPS, and the cache hit rate depends on the distribution of the data, the size of the cache, the rules of the data access, and the cache algorithm, which, if fully discussed, will become complex and can be discussed over a day.

We're going to omit these internal principles, just to emphasize: for a storage array, the higher the hit rate of the read cache, the more likely it is that it can support more IOPS, why is that? This is related to the hard disk IOPS we are going to discuss below.

There is a limit to the IOPS that each physical hard disk can handle, such as

Similarly, if an array has 120 optical drives with 15K rpm, then the maximum IOPS it can support is 120*150=18000, which is the theoretical value of the hardware limit, and if this value is exceeded, the response of the hard disk may become very slow and not provide business normally. A higher read cache hit rate reduces the IOPS load on the hard disk, allowing the hard drive to work well under small pressure.

Impact of different raid on IOPS performance

In our previous article, "RAID5 and RAID10, what kind of RAID is right for you ( above )" has been discussed, in the different mechanisms of RAID5 and RAID10, when reading data, IOPS performance actually no difference. However, the same business, when writing data, the use of different raid mechanism will eventually fall on the disk IOPS is a difference, we are evaluating the overall disk IOPS, if the disk limit, the performance must be up.

Let's assume a case where the IOPS of the business application is 10000, the read cache hit rate is 30%, the read ioPS is 60%, the Write ioPS is 40%, the number of disks is 120, and the IOPS per disk is calculated separately for RAID5 and RAID10.

RAID5:
1. ioPS per disk = (10000* (1-0.3) *0.6 + 4 * (10000*0.4))/120
2. = (4200 + 16000)/120
3. = 168

Here 10000* (1-0.3) *0.6 is read ioPS, the ratio is 0.6, remove the cache hit, actually only 4,200 read IOPS.

and 4 * (10000*0.4) indicates the write IOPS, because each write, in RAID5, actually occurs 4 io, so write ioPS is 16,000.

In order to consider the RAID5 in the write operation, the 2 read operation can also hit, so the more accurate calculation should be:
1. ioPS per disk = (10000* (1-0.3) *0.6 + 2 * (10000*0.4) * (1-0.3) + 2 * (10000*0.4))/120
2. = (4200 + 5600 + 8000)/120
3. = 148

This way we calculated that the ioPS of a single disk is 148, which basically reaches the disk ioPS limit, in which case the disk's working state is very unsatisfactory.

The impact of RAID10 on IOPS performance
1. ioPS per disk = (10000* (1-0.3) *0.6 + 2 * (10000*0.4))/120
2. = (4200 + 8000)/120
3. = 102

As you can see, because RAID10 has only 2 io for a write operation, the same pressure, same disk, only 102 IOPS per disk, is far below the disk's limit ioPS.

Here we go back to the case we discussed earlier, when we used RAID5 earlier, by analyzing the ioPS per disk at peak times, it reached 200, causing the response to be incredibly slow. Transformed into RAID10, each disk's IOPS dropped to about 100, which is good to avoid this performance problem.

So, combining the previous article "RAID5 and RAID10, which raid is right for you ", we can conclude:

The key factor that affects reading data is the cache hit rate, which, in the case of reading data, does not differ significantly from the performance of the RAID5 RAID10. However, for some applications that write data, especially those applications where small I/O is frequently written, such as Enterprise ERP production systems, RAID10 may produce significant performance differences compared to RAID5. and large file storage, data Warehouse, such as medical PACs system, video editing system, from the perspective of space utilization, we recommend the use of RAID5.

Transfer from http://storage.it168.com/h/2007-06-28/200706281204046_3.shtml

RAID5 and RAID10, what kind of RAID is better for you (UP)

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.