Using Multiple Hard Drives for Performance and Reliability
IntroductionBack in the late 1980's and early 1990's, computer information servers were encountering a dramatic increase in the amount of data they needed to serve and store. Storage technologies were getting very expensive to place a large number of high capacity hard drives in the servers. A solution was needed and thus RAID was born.
So what exactly is RAID? First of all, the acronym stands for Redundant Array of Inexpensive Disks. It was a system developed whereby a large number of low cost hard drives could be linked together to form a single large capacity storage device that offered superior performance, storage capacity and reliability over older storage solutions. It has been widely used and deployed method for storage in the enterprise and server markets, but over the past 5 years has become much more common in end user systems.
Advantages of RAID
There are three primary reasons that RAID was implemented:
- Redundancy
- Increased Performance
- Lower Costs
The increased performance is only found when specific versions of the RAID are used. Performance will also be dependent upon the number of drives used in the array and the controller.
All managers of IT departments like low costs. When the RAID standards were being developed, cost was also a key issue. The point of a RAID array is to provide the same or greater storage capacity for a system compared to using individual high capacity hard drives. A good example of this can be seen in the price differences between the highest capacity hard drives and lower capacity drives. Three drives of a smaller size could cost less than an individual high-capacity drive but provide more capacity.
There are typically three forms of RAID used for desktop computer systems: RAID 0, RAID 1 and RAID 5. In most cases, only the first two of these versions is available and one of the two technically is not a form of RAID.
RAID 0
The lowest designated level of RAID, level 0, is actually not a valid type of RAID. It was given the designation of level 0 because it fails to provide any level of redundancy for the data stored in the array. Thus, if one of the drives fails, all the data is damaged.
RAID 0 uses a method called striping. Striping takes a single chunk of data like a graphic image, and spreads that data across multiple drives. The advantage that striping has is in improved performance. Twice the amount of data can be written in a given time frame to the two drives compared to that same data being written to a single drive.
Below is an example of how data is written in a RAID 0 implementation. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block.
Drive 1 | Drive 2 | |
---|---|---|
Block 1 | 1 | 2 |
Block 2 | 3 | 4 |
Block 3 | 5 | 6 |
Advantages:
- Increased storage performance
- No loss in data capacity
- No redundancy of data
RAID version 1 was the first real implementation of RAID. It provides a simple form of redundancy for data through a process called mirroring. This form typically requires two individual drives of similar capacity. One drive is the active drive and the secondary drive is the mirror. When data is written to the active drive, the same data is written to the mirror drive.
The following is an example of how the data is written in a RAID 1 implementation. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block.
Drive 1 | Drive 2 | |
---|---|---|
Block 1 | 1 | 1 |
Block 2 | 2 | 2 |
Block 3 | 3 | 3 |
Advantages:
- Provides full redundancy of data
- Storage capacity is only as large as the smallest drive
- No performance increases
- Some downtime to change active drive during a failure
This is a hybrid form of RAID that some manufacturers have implemented to try and give the advantages of each of the two versions combined. Typically this can only be done on a system with a minimum of 4 hard drives. It then combines the methods of mirroring and striping to provide the performance and redundancy. The first set of drives will be active and have the data striped across them while the second set of drives will be a mirror of the data on the first two.
Below is an example of how data is written in a RAID 0+1 implementation. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block.
Drive 1 | Drive 2 | Drive 3 | Drive 4 | |
---|---|---|---|---|
Block 1 | 1 | 2 | 1 | 2 |
Block 2 | 3 | 4 | 3 | 4 |
Block 3 | 5 | 6 | 5 | 6 |
Advantages:
- Increased performance
- Data is fully redundant
- Large number of drives required
- Effective data capacity is halved
RAID 10 is effectively a similar version to RAID 0+1. Rather than striping data between the disk sets and then mirroring them, the first two drives in the set are a mirrored together. The second two drives form another set of disks that is are mirror of one another but store striped data with the first pair. This is a form of nested RAID setup. Drives 1 and 2 are a RAID 1 mirror and drives 3 and 4 are also a mirror. These two sets are then setup as stripped array.
Below is an example of how data is written in a RAID 10 implementation. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block.
Drive 1 | Drive 2 | Drive 3 | Drive 4 | |
---|---|---|---|---|
Block 1 | 1 | 1 | 2 | 2 |
Block 2 | 3 | 3 | 4 | 4 |
Block 3 | 5 | 5 | 6 | 6 |
Advantages:
- Increased performance
- Data is fully redundant
- Large number of drives required
- Effective data capacity is halved
This is the most powerful form of RAID that can be found in a desktop computer system. Typically it requires the form of a hardware controller card to manage the array, but some desktop operating systems can create these via software. This method uses a form of striping with parity to maintain data redundancy. A minimum of three drives is required to build a RAID 5 array and they should be identical drives for the best performance.
Parity is essentially a form of binary math that compares two blocks a data and forms a third data block based upon the first two. The easiest way to explain it is even and odd. If the sum of the two data blocks is even, then the parity bit is even. If the sum of the two data blocks is odd, the parity bit is odd. So 0+0 and 1+1 both equal 0 while 0+1 or 1+0 will equal 1. Based on this form of binary math, a failure in one drive in the array will allow the parity bit to reconstruct the data when the drive is replaced.
With that information in mind, here is an example of how a RAID 5 array would work. Each row in the chart represents a physical block on the drive and each column is the individual drive. The numbers in the table represent the data blocks. Duplicate numbers indicate a duplicated data block. A "P" indicates a parity bit for two blocks of data.
Drive 1 | Drive 2 | Drive 3 | |
---|---|---|---|
Block 1 | 1 | 2 | P |
Block 2 | 3 | P | 4 |
Block 3 | P | 5 | 6 |
(n-1)z = Array Capacity
In the case of three 500 gigabyte hard drives, the total capacity would be (3-1)x500GB or 1000 gigabytes.Hardware RAID 5 implementations can also have a function called hot swap. This allows for drives to be replaced while the array is still functioning to either increase the drives capacity or to replace a damaged drive. The drive controller then takes time while the array is running to rebuild the data array across the drives. This is a valuable feature for systems that require 24x7 operation.
Advantages:
- Increased storage array performance
- Full data redundancy
- Ability to run 24x7 with hot swap
- High costs to implement
- Performance degrades during rebuilding
In order for RAID to function, there needs to be software either through the operating system or via dedicated hardware to properly handle the flow of data from the computer system to the drive array. This is particularly important when it comes to RAID 5 due to the large amount of computing required to generate the parity calculations.
In the case of software implementations, CPU cycles are taken away from the general computing environment to perform the necessary tasks for the RAID interface. Software implementations are very low cost monetarily because all that is necessary to implement one is the hard drives. The problem with software RAID implementations is the performance drop of the system. In general, this performance hit can be anywhere from 5% or even greater depending upon the processor, memory, drives used and the level of RAID implemented. Most people do not use software RAID anymore due to the decreasing costs of hardware RAID controllers over the years.
Hardware RAID has the advantage of dedicated circuitry to handle all the RAID drive array calculations outside of the processor. This provides excellent performance for the storage array. The drawbacks to hardware RAID have been the costs. In the case of RAID 0/1 controllers, those costs have become so low that many chipset and motherboard manufacturers are including these capabilities on the motherboards. The real costs rest with RAID 5 hardware that require more circuitry for added computing ability.
Drive Selection
What a lot of people don't realize is that the performance and capacity of a RAID array is heavily dependent upon the hard drives used in the array. For the best results, all hard drives in the array should be the same brand and model. This means that all of the hard drives will have the same capacity and performance levels. It is not a requirement that the drives be matched, but mismatching the drives can actually hurt the RAID array.
The capacity of the RAID array will depend upon the method implemented. In the case of RAID 0, the striping can only be done across an equal amount of space on the two drives. As a result, if an 80GB and 100GB drive are used to make the array, the final capacity of the array would only be 160GB. Similarly, in RAID 1 the drives can only mirror data equal to the smallest size. Thus based on the two drives mentioned before, the final data size would only be 80GB. RAID 5 is a bit more complicated because of the formula mentioned before. Once again the smallest capacity would be used. So if a 80GB, 100 GB and 120GB drive were used to make a RAID 5 array, the final capacity would be 160GB of data.
Performance of the array is also dependent upon the drives. In order for the array to function properly, it must wait for the data to be written to each of the drives before it can continue. This means that in the example charts for the RAID arrays, the controller must wait until all physical data has been written to block 1 across all the drives in the array before it can continue to the next set of data for the drives. This means an array where one drive has half the performance of the other two will slow down the overall performance of the other drives.
Conclusions
Overall RAID provides systems with a variety of benefits depending upon the version implemented. Most consumer users will likely opt to use the RAID 0 for increased performance without the loss of storage space. This is primarily because redundancy is not an issue for the average user. In fact, most computer systems will only offer either RAID 0 or 1. The costs of implementing a RAID 0+1 or RAID 5 system generally are too expensive for the average consumer and are only found in high-end workstation or server level systems.
Aucun commentaire:
Enregistrer un commentaire