"Big Talk Storage 2" Reading notes--4th Beidou seven-Stars Big talk/detailed 7 kinds of raid

Source: Internet
Author: User
Tags disk usage

transferred from : http://www.cnblogs.com/jfzhu/p/3999283.html

Http://www.cnblogs.com/xiaoluo501395377/archive/2013/05/25/3099464.html

Https://msdn.microsoft.com/en-us/library/ms190764.aspx

http://blog.csdn.net/ronmy/article/details/5819270

Disadvantages of traditional disks

We know that a PC will contain CPU, memory, motherboard, hard disk, network card and other hardware, the formation of the impact of computer performance including: CPU, motherboard bus io, memory io, hard disk IO, network card IO. Perhaps the first thing we think about when we mention the performance of a computer is CPU. But with the development of the computer, especially for modern processors, the operation speed is very fast, and our memory IO speed has reached a very fast point (almost 5G per second), and we know that the data are saved on the hard disk, So the computer actually first passes the data of the hard disk to the memory, then the CPU then loads the data from the memory to carry on the computation, therefore appears to affect the entire computer performance the factor is our hard disk IO speed. Let's take a look at the current popular drive types and speeds (data may be inaccurate, but almost)

Hard disk Type Speed
Sata <150m/s
Scsi <200m/s
Sas Around 200m/s
SSD Solid State Drive Around 500m/s

Our current PC is basically using SATA interface of the hard disk, read the speed of probably not more than 150m/s, write slower, and the production environment is basically the use of SAS (serial SCSI) hard disk, the fastest is SSD SSD, the speed is almost 4-5 times sata. But even with SSDs, the speed is around 500m/s, which is far less than our memory and CPU processing speed. Therefore, hard disk is the bottleneck of the performance of most computers. The flaw of modern disk is: I/O performance is very poor and the stability is very poor.

RAID Overview

I/O performance we have just seen, even if the use of SSD SSD, it will greatly affect the performance of the computer, the stability of the table now, if a hard disk failure or damage, then the hard disk can no longer be used, if it is very high data storage requirements, it is unthinkable. Because of this, a new technology--raid was born.

Redundant array of independent hard disks (RAID, redundant array of independent Disks), formerly redundant Array of inexpensive disks (redundant array of inexpensive Disks), referred to as hard disk array.

The basic idea is to combine a number of relatively inexpensive hard drives into a hard disk array to achieve even more expensive, large-capacity drives. RAID combines multiple hard disks into a single logical sector, so the operating system only treats it as a hard disk. RAID is often used on server computers and is often combined using exactly the same hard drive.

Criteria for RAID evaluation

① speed : Improved read and write speed

② disk Usage: multi-disk space utilization

③ Redundancy: capable of supporting several disk corruptions without losing data

RAID 0

It concatenates more than two disks and becomes a large-capacity disk. The number of hard disks it can merge is 2-32 hard disks, and the combined hard drive capacity is the sum of the capacity of each hard disk. For example, there are four hard drives, each hard disk capacity is 250GB, then the disk Striping array capacity is 1TB.

When it stores data to disk, it is fragmented (in bits or bytes) and stored on those disks. For example, to save an Excel document, the bit 1 of this document is written to disk 1, bit 2 is written to disk 2, bit 3 is written to disk 3, bit 4 is written to disk 4, and bit 5 is written to bit 1, so the loop goes on until the entire document is finished. Since both read and write can be processed in parallel, RAID 0 is the fastest at all levels. But RAID 0 is neither redundant nor fault-tolerant, and if one disk (physical) is damaged, all data is lost, and the entire raid is destroyed, with a high degree of risk.

Volume = Sum (S1, S2, S3,...)

① Space utilization: The sum of all hard disk space

② performance: the sum of Read and write speed of all hard drives

③ redundancy capability: None

RAID1

Disk mirroring means that multiple drives mirror each other, with the principle that the data is stored on the primary hard disk while the same data is written on the mirrored hard disk, and when the primary hard disk (physical) is damaged, the mirrored hard disk replaces the primary hard drive's work. The data security of RAID 1 is the best and most reliable for all raid levels because of a mirrored hard disk for data backup. RAID 1 supports hot-swappable, if a hard drive is broken, you can unplug it directly, and then hot plug in a new hard drive, the new hard disk will be a copy of the contents of another hard disk. In some multi-threaded operating system can have a good reading speed, the theoretical reading speed is equal to the number of hard disk multiples, but the write speed is slightly reduced. In addition, no matter how many disks do RAID 1, only one disk capacity, is the lowest level of disk utilization in all raid.

Volume = min (S1, S2, S3 ...)

① Space Utilization: the smallest chunk of all disks (in fact, when using RAID, it is best to have the same size and model for each drive)

② Performance: read performance is the sum of all drives, write performance is reduced. Hard drive write-down speed and low drive utilization

③ redundancy capability: as long as a hard drive is normal, the data is normal

RAID 2

