Raid basics. raid10 compared with raid01, raid10 compared with RAID5

Source: Internet
Author: User


 
Document Content:
1. Introduction to basic RAID levels
2. Comparison between raid10 and raid01
3. Comparison between raid10 and RAID5

Comparison between raid10 and raid01
? Raid10 is to first make a mirror image and then make a strip.
? Raid01 is to first strip the image and then make the image.
For example, if you use six disks as an example, raid10 divides the disks into three groups of images and then strip the three RAID 1. Raid01 uses three disks as RAID 0, and then uses the other three disks as the mirror image of RAID 0.
The following uses four disks as an example to describe the Security differences:
1. raid10

In this case, we assume that when disk0 is damaged, the entire raid becomes invalid only when one disk of disk1 fails in the remaining three disks, we can simply calculate the failure rate to 1/3.
2. raid01

In this case, we still assume that disk0 is corrupted and the strip on the Left cannot be read. In the remaining three disks, As long as either disk2 or disk3 is damaged, the entire raid becomes invalid. We can simply calculate the failure rate as 2/3.
Therefore, raid10 is more secure than raid01.

In terms of the logical location of data storage, under normal circumstances, raid01 and raid10 are identical, and each read/write operation produces the same IO quantity, therefore, there is no difference in reading/writing performance between the two. When a disk fails, for example, if disk0 is damaged, we can also find that the reading performance is different in both cases, the read performance of raid10 is superior to that of raid01.

Btxigua uploads the image:

Comparison between raid10 and RAID5

In order to facilitate the comparison, here we will compare the disks with the same number of drives. RAID5 should select the 3D + 1p raid scheme, and raid10 should select the 2D + 2d raid scheme,

1. Security comparison

In fact, in terms of security, do not question it. It must be that the security of RAID 10 is higher than that of RAID 5. We can also draw from a simple analysis. When Disk 1 is damaged, raid becomes invalid only when the image disk corresponding to disk 1 is damaged. However, for RAID 5, if any of the three remaining disks fails, raid will fail.

The restoration speed of RAID 10 is also faster than that of RAID 5.

2. Comparison of space utilization

The raid10 utilization rate is 50%, and the RAID5 utilization rate is 75%. The more hard disks, the higher the space utilization of RAID 5.

3. read/write Performance Comparison

It mainly analyzes the following three processes: read, continuous write, and discrete write.

Before introducing these three processes, we should first introduce a particularly important concept: cache.

Cache is already the core of the entire storage, that is, the low-end storage, there is also a large cache, including the simplest RAID card, generally contains dozens, or even several hundred megabytes of RAID cache.

What is the main role of cache? It is reflected in two different aspects: Reading and Writing. If writing is performed, the storage array only requires writing to the cache to complete write operations. Therefore, writing to the array is very fast, when the data written to the cache is accumulated to a certain extent, the array only refreshes the data to the disk, which enables batch writing. As for the protection of the cache data, generally, it depends on mirror phase and battery (or ups ).

The read of the cache cannot be ignored, because if the read can hit the cache, the disk seek will be reduced, because the disk generally takes more than 6 ms from the time when it starts to find data, at this time, it may not be ideal for intensive Io applications. However, if the cache can hit, the general response time can be within 1 ms. The difference between the two should be three orders of magnitude (1000 times ).

1) performance differences in read Operations

The number of disks that raid10 can read valid data is 4, and the number of disks that RAID5 can read valid data is also 4 (verification information is distributed on all disks ), therefore, the read performance of the two should be basically the same.

2) performance differences in continuous writing

In the continuous write operation process, if a write cache exists and the algorithm is no problem, RAID5 is even better than raid10, although there may not be much difference. (Assume that the storage has enough write cache, And the CPU used for computing and verification does not have a bottleneck ).

This is because the raid check is completed in the cache. For example, for RAID 5 of four disks, you can calculate the check in the memory and write 3 data + 1 check at the same time. Raid10 can only write two data records and two mirror phases at the same time.

As shown in, RAID5 of the four disks can be written to cache from 1, 2, and 3 at the same time. After the cache has been verified, it is assumed that it is 6, write three data records to the disk at the same time. Regardless of whether the cache exists or not, raid10 of the four disks write two data copies and two mirrors at the same time.

According to the previous introduction to the cache principle, write operations can be cached and written to the disk after the cache write data has accumulated for a certain period of time. However, the process of writing data to the disk array will also happen sooner or later. Therefore, when RAID 5 and raid 10 write continuously, the write speed from cache to disk may be slightly different. However, if it is not continuous strong continuous writing, as long as it does not reach the write limit of the disk, the difference is not too big.

3) performance differences in discrete write

For example, Oracle
Each time a database writes data in a data block, such as 8 KB, the online log looks like continuous writing because the number of writes is not large and the number of writes is very frequent. However, it is not guaranteed that a strip of RAID 5 can be added, for example, 32 KB (each disk can be written ), therefore, it is more inclined to write data in Discrete mode (to the existing data strip ).

Let's take a look at the differences between RAID5 and raid10 in discrete writing. For example, assume that we want to convert a number 2 to a number 4. For RAID5, there are actually four Io operations: Read 2 and check 6 first, A read hit may occur and a new check is calculated in the cache. Write the new number 4 to the new check 8.

As we can see, for raid 10, only two Io is required for a single operation, and four Io is required for RAID 5.

Here, I ignore RAID5's possible read hit operations during those two read operations. That is to say, if the data to be read is already in the cache, it may not require 4 Io. This also proves that
It is not only required for computing verification, but also especially important for performance improvement.

Of course, it doesn't mean that the cache is not important to raid 10, because the write buffer, read hit, and so on are all the key to improving the speed, but the dependency of RAID 10 on the cache is not as obvious as that of RAID 5.

4) Comparison of disk iops

Assume that in a case, the iops of the business is 10000, the read cache hit rate is 30%, the read iops is 60%, the write iops is 40%, and the number of disks is 120, calculate the iops of each disk in the case of RAID 5 and raid 10 respectively.

RAID5:

Iops of a single disk = (10000 * (1-0.3) * 0.6 + 4*(10000*0.4)/120

= (4200 + 16000)/120

= 168

Here, 10000 * (1-0.3) * 0.6 indicates read iops. The proportion is 0.6. When cache hit is removed, only 4200 iops is actually used.

4 * (10000*0.4) indicates the write iops. Because of each write, there are actually 4 IO in RAID 5, so the write iops is 16000

In order to consider that the two read operations may hit the write operation of RAID 5, the more accurate calculation is as follows:

Iops of a single disk = (10000 * (1-0.3) * 0.6 + 2 * (10000*0.4) * (1-0.3) + 2*(10000*0.4 )) /120

= (4200 + 5600 + 8000)/120

= 148

The iops of a single disk is calculated as 148, reaching the disk limit.

Raid10

Iops of a single disk = (10000 * (1-0.3) * 0.6 + 2*(10000*0.4)/120

= (4200 + 8000)/120

= 102

As you can see, raid10 only performs two I/O operations for one write operation, so there are only 102 iops for each disk under the same pressure, it is far lower than the maximum iops of the disk.

4. Summary

Therefore, it is better to use RAID5 for systems that require high space utilization and do not require high security.

On the contrary, systems with high security requirements, regardless of the cost, use RAID 10 to write small data volumes frequently.

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.