Sergey Pakhomov

All modern motherboards are equipped with an integrated RAID controller, and top models even have several integrated RAID controllers. The extent to which integrated RAID controllers are in demand by home users is a separate question. In any case, a modern motherboard provides the user with the ability to create a RAID array of several disks. However, not every home user knows how to create a RAID array, what array level to choose, and generally has little idea of ​​the pros and cons of using RAID arrays.

History of creation

The term “RAID array” first appeared in 1987, when American researchers Patterson, Gibson and Katz from the University of California Berkeley in their article “A Case for Redundant Arrays of Inexpensive Discs, RAID” described how this way you can combine several cheap hard drives into a single logical device so that the resulting capacity and performance of the system are increased, and the failure of individual disks does not lead to failure of the entire system.

More than 20 years have passed since this article was published, but the technology of building RAID arrays has not lost its relevance today. The only thing that has changed since then is the decoding of the RAID acronym. The fact is that initially RAID arrays were not built on cheap disks at all, so the word Inexpensive (inexpensive) was changed to Independent (independent), which was more true.

Operating principle

So, RAID is a redundant array of independent disks (Redundant Arrays of Independent Discs), which is tasked with providing fault tolerance and increasing performance. Fault tolerance is achieved through redundancy. That is, part of the disk space capacity is allocated for official purposes, becoming inaccessible to the user.

Increased performance of the disk subsystem is ensured by the simultaneous operation of several disks, and in this sense, the more disks in the array (up to a certain limit), the better.

The joint operation of disks in an array can be organized using either parallel or independent access. With parallel access, disk space is divided into blocks (strips) for recording data. Similarly, information to be written to disk is divided into the same blocks. When writing, individual blocks are written to different disks, and multiple blocks are written to different disks simultaneously, which leads to increased performance in write operations. Necessary information it is also read in separate blocks simultaneously from several disks, which also increases performance in proportion to the number of disks in the array.

It should be noted that the parallel access model is implemented only if the size of the data write request is larger than the size of the block itself. Otherwise, parallel recording of several blocks is almost impossible. Let's imagine a situation where the size of an individual block is 8 KB, and the size of a request to write data is 64 KB. In this case, the source information is cut into eight blocks of 8 KB each. If you have a four-disk array, you can write four blocks, or 32 KB, at a time. Obviously, in the example considered, the write and read speeds will be four times higher than when using a single disk. This is only true for an ideal situation, but the request size is not always a multiple of the block size and the number of disks in the array.

If the size of the recorded data is less than the block size, then a fundamentally different model is implemented - independent access. Moreover, this model can also be used when the size of the data being written is larger than the size of one block. With independent access, all data from a single request is written to a separate disk, that is, the situation is identical to working with one disk. The advantage of the independent access model is that if several write (read) requests arrive simultaneously, they will all be executed on separate disks independently of each other. This situation is typical, for example, for servers.

In accordance with various types access, there are different types of RAID arrays, which are usually characterized by RAID levels. In addition to the type of access, RAID levels differ in the way they accommodate and generate redundant information. Redundant information can either be placed on a dedicated disk or distributed among all disks. There are many ways to generate this information. The simplest of them is complete duplication (100 percent redundancy), or mirroring. In addition, error correction codes are used, as well as parity calculations.

RAID levels

Currently, there are several RAID levels that can be considered standardized: RAID 0, RAID 1, RAID 2, RAID 3, RAID 4, RAID 5 and RAID 6.

Various combinations of RAID levels are also used, which allows you to combine their advantages. Typically this is a combination of some kind of fault-tolerant level and a zero level used to improve performance (RAID 1+0, RAID 0+1, RAID 50).

Note that all modern RAID controllers support the JBOD (Just a Bench Of Disks) function, which is not intended for creating arrays - it provides the ability to connect individual disks to the RAID controller.

It should be noted that the RAID controllers integrated on motherboards for home PCs do not support all RAID levels. Dual-port RAID controllers only support levels 0 and 1, while RAID controllers with more ports (for example, the 6-port RAID controller integrated into the southbridge of the ICH9R/ICH10R chipset) also support levels 10 and 5.

Moreover, if we talk about motherboards ah on Intel chipsets, they also implement the Intel Matrix RAID function, which allows you to create hard drives x simultaneously RAID matrices of several levels, allocating part of the disk space for each of them.

RAID 0

RAID level 0, strictly speaking, is not a redundant array and, accordingly, does not provide reliable data storage. Nevertheless this level actively used in cases where it is necessary to ensure high performance of the disk subsystem. When creating a RAID level 0 array, information is divided into blocks (sometimes these blocks are called stripes), which are written to separate disks, that is, a system with parallel access is created (if, of course, the block size allows it). By allowing simultaneous I/O from multiple disks, RAID 0 provides the fastest data transfer speeds and maximum disk space efficiency because no storage space is required for checksums. The implementation of this level is very simple. RAID 0 is mainly used in areas where fast transfer of large amounts of data is required.

RAID 1 (Mirrored disk)

RAID Level 1 is an array of two disks with 100 percent redundancy. That is, the data is simply completely duplicated (mirrored), due to which very high level reliability (as well as cost). Note that to implement level 1, it is not necessary to first partition the disks and data into blocks. In the simplest case, two disks contain the same information and are one logical disk. If one disk fails, its functions are performed by another (which is absolutely transparent to the user). Restoring an array is performed by simple copying. In addition, this level doubles the speed of reading information, since this operation can be performed simultaneously from two disks. This type of information storage scheme is used mainly in cases where the cost of data security is much higher than the cost of implementing a storage system.

RAID 5

RAID 5 is a fault-tolerant disk array with distributed checksum storage. When recording, the data stream is divided into blocks (stripes) at the byte level and simultaneously written to all disks of the array in cyclic order.

Suppose the array contains n disks, and the stripe size d. For each portion of n-1 stripes, the checksum is calculated p.

Stripe d1 recorded on the first disk, stripe d2- on the second and so on up to the stripe dn-1, which is written to ( n-1)th disk. Next on n-disk checksum is written pn, and the process is repeated cyclically from the first disk on which the stripe is written dn.

Recording process (n-1) stripes and their checksum are produced simultaneously for all n disks.

The checksum is calculated using a bitwise exclusive-or (XOR) operation applied to the data blocks being written. So, if there is n hard drives, d- data block (stripe), then the checksum is calculated using the following formula:

pn = d1+d2+ ... + d1-1.

If any disk fails, the data on it can be restored using the control data and the data remaining on the working disks.

As an illustration, consider blocks of four bits. Let there be only five disks for storing data and recording checksums. If there is a sequence of bits 1101 0011 1100 1011, divided into blocks of four bits, then to calculate the checksum it is necessary to perform the following bitwise operation:

1101 + 0011 + 1100 + 1011 = 1001.

Thus, the checksum written to the fifth disk is 1001.

If one of the disks, for example the fourth, fails, then the block d4= 1100 will not be available when reading. However, its value can be easily restored using the checksum and the values ​​of the remaining blocks using the same “exclusive OR” operation:

d4 = d1+d2+d4+p5.

In our example we get:

d4 = (1101) + (0011) + (1100) + (1011) = 1001.

In the case of RAID 5, all disks in the array are the same size, but the total capacity of the disk subsystem available for writing becomes exactly one disk smaller. For example, if five disks are 100 GB in size, then the actual size of the array is 400 GB because 100 GB is allocated for control information.

RAID 5 can be built on three or more hard drives. As the number of hard drives in an array increases, its redundancy decreases.

RAID 5 has an independent access architecture, which allows multiple reads or writes to be performed simultaneously

RAID 10

RAID level 10 is a combination of levels 0 and 1. The minimum requirement for this level is four drives. In a RAID 10 array of four drives, they are combined in pairs into level 0 arrays, and both of these arrays as logical drives are combined into a level 1 array. Another approach is also possible: initially the disks are combined into mirrored arrays of level 1, and then logical drives based on these arrays — to the level 0 array.

Intel Matrix RAID

The considered RAID arrays of levels 5 and 1 are rarely used at home, which is primarily due to the high cost of such solutions. Most often, for home PCs, a level 0 array on two disks is used. As we have already noted, RAID level 0 does not provide secure data storage, and therefore end users are faced with a choice: create a fast, but not reliable data storage RAID level 0 array, or, doubling the cost of disk space, RAID- a level 1 array that provides reliable data storage, but does not provide significant performance benefits.

To solve this difficult problem, Intel developed Intel Matrix Storage Technology, which combines the benefits of Tier 0 and Tier 1 arrays on just two physical disks. And in order to emphasize that in this case we are not just talking about a RAID array, but about an array that combines both physical and logical disks, the word “matrix” is used in the name of the technology instead of the word “array”.

So, what is a two-disk RAID matrix using Intel Matrix Storage technology? The basic idea is that if the system has multiple hard drives and a motherboard with Intel chipset, supporting Intel Matrix Storage technology, it is possible to divide the disk space into several parts, each of which will function as a separate RAID array.

Let's look at a simple example of a RAID matrix consisting of two disks of 120 GB each. Any of the disks can be divided into two logical disks, for example 40 and 80 GB. Next, two logical drives of the same size (for example, 40 GB each) can be combined into a RAID level 1 matrix, and the remaining logical drives into a RAID level 0 matrix.

In principle, using two physical disks, it is also possible to create just one or two RAID level 0 matrices, but it is impossible to obtain only level 1 matrices. That is, if the system has only two disks, then Intel technology Matrix Storage allows you to create the following types of RAID matrices:

  • one level 0 matrix;
  • two level 0 matrices;
  • level 0 matrix and level 1 matrix.

If the system has three hard drives, the following types of RAID matrices can be created:

  • one level 0 matrix;
  • one level 5 matrix;
  • two level 0 matrices;
  • two level 5 matrices;
  • level 0 matrix and level 5 matrix.

If the system has four hard drives, then it is additionally possible to create a RAID matrix of level 10, as well as combinations of level 10 and level 0 or 5.

Now let's see what types there are and how they differ.

The University of California at Berkeley introduced the following levels of the RAID specification, which have been adopted as the de facto standard:

  • RAID 0- high-performance disk array with striping, without fault tolerance;
  • - mirrored disk array;
  • RAID 2 reserved for arrays that use Hamming code;
  • RAID 3 and 4- disk arrays with striping and a dedicated parity disk;
  • - disk array with striping and “unallocated parity disk”;
  • - striped disk array using two checksums, calculated in two independent ways;
  • - RAID 0 array built from RAID 1 arrays;
  • - RAID 0 array built from RAID 5 arrays;
  • - RAID 0 array built from RAID 6 arrays.

A hardware RAID controller can support several different RAID arrays simultaneously, the total number of hard drives of which does not exceed the number of connectors for them. In this case, the controller built into the motherboard BIOS settings has only two states (enabled or disabled), so a new hard drive connected to an unused controller connector with RAID mode activated can be ignored by the system until it is associated as another JBOD (spanned) RAID array consisting of a single disk .

RAID 0 (striping - “alternation”)

The mode used to achieve maximum performance. The data is evenly distributed across the disks of the array; the disks are combined into one, which can be divided into several. Distributed read and write operations can significantly increase operating speed, since several disks simultaneously read/write their portion of data. The user has access to the entire volume of disks, but this reduces the reliability of data storage, since if one of the disks fails, the array is usually destroyed and data recovery is almost impossible. Scope of application - applications that require high speeds of exchange with the disk, for example video capture, video editing. Recommended for use with highly reliable drives.

(mirroring - “mirroring”)

an array of two disks that are complete copies of each other. Not to be confused with RAID 1+0, RAID 0+1, and RAID 10 arrays, which use more than two drives and more complex mirroring mechanisms.

Provides acceptable write speed and gains in read speed when parallelizing queries.

It has high reliability - it works as long as at least one disk in the array is functioning. The probability of failure of two disks at once is equal to the product of the probabilities of failure of each disk, i.e. significantly lower than the probability of failure of an individual disk. In practice, if one of the disks fails, immediate action must be taken to restore redundancy. To do this, it is recommended to use hot spare disks with any RAID level (except zero).

A variant of data distribution across disks, similar to RAID10, which allows the use of an odd number of disks (minimum number - 3)

RAID 2, 3, 4

various distributed data storage options with disks allocated for parity codes and different block sizes. Currently, they are practically not used due to low performance and the need to allocate a lot of disk capacity for storing ECC and/or parity codes.

The main disadvantage of RAID levels 2 to 4 is the inability to perform parallel write operations, since a separate control disk is used to store parity information. RAID 5 does not have this disadvantage. Data blocks and checksums are cyclically written to all disks of the array; there is no asymmetry in the disk configuration. Checksums mean the result of an XOR (exclusive or) operation. Xor has a feature that makes it possible to replace any operand with the result, and by applying the algorithm xor, get the missing operand as a result. For example: a xor b = c(Where a, b, c- three disks of the raid array), in case a refuses, we can get him by putting him in his place c and after spending xor between c And b: c xor b = a. This applies regardless of the number of operands: a xor b xor c xor d = e. If it refuses c Then e takes his place and holding xor as a result we get c: a xor b xor e xor d = c. This method essentially provides version 5 fault tolerance. To store the result of xor, only 1 disk is required, the size of which is equal to the size of any other disk in the raid.

Advantages

RAID5 has become widespread, primarily due to its cost-effectiveness. Volume disk array RAID5 is calculated using the formula (n-1)*hddsize, where n is the number of disks in the array, and hddsize is the size of the smallest disk. For example, for an array of four 80 gigabyte disks, the total volume will be (4 - 1) * 80 = 240 gigabytes. Writing information to a RAID 5 volume requires additional resources and performance decreases, since additional calculations and write operations are required, but when reading (compared to a separate hard drive), there is a gain because data streams from several disks in the array can be processed in parallel.

Flaws

The performance of RAID 5 is noticeably lower, especially on operations such as Random Write, in which performance drops by 10-25% of the performance of RAID 0 (or RAID 10), since it requires more disk operations (each operation writes, with the exception of the so-called full-stripe writes, the server is replaced on the RAID controller by four - two read operations and two write operations). The disadvantages of RAID 5 appear when one of the disks fails - the entire volume goes into critical mode (degrade), all write and read operations are accompanied by additional manipulations, and performance drops sharply. In this case, the reliability level is reduced to the reliability of RAID-0 with the corresponding number of disks (that is, n times lower than the reliability of a single disk). If before full recovery If the array fails, or an unrecoverable read error occurs on at least one more disk, then the array is destroyed and the data on it cannot be restored by conventional methods. It should also be taken into account that the process of RAID Reconstruction (recovery of RAID data through redundancy) after a disk failure causes an intensive read load from the disks for many hours continuously, which can cause the failure of any of the remaining disks in the least protected period of RAID operation, as well as identify previously undetected read failures in cold data arrays (data that is not accessed when regular work array, archived and inactive data), which increases the risk of failure during data recovery.

The minimum number of disks used is three.

RAID 6 - similar to RAID 5, but has more high degree reliability - the capacity of 2 disks is allocated for checksums, 2 sums are calculated using different algorithms. Requires a more powerful RAID controller. Ensures operation after the simultaneous failure of two disks - protection against multiple failures. A minimum of 4 disks are required to organize the array. Typically, using RAID-6 causes about a 10-15% drop in disk group performance relative to RAID 5, which is caused by the large amount of processing for the controller (the need to calculate a second checksum, as well as read and rewrite more disk blocks when writing each block).

RAID 0+1

RAID 0+1 can mean basically two options:

  • two RAID 0 are combined into RAID 1;
  • three or more disks are combined into an array, and each data block is written to two disks of this array; Thus, with this approach, as in “pure” RAID 1, the useful volume of the array is half of the total volume of all disks (if these are disks of the same capacity).

RAID 10 (1+0)

RAID 10 is a mirrored array in which data is written sequentially onto several disks, like RAID 0. This architecture is an array of the RAID 0 type, the segments of which are RAID 1 arrays instead of individual disks. Accordingly, an array of this level must contain at least 4 disks ( and always an even number). RAID 10 combines high fault tolerance and performance.

The assertion that RAID 10 is the most reliable option for data storage is quite justified by the fact that the array will be disabled after the failure of all drives in the same array. If one drive fails, the chance of failure of the second one in the same array is 1/3*100=33%. RAID 0+1 will fail if two drives fail in different arrays. The chance of failure of a drive in a neighboring array is 2/3*100=66%, however, since a drive in an array with an already failed drive is no longer used, the chance that the next drive will fail the entire array is 2/2 *100=100%

an array similar to RAID5, however, in addition to distributed storage of parity codes, the distribution of reserve areas is used - in fact, it is used HDD, which can be added to a RAID5 array as a spare (such arrays are called 5+ or 5+spare). In a RAID 5 array, the backup disk is idle until one of the main hard drives fails, while in a RAID 5EE array, this disk is shared with the rest of the HDDs all the time, which has a positive effect on the performance of the array. For example, a RAID5EE array of 5 HDDs will be able to perform 25% more I/O operations per second than a RAID5 array of 4 primary and one backup HDD. The minimum number of disks for such an array is 4.

combining two (or more, but this is extremely rarely used) RAID5 arrays into a stripe, i.e. a combination of RAID5 and RAID0, which partially corrects the main disadvantage of RAID5 - the low data writing speed due to the parallel use of several such arrays. The total capacity of the array is reduced by the capacity of two disks, but, unlike RAID6, such an array can tolerate the failure of only one disk without data loss, and the minimum required number of disks to create a RAID50 array is 6. Along with RAID10, this is the most recommended RAID level to use in applications where high performance combined with acceptable reliability is required.

combining two RAID6 arrays into a stripe. The write speed is approximately doubled compared to the write speed in RAID6. The minimum number of disks to create such an array is 8. Information is not lost if two disks from each RAID 6 array fail

RAID 00


RAID 00 is very rare; I came across it on LSI controllers. RAID 00 disk group is a composite group of disks that creates a striped set of
disk arrays RAID 0. RAID 00 does not provide data redundancy, but along with RAID 0, offers better performance any RAID level. RAID 00 breaks data into smaller segments and then stripes the data segments on each drive in the storage group. The size of each data segment is determined by the stripe size. RAID 00 offers high throughput. RAID level 00 is not fault tolerant. If a disk in a RAID 0 disk group fails, the entire
virtual disk (all disks associated with virtual disk) will fail. Smashing large file into smaller segments, the RAID controller can use both SAS
controller to read or write a file faster. RAID 00 does not assume parity; calculations complicate write operations. This makes RAID 00 ideal for
applications that require high bandwidth, but do not require fault tolerance. Can consist of from 2 to 256 disks.

Which is faster RAID 0 or RAID 00?


I conducted my testing described in the article about optimizing the speed of solid-state drives on LSI controllers and got these numbers on arrays of 6 SSDs

There are a lot of articles on the Internet describing RAID. For example, this one describes everything in great detail. But as usual, there is not enough time to read everything, so you need something short to understand - whether it is necessary or not, and what is better to use in relation to working with a DBMS (InterBase, Firebird or something else - it really doesn’t matter). Before your eyes is exactly such material.

To a first approximation, RAID is a combination of disks into one array. SATA, SAS, SCSI, SSD - it doesn't matter. Moreover, almost every normal motherboard now supports SATA RAID. Let's go through the list of what RAIDs are and why they are. (I would like to immediately note that in a RAID you need to combine identical disks. Combining disks from different manufacturers, from the same but different types, or different sizes is pampering for a person sitting on a home computer).

RAID 0 (Stripe)

Roughly speaking, this is a sequential combination of two (or more) physical disks into one “physical” disk. It is only suitable for organizing huge disk spaces, for example, for those who work with video editing. There is no point in keeping databases on such disks - in fact, even if your database is 50 gigabytes in size, then why did you buy two disks of 40 gigabytes each, and not 1 by 80 gigabytes? The worst thing is that in RAID 0, any failure of one of the disks leads to the complete inoperability of such RAID, because data is written alternately to both disks, and accordingly, RAID 0 has no means of recovery in case of failures.

Of course, RAID 0 provides faster performance due to read/write striping.

RAID 0 is often used to host temporary files.

RAID 1 (Mirror)

Disk mirroring. If Shadow in IB/FB is software mirroring (see Operations Guide.pdf), then RAID 1 is hardware mirroring, and nothing more. Forbid you from using software mirroring using OS tools or third-party software. You need either an “iron” RAID 1 or shadow.

If a failure occurs, carefully check which disk has failed. The most common case of data loss on RAID 1 is incorrect actions during recovery (the wrong disk is specified as the “whole”).

As for performance - the gain for writing is 0, for reading - perhaps up to 1.5 times, since reading can be done "in parallel" (alternately with different disks) . For databases, the acceleration is small, while when accessing different (!) parts (files) of the disk in parallel, the acceleration will be absolutely accurate.

RAID 1+0

By RAID 1+0 they mean the RAID 10 option, when two RAID 1s are combined into RAID 0. The option when two RAID 0s are combined into RAID 1 is called RAID 0+1, and “outside” it is the same RAID 10.

RAID 2-3-4

These RAIDs are rare because they use Hamming codes, or byte blocking + checksums, etc., but the general summary is that these RAIDs only provide reliability, with a 0-performance increase, and sometimes even its deterioration.

RAID 5

It requires a minimum of 3 disks. Parity data is distributed across all disks in the array

It is commonly said that "RAID5 uses independent disk access so that requests to different disks can be executed in parallel." It should be kept in mind that we are, of course, talking about parallel I/O requests. If such requests go sequentially (in SuperServer), then of course you will not get the effect of parallelizing access on RAID 5. Of course, RAID5 will give a performance boost if the array is worked with operating system and other applications (for example, it will contain virtual memory, TEMP, etc.).

In general, RAID 5 used to be the most commonly used disk array for working with DBMSs. Now such an array can be organized on SATA drive x, and it will be significantly cheaper than SCSI. You can see prices and controllers in the articles
Moreover, you should pay attention to the volume of purchased disks - for example, in one of the mentioned articles, RAID5 is assembled from 4 disks with a capacity of 34 gigabytes, while the volume of the “disk” is 103 gigabytes.

Testing five SATA controllers RAID - http://www.thg.ru/storage/20051102/index.html.

Adaptec SATA RAID 21610SA in RAID 5 arrays - http://www.ixbt.com/storage/adaptec21610raid5.shtml.

Why RAID 5 is bad - https://geektimes.ru/post/78311/

Attention! When purchasing disks for RAID5, they usually take 3 disks, at a minimum (most likely because of the price). If suddenly, over time, one of the disks fails, then a situation may arise when it is not possible to purchase a disk similar to the ones used (no longer produced, temporarily out of stock, etc.). Therefore, a more interesting idea seems to be purchasing 4 disks, organizing a RAID5 of three, and connecting the 4th disk as a backup (for backups, other files and other needs).

The volume of a RAID5 disk array is calculated using the formula (n-1)*hddsize, where n is the number of disks in the array, and hddsize is the size of one disk. For example, for an array of 4 disks of 80 gigabytes, the total volume will be 240 gigabytes.

There is a question about the “unsuitability” of RAID5 for databases. At a minimum, it can be viewed from the point of view that to get good RAID5 performance, you need to use a specialized controller, and not what is included by default on the motherboard.

Article RAID-5 must die. And more about data loss on RAID5.

Note. As of 09/05/2005, the cost of a Hitachi 80Gb SATA drive is $60.

RAID 10, 50

Next come combinations of the listed options. For example, RAID 10 is RAID 0 + RAID 1. RAID 50 is RAID 5 + RAID 0.

Interestingly, the RAID 0+1 combination turns out to be worse in terms of reliability than RAID5. The database repair service has a case of one disk failure in the RAID0 (3 disks) + RAID1 (3 more of the same disks) system. At the same time, RAID1 could not “raise” the backup disk. The base turned out to be damaged without any chance of repair.

RAID 0+1 requires 4 drives, and RAID 5 requires 3. Think about it.

RAID 6

Unlike RAID 5, which uses parity to protect data against single faults, RAID 6 uses the same parity to protect against double faults. Accordingly, the processor is more powerful than in RAID 5, and not 3, but at least 5 disks are required (three data disks and 2 parity disks). Moreover, the number of disks in raid6 does not have the same flexibility as in raid 5, and must be equal to a simple number (5, 7, 11, 13, etc.)

Let's say two disks fail at the same time, but such a case is very rare.

I haven’t seen any data on RAID 6 performance (I haven’t looked), but it may well be that due to redundant control, performance could be at the level of RAID 5.

Rebuild time

Any RAID array that remains operational if one drive fails has a concept called rebuild time. Of course, when you replace a dead disk with a new one, the controller must organize the functioning of the new disk in the array, and this will take some time.

When “connecting” a new disk, for example, for RAID 5, the controller can allow operation of the array. But the speed of the array in this case will be very low, at least because even if the new disk is “linearly” filled with information, writing to it will “distract” the controller and disk heads from synchronizing operations with the rest of the disks of the array.

The time it takes to restore the array to normal operation directly depends on the disk capacity. For example, Sun StorEdge 3510 FC Array with an array size of 2 terabytes in exclusive mode does a rebuild within 4.5 hours (at a hardware price of about $40,000). Therefore, when organizing an array and planning disaster recovery, you need to first of all think about rebuild time. If your database and backups occupy no more than 50 gigabytes, and the growth per year is 1-2 gigabytes, then it hardly makes sense to assemble an array of 500 gigabyte disks. 250 GB will be enough, and even for raid5 this will be at least 500 GB of space to accommodate not only the database, but also movies. But the rebuild time for 250 GB disks will be approximately 2 times less than for 500 GB disks.

Summary

It turns out that the most meaningful thing is to use either RAID 1 or RAID 5. However, the most common mistake, which almost everyone does is to use RAID “for everything”. That is, they install a RAID, pile everything they have on it, and... they get reliability at best, but no performance improvement.

Write cache is also often not enabled, as a result of which writing to a raid is slower than writing to a regular single disk. The fact is that for most controllers this option is disabled by default, because... It is believed that to enable it, it is desirable to have at least a battery on the raid controller, as well as the presence of a UPS.

Text
The old hddspeed.htmLINK article (and doc_calford_1.htmLINK) shows how you can get significant performance gains by using multiple physical disks, even for an IDE. Accordingly, if you organize a RAID, put the base on it, and do the rest (temp, OS, virtual disk) on other hard drives. After all, all the same, RAID itself is one “disk”, even if it is more reliable and fast.
declared obsolete. All of the above has a right to exist on RAID 5. However, before such placement, you need to find out how you can backup/restore the operating system, and how long it will take, how long it will take to restore a “dead” disk, whether there is (will be) ) a disk is at hand to replace the “dead” one, and so on, i.e. you will need to know in advance the answers to the most basic questions in case of a system failure.

I still advise keeping the operating system on a separate SATA drive, or, if you prefer, on two SATA drives connected in RAID 1. In any case, placing the operating system on a RAID, you must plan your actions if the motherboard suddenly stops working board - sometimes transferring raid array disks to another motherboard (chipset, raid controller) is impossible due to incompatibility of default raid parameters.

Placement of the base, shadow and backup

Despite all the advantages of RAID, it is strictly not recommended, for example, to make a backup to the same logical drive. Not only does this have a bad effect on performance, but it can also lead to problems with the lack of free space (on large databases) - after all, depending on the data, the backup file can be equivalent to the size of the database, and even larger. Making a backup to the same physical disk is a no-brainer, although the best option is to backup to a separate hard drive.

The explanation is very simple. Backup is reading data from a database file and writing to a backup file. If all of this is physically happening on one drive (even RAID 0 or RAID 1), then performance will be worse than if reading from one drive and writing to another. The benefit from this separation is even greater when backup is done while users are working with the database.

The same applies to shadow - there is no point in putting shadow, for example, on RAID 1, in the same place as the database, even on different logical drives. If shadow is present, the server writes data pages to both the database file and the shadow file. That is, instead of one write operation, two are performed. When dividing the base and shadow across different physical disks, write performance will be determined by the slowest disk.

Today we will talk about RAID arrays. Let's figure out what it is, why we need it, what it is like and how to use all this magnificence in practice.

So, in order: what is RAID array or simply RAID? This abbreviation stands for "Redundant Array of Independent Disks" or "redundant (backup) array of independent disks." To put it simply, RAID array this is a collection of physical disks combined into one logical disk.

It usually happens the other way around - in system unit one physical disk is installed, which we split into several logical ones. Here the situation is the opposite - several hard drives are first combined into one, and then the operating system is perceived as one. Those. The OS firmly believes that it physically only has one disk.

RAID arrays There are hardware and software.

Hardware RAID arrays are created before the OS boots via special utilities, hardwired into RAID controller- something like a BIOS. As a result of creating such RAID array already at the OS installation stage, the distribution kit “sees” one disk.

Software RAID arrays created by OS tools. Those. during boot, the operating system “understands” that it has several physical disks and only after the OS starts, through software disks are combined into arrays. Naturally, the operating system itself is not located on RAID array, since it is installed before it is created.

"Why is all this needed?" - you ask? The answer is: to increase the speed of reading/writing data and/or increase fault tolerance and security.

"How RAID array can increase speed or secure data?" - to answer this question, consider the main types RAID arrays, how they are formed and what it gives as a result.

RAID-0. Also called "Stripe" or "Tape". Two or more hard drives are combined into one by sequential merging and summing up the volumes. Those. if we take two 500GB disks and create them RAID-0, the operating system will perceive this as one terabyte disk. At the same time, the read/write speed of this array will be twice as high as that of one disk, since, for example, if the database is physically located in this way on two disks, one user can read data from one disk, and another user can write to another disk at the same time. Whereas, if the database is located on one disk, the hard disk itself will perform read/write tasks of different users sequentially. RAID-0 will allow reading/writing in parallel. As a consequence, the more disks in the array RAID-0, the faster the array itself works. The dependence is directly proportional - the speed increases N times, where N is the number of disks in the array.
At the array RAID-0 there is only one drawback that outweighs all the advantages of using it - the complete lack of fault tolerance. If one of the physical disks of the array dies, the entire array dies. There's an old joke about this: "What does the '0' in the title mean? RAID-0? - the amount of information restored after the death of the array!"

RAID-1. Also called "Mirror" or "Mirror". Two or more hard drives are combined into one by parallel merging. Those. if we take two 500GB disks and create them RAID-1, the operating system will perceive this as one 500GB disk. In this case, the read/write speed of this array will be the same as that of one disk, since information is read/written to both disks simultaneously. RAID-1 does not provide a gain in speed, but provides greater fault tolerance, since in the event of the death of one of the hard drives, there is always a complete duplicate of information located on the second drive. It must be remembered that fault tolerance is provided only against the death of one of the array disks. If the data was deleted purposefully, it is deleted from all disks of the array simultaneously!

RAID-5. A more secure option for RAID-0. The volume of the array is calculated using the formula (N - 1) * DiskSize RAID-5 from three 500GB disks, we get an array of 1 terabyte. The essence of the array RAID-5 is that several disks are combined into RAID-0, and the last disk stores the so-called “checksum” - service information intended to restore one of the array disks in the event of its death. Array write speed RAID-5 somewhat lower, since time is spent calculating and writing the checksum to a separate disk, but the reading speed is the same as in RAID-0.
If one of the array disks RAID-5 dies, the read/write speed drops sharply, since all operations are accompanied by additional manipulations. Actually RAID-5 turns into RAID-0 and if recovery is not taken care of in a timely manner RAID array there is a significant risk of losing data completely.
With an array RAID-5 You can use the so-called Spare disk, i.e. spare. During stable operation RAID array This disk is idle and not used. However, in the event of a critical situation, recovery RAID array starts automatically - information from the damaged one is restored to the spare disk using checksums located on a separate disk.
RAID-5 is created from at least three disks and saves from single errors. If different errors appear simultaneously on different drives RAID-5 doesn't save.

RAID-6- is an improved version of RAID-5. The essence is the same, only for checksums, not one, but two disks are used, and the checksums are calculated using different algorithms, which significantly increases the fault tolerance of everything RAID array generally. RAID-6 assembled from at least four disks. The formula for calculating the volume of an array looks like (N - 2) * DiskSize, where N is the number of disks in the array, and DiskSize is the size of each disk. Those. while creating RAID-6 from five 500GB disks, we get an array of 1.5 terabytes.
Write speed RAID-6 lower than RAID-5 by about 10-15%, which is due to additional time spent on calculating and writing checksums.

RAID-10- also sometimes called RAID 0+1 or RAID 1+0. It is a symbiosis of RAID-0 and RAID-1. The array is built from at least four disks: on the first RAID-0 channel, on the second RAID-0 to increase read/write speed, and between them in a RAID-1 mirror to increase fault tolerance. Thus, RAID-10 combines the advantages of the first two options - fast and fault-tolerant.

RAID-50- similarly, RAID-10 is a symbiosis of RAID-0 and RAID-5 - in fact, RAID-5 is built, only its constituent elements are not independent hard disks, and the arrays are RAID-0. Thus, RAID-50 gives very good speed read/write and contains the resilience and reliability of RAID-5.

RAID-60- the same idea: we actually have RAID-6, assembled from several RAID-0 arrays.

There are also other combined arrays RAID 5+1 And RAID 6+1- they look like RAID-50 And RAID-60 the only difference is that the basic elements of the array are not RAID-0 tapes, but RAID-1 mirrors.

How do you understand combined RAID arrays: RAID-10, RAID-50, RAID-60 and options RAID X+1 are direct heirs basic types arrays RAID-0, RAID-1, RAID-5 And RAID-6 and serve only to increase either read/write speed or increase fault tolerance, while carrying the functionality of basic, parent types RAID arrays.

If we move on to practice and talk about the use of certain RAID arrays in life, the logic is quite simple:

RAID-0 We do not use it in its pure form at all;

RAID-1 We use it where read/write speed is not particularly important, but fault tolerance is important - for example, on RAID-1 It’s good to install operating systems. In this case, no one except the OS accesses the disks, the speed of the hard disks themselves is quite sufficient for operation, fault tolerance is ensured;

RAID-5 We install it where speed and fault tolerance are needed, but there is not enough money to buy more hard drives or there is a need to restore arrays in case of damage without stopping work - spare Spare drives will help us here. Common Application RAID-5- data storage;

RAID-6 used where it is simply scary or there is a real threat of death of several disks in the array at once. In practice it is quite rare, mainly among paranoid people;

RAID-10- used where it is necessary to work quickly and reliably. Also the main direction for use RAID-10 are file servers and database servers.

Again, if we simplify it further, we come to the conclusion that where there is no large and voluminous work with files, it is quite enough RAID-1- operating system, AD, TS, mail, proxy, etc. Where serious work with files is required: RAID-5 or RAID-10.

The ideal solution for a database server is a machine with six physical disks, two of which are combined into a mirror RAID-1 and the OS is installed on it, and the remaining four are combined into RAID-10 for fast and reliable data processing.

If, after reading all of the above, you decide to install it on your servers RAID arrays, but don’t know how to do it and where to start - contact us! - we will help you select the necessary equipment, as well as carry out installation work for implementation RAID arrays.

RAID arrays were developed to improve data storage reliability, increase processing speed, and provide the ability to combine multiple disks into one large one. Different types RAIDs solve different problems, here we will look at several of the most common configurations of RAID arrays of the same size.



RAID 0

  • RAID 0(Stripe). The mode that achieves maximum performance. The data is evenly distributed across the array disks and combined into one, which can be divided into several. Distributed read and write operations can significantly increase operating speed, since several simultaneously read/write their portion of data. The entire volume is available to the user, but this reduces the reliability of data storage, since if one of the disks fails, the array is usually destroyed and it is almost impossible to restore the data. Scope of application - applications that require high speeds of exchange with the disk, for example video capture, video editing. Recommended for use with highly reliable drives.

    RAID 1
  • RAID 1(Mirror). Several disks (usually 2), working synchronously for recording, that is, completely duplicating each other. The performance improvement occurs only when reading. The most reliable way to protect information from failure of one of the disks. Due to its high cost, it is usually used when storing very important data. The high cost is due to the fact that only half of the total capacity is available to the user.

    RAID 10
  • RAID 10, also sometimes called RAID 1+0- a combination of the first two options. (RAID0 array from RAID1 arrays). It has all the speed advantages of RAID0 and the reliability advantage of RAID1, while maintaining the disadvantage of the high cost of the disk array, since the effective capacity of the array is equal to half the capacity of the disks used in it. To create such an array, a minimum of 4 disks is required. (In this case, their number must be even).
  • RAID 0+1- RAID1 array from RAID0 arrays. In fact, it is not used due to the lack of advantages compared to RAID10 and lower fault tolerance.

    RAID 1E
  • RAID 1E- An option similar to RAID10 for distributing data across disks, allowing the use of an odd number (minimum number - 3)
  • RAID 2, 3, 4- various options for distributed data storage with disks allocated for parity codes and different block sizes. Currently, they are practically not used due to low performance and the need to allocate a lot of disk capacity for storing ECC and/or parity codes.


    RAID 5
  • RAID 5- an array that also uses distributed data storage similar to RAID 0 (and combining into one large logical one) + distributed storage of parity codes for data recovery in case of failures. Compared to previous configurations, the Stripe block size has been increased even more. Both simultaneous reading and writing are possible. The advantage of this option is that the array capacity available to the user is reduced by the capacity of only one disk, although the reliability of data storage is lower than that of RAID 1. In fact, it is a compromise between RAID0 and RAID1, providing a fairly high speed of operation with good data storage reliability . If one disk in the array fails, data can be restored without loss of data. automatic mode. The minimum number of disks for such an array is 3.
    "Software" implementations of RAID5 built into the south bridges of motherboards are no different high speed records, so they are not suitable for all applications.


    RAID 5EE
  • RAID 5EE- an array similar to RAID5, however, in addition to distributed storage of parity codes, the distribution of spare areas is used - in fact, it is used, which can be added to the RAID5 array as a spare (such arrays are called 5+ or 5+spare). In a RAID 5 array, the backup disk is idle until one of the main ones fails, while in a RAID 5EE array this disk is used together with the rest of the HDDs all the time, which has a positive effect on the performance of the array. For example, a RAID5EE array of 5 HDDs will be able to perform 25% more I/O operations per second than a RAID5 array of 4 primary and one backup HDD. The minimum number of disks for such an array is 4.


    RAID 6
  • RAID 6- an analogue of RAID5 with a high level of redundancy - information is not lost if any two disks fail; accordingly, the total capacity of the array is reduced by the capacity of two disks. The minimum number of disks required to create an array of this level is 4. The operating speed in the general case is approximately the same as RAID5. Recommended for applications where the highest possible reliability is important.


    RAID 50
  • RAID 50- combining two (or more, but this is extremely rarely used) RAID5 arrays into a stripe, i.e. a combination of RAID5 and RAID0, which partially corrects the main disadvantage of RAID5 - the low data writing speed due to the parallel use of several such arrays. The total capacity of the array is reduced by the capacity of two, but, unlike RAID6, such an array can withstand the failure of only one disk without data loss, and the minimum required number of disks to create a RAID50 array is 6. Along with RAID10, this is the most recommended RAID level for use in applications where high performance combined with acceptable reliability is required.


    RAID 60
  • RAID 60- combining two RAID6 arrays into a stripe. The write speed is approximately doubled compared to the write speed in RAID6. The minimum number of disks to create such an array is 8. Information is not lost if two disks from each RAID 6 array fail.
  • Matrix RAID- technology implemented by Intel in its southern bridges, starting with ICH6R, which allows you to organize several RAID0 and RAID1 arrays on just two disks, while simultaneously creating partitions with both increased operating speed and increased data storage reliability.
  • JBOD(From the English "Just a Bunch Of Disks") - sequential combination of several physical ones into one logical one, which does not affect performance (reliability drops similarly to RAID0), and can have different sizes. Currently practically not used.