This is a modified version of RAID 0, which encodes the data into separate bits in the form of Hamming code (Hamming code) and writes the data to the hard disk separately. Because the error correction code (ecc,error Correction code) is added to the data, the overall capacity of the data is larger than the original data.

RAID 3

Ddddddddddddddddddddddddd

RAID 4

Ddddddddddddddddddddddddd

RAID 5

RAID 5 can be understood as a compromise between RAID 0 and RAID 1, which takes into account storage performance, data security, and storage costs. RAID 5 requires at least 3 hard disks, which do not back up the stored data, but instead store the data and the corresponding parity information on each disk that makes up the RAID5, and the parity information and the corresponding data are stored on separate disks. When a RAID 5 disk data is damaged, the remaining data and the corresponding parity information can be used to recover the corrupted data.

RAID 5 provides data security for the system, but with a lower level of protection than mirroring and higher disk space utilization than mirroring. RAID 5 has a similar data read speed as RAID 0, just because a bit more parity information, the speed of writing data is slightly slower than writing a single hard disk, if the use of "write-back cache" can improve performance. And because multiple data corresponds to one parity message, RAID 5 has a higher disk space utilization than RAID 1 and is relatively inexpensive to store.

Volume = (N-1) * min (S1, S2, S3 ..., SN)

① Space utilization: 1-1/n

② Performance: read performance close to RAID0, write performance is weaker than RAID0

③ Redundancy capability: can accept damage from 1 hard drives

High disk capacity utilization (RAID 0 > RAID 5 > RAID 1)

Hard drive reads faster (RAID 0 > RAID 5 > RAID 1)

RAID 6

RAID6 requires at least 4 hard drives, RAID6 is similar to RAID5, and reads and writes data to and from all hard drives. When writing data RAID5 will be the data parity operation, and officer information also saved on the hard disk, but RAID6 will be more than RAID5 save a check information, so RAID6 redundancy than RAID5, can allow 2 hard disk damage.

① Space utilization: 1-2/n

② Performance: read performance close to RAID5, write performance is weaker than RAID5

③ Redundancy capability: can accept damage from 2 hard drives

RAID 10/01

RAID 10 is to mirror and then split the data, then divide all the hard disks into two groups, as the lowest combination of RAID 0, and then each of the two groups as RAID 1 operation.

Raid 01 is the reverse of a RAID 10 program, which splits and mirrors the data to two groups of hard disks. It divides all the hard drives into two groups, becoming the lowest combination of RAID 1, while the two groups of hard disks are considered RAID 0 respectively.

When RAID 10 has one hard drive damaged, the remaining drives will continue to function. Raid 01 only needs one hard drive to be damaged, all hard drives in the same group of RAID 0 will stop working, leaving only the other groups ' hard drives running with less reliability. If you build raid 01 with six hard disks, and then use three RAID 0 for mirroring, then one hard drive will have three hard drives offline. As a result, RAID 10 is much more common than raid 01, and most of the retail motherboard supports RAID 0/1/5/10, but does not support RAID 01.

It should be said that only RAID 5 is able to compete with RAID10, both of which are used extensively in different scenarios. RAID 10 is more secure than RAID 5, and when RAID 5 has a hard drive that is damaged, read performance is greatly degraded because the data on the hard drive can be computed with data and checksum on the other hard drives, so RAID 10 is generally selected when the database is stored. RAID 5 is much higher on disk utilization than RAID 10, so it is not particularly high on security requirements, such as file storage, where RAID 5 is generally used extensively. On the contrary, security requirements are high, regardless of cost, small data volumes are frequently written to a system that uses RAID 10 in a better way.

Four popular RAID types

RAID0, RAID1, RAID5, RAID6 are our most commonly used four levels, for personal PC, perhaps we most need to improve the performance of hard disk storage, so basically use RAID0, its read and write performance has been the biggest improvement, but its redundancy is 0, when the hard disk damage, The data is also damaged. In the production environment of the server, the most used is RAID5 or RAID6, which provides read and write performance, but also provides redundancy. RAID1 are often used in situations where the accuracy of the data is required and strictly.

Let's summarize the pros and cons of each of these 4 commonly used RAID levels:

RAID level Speed Redundancy of Disk Utilization
RAID 0 Improved reading and writing speed 0 The sum of all disks
RAID 1 Read Speed hints N A disk size
RAID 5 Improved reading and writing speed 1 1-1/n
RAID 6 Improved reading and writing speed 2 1-2/n
There are two ways to implement RAID

① Software RAID

RAID with system functions or RAID software, no independent hardware and interface, requires a certain amount of system resources (CPU, hard disk interface speed), and is affected by operating system stability

② Hardware RAID

With a separate RAID hardware card implementation, some motherboards integrated RAID hardware, some need to purchase a separate RAID hardware card, hardware RAID implementation does not need to occupy other hardware resources, stability and speed is stronger than software RAID, so for the server, It's best to use hardware RAID to improve your computer's performance

"Big Talk Storage 2" Reading notes--4th Beidou seven-Stars Big talk/detailed 7 kinds of raid

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.