1. Why do you need a disk array?
How to increase the speed of the disk, how to prevent data from being lost due to disk failure and how to use disk space, has been the trouble of computer professionals and users; the price of large-capacity disks is very expensive, forming the user A big burden. The production of disk array technology solves these issues.
In the past decade, the processing speed of the CPU has increased by 50 times. The access speed of memory has also increased significantly, and the data storage device-mainly the disk (hard disk) - only increased access speed Three, four times, forming a bottleneck of computer systems, pulling the overall performance of the computer system (THROUGH PUT), if it is not effective to improve the disk access speed, the imbalance between CPU, memory, and disk will make CPU and memory Improvement formation waste.
There are two main modes of improving disk access speed. First, Disk Cache Controller, which will have the data read from the disk to reduce the number of disk access, and the read and write of the data is carried out in the middle of the memory. Increase the speed of access, and if the data to be read is not in the memory, or when you want to write data to disk, do disk access action. In this way, in the single-tasking envioronment, such as DOS, there is a good performance for a large amount of data (small and frequent access, but Multi-Tasking) The environment is under the environment (because the action of the SWApping) or the database (Database) is accessed (because each record is small), its performance cannot be displayed. This approach does not have any security.
The second is the technology of using disk arrays. The disk array is a plurality of disks constitute an array, as a single disk is used, which stores the data in different disks in different disks, ands the data, and the relevant disk in the array has a significant reduction. The access time of the data, and there is a better spatial utilization. Different techniques of disk arrays, called RAID Level, different levels of LEVEL to solve data security for different systems and applications
The problem.
Generally high-performance disk arrays are reached in hardware, further connecting disk to control and disk arrays in a controller (RAID Controler or Control Card, resolving people for different users) Four requirements:
(1) Increase access speed,
(2) Fault Tolerance, security
(3) Effective use of disk space;
(4) Try to balance the performance difference between CPU, memory, and disk, improve the overall workability of the computer.
2. Disk array principle
Different techniques for different applications in disk arrays, called RAID Level, RAID is an abbreviation for Redundent Array ONEXPENSIVE Disks, and each Level represents a technology, and currently recognized standards are RAID 0 ~ RAID 5. This Level does not mean that the technology is high, Level 5 is not higher than Level 3, the Level 1 is not less than Level 4, as for the product of the RAID Level, pure optiming environments and applications (Application) and is determined to have a inevitable relationship with the level of Level.
RAID 0 and RAID 1 Suitable for PC and PC-related systems such as small network servers and workstations that require high disk capacity and fast disk access, is relatively inexpensive; RAID 3 and RAID 4 are suitable for large computers and images , CAD / CAM and other processing; RAID 5 is used for OLTP (online transaction), due to the urgent needs of financial institutions and large data processing centers, there are more and more famous, RAID 2 is used, others such as RAID 6 RAID 7, or even RAID 10, etc., all of which are all made, there is no consistent criteria, which is not explained here. To introduce each RAID Level, let's take a look at two basic techniques to form a disk array:
Disk Spo SPANNING:
Translated as a disk extension, it can exactly represent the meaning of DISK spanning this technology. As shown in the figure disk array controller, four disks are connected, and the four disks form an array (ARRAY), and the controller of the disk array is a single disk, such as the DOS environment. C: disk. This is the meaning of Disk spanning because the user does not have to plan the distribution of data in each disk, and improve the usage rate of the disk space without planning the small capacity disk. And make the disk capacity can be almost unlimited; and each disk is taking the action, which is more fast than a single disk. Obviously, there is a variety of techniques of the formation of this array to produce RAID. Disk or Data Striping:
Since the disk array is considering multiple disks of the same array as a single virtual disk, its data is stored in a block array in the block array in the manner of block or segment, and the data is segmented as needed. The first disk started, put it until the last disk returns to the first disk until the data distribution is completed. As for the segmented size, some systems or is most efficient in 1kb, or 4KB, or at 6kb, or even 4MB or 8MB, unless the data is less than one sector (Sector, ie 521bytes), otherwise Its segmentation should be a multiple of 512byte. Because the read and write of the disk is in units of sectors, if the data is less than 512bytes, the system reads the sector, it is also possible to make a combination or group (view or write) action, waste time. From the figure above, we can see that data can be read from different disks, and the entire array can read and write at the same time. Therefore, the data segmentation has the best efficiency, theoretically, I originally read one contains The time required for four segments = (TRANFER TIME Data of Disk) X4, now you can complete it.
If the number of the disk is represented by N, R represents the read, W represents writing, and S represents the available space, the performance of the data segment is:
R: n (you can read all disks at the same time)
W: n (you can write all disks at the same time)
S: N (available all disks, and best usage)
Disk striping is also known as RAID 0, many people think that RAID 0 is nothing, in fact, this is a very wrong concept, because RAID 0 has the highest efficiency of the output of the disk. The disk array has more efficient reasons in addition to the data segmentation, it can perform multiple output requirements simultaneously, because each disk in the array can operate independently, segmented in different disks, different disks At the same time, it is read and written, and it is possible to move the memory and disk for parallel access, but only hardware disk arrays have this performance performance.
From the above two points, we can see that Disk spanning defines the basic form of RAID, providing a cheap, flexible, high-performance system structure, and Disk striping solves the data access efficiency and disk utilization problem, RAID 1 To RAID 5 is a scheme for providing disk security on this basis.
RAID 1
RAID 1 is a technology using disk mirroring. Disk mirroring applications are used in many systems before RAID 1. It is the way to add an additional backup disk outside the working disk (the backup disk), the data stored in the two disks is exactly the same, data Write a backup disk while writing to work disks. Disk mirroring is not an RAID 1, such as Novell NetWare also provides a function of providing disk mirroring, but does not mean that NetWare has the function of RAID 1. General disk mirroring and RAID 1 have two largest differences:
RAID 1 No working disk and backup disk, multiple disks can operate simultaneously and overlapping the function of overlaping, or even different mirror disks can operate simultaneously, this is an optimized way , Called load-balance. For example, there are multiple users to read data at the same time, and the system can simultaneously drive mirror-mounted disks while reading data to mitigate the load of the system, add I / O performance.
The disk of RAID 1 forms an array in a manner extension, and the data is stored in a data segment, so it is almost the same performance as RAID 0 when reading. From the RAID structure, you can see the difference between RAID 1 and general disk mirroring.
The picture below is RAID 1, and each data is stored two copies:
As you can see from the figure:
R: n (you can read all disks at the same time)
W: N / 2 (number of disk number)
S: N / 2 (utilization)
All disks can be used when reading data, give full play to the advantages of the data segment; when writing data, because there is a backup, it is necessary to write two disks, the efficiency is N / 2, the usage rate of disk space is only all Half of the disk. Many people think that RAID 1 should add an additional disk to form a waste and not optimistic about RAID 1. In fact, the disk is getting cheaper, and it is not necessarily burden, and the RAID 1 has the best fault tolerance. The efficiency It is also best in addition to RAID 0.
In the technical display of the disk array, from RAID 1 to RAID 5, it means that the system can continue to work without stopping, and the system can continue to work without stopping, and the system can still be used for disk access, and normal read and write data; The fault tolerance indicates that even if the disk is faulty, the data can remain intact, allowing the system to access the correct data, and the SCSI disk array is more able to switch the disk in the work and automatically rebuild the fault disk data. The disk array can be fault tolerant and non-stop, because it has redundant disk space deliberately, this is the meaning of Redundant.
RAID 2
RAID 2 is a bit (BIT) or block (block) to join the Haiming code Hamming Code, which is written in the disk array to each disk, and the address (address) is the same, that is In each disk, its data is in the same track (Cylinder or TRACK) and sector. The design of RAID 2 is the technology of Spindle Synchronize, and when accessing data, the entire disk array works together in each of the magnetic
The same location of the disk is parallel, so there is the best access time (a bus), which is a special design that transmits the data accessed in parallel with Band Wide, so there is the best Transfer time. Access applications in large files, RAID 2 has the best performance, but if the file is too small, it will pull it down because the access of the disk is in the sector, and the access of RAID 2 is all disks. Parallel action, but also
The amount of unit element is accessed, so the amount of data smaller than one sector will make it a big discount. RAID 2 is designed to use computers that require continuous and large amounts of data, such as large computers, workstation, Workstation, etc., and does not apply to a general multi-user environment, web server (Network Server), small machine or PC.
RAID 2 secures the technology of Memory Array, using multiple additional disk-bit correction and dunk-bit detection; as for how many additional disks, The methods and structures they are used, such as eight arrays of eight data disks may require three additional disks, with a high-end array of thirty data disks. Seven additional disks may require seven additional disks.
RAID 3
RAID 3's data storage and access mode is the same as RAID 2, but in terms of security, Parity Check replaces the Haiming code to detect, so you only need an additional calibration disk (Parity Disk). The calculation of parity values is the logical operation of the relative application of each disk, and then writes the result to parity disks, and any data is modified to do parity calculations.
For a disk failure, after replacing a new disk, the entire disk array (including parity disks) needs to be recalculated once, restore the data of the fault disk and write into a new disk; if the parity disk failure, Calculate parity values to achieve fault tolerance.
Compared with RAID 1 and RAID 2, RAID 3 has 85% disk space utilization, its performance is slightly poor than RAID 2, because of the parity calculation; the coaxial synchronized parallel access is good when reading files However, it is slow to write, and you need to recalculate and modify the contents of parity disks. RAID 3 and RAID 2 have the same application, applicable large archives and large amounts of data output applications, and does not apply to PC and web servers.
RAID 4
RAID 4 also uses a check disk, but it is different from RAID 3.
RAID 4 is a segment of the segment of the same position as the segment of the sector, and the Parity Block is formed, and the check disk is placed. This approach can perform different readings in different disks, greatly improve the reading performance of the disk array; however, when writing data, only one time is limited to verification disks, start all disks Reading data forms all data segments of the same checkout segment, and checks the calculation and writing with data to be written. Even so, the writing of small files is still fast than RAID 3, because its verification is calculated and the bit level is calculated; but the verification disk forms the bottleneck of RAID 4, reducing performance, because there is RAID 5 and make RAID 4 less. RAID 5
RAID5 avoids the bottleneck of RAID 4, the method is to place the verification data in each disk without checking the disk.
The first disk segment of the disk array is the check value. The second disk to the rear disk is folded back to the first disk. The segment of the second disk is the check value, from the third The segment of the disk is re-folded back to the second disk is data, so that this is pushed until it is finished. The first Parity Block in the figure is calculated from A0, A1 ..., B1, B2, and the second Parity Block is calculated from B3, B4, ..., C4, D0, that is, the verification value is Various disks
The segmentation of the same location is calculated. This approach can significantly increase the access performance of the small file, not only can read simultaneously, or may even perform multiple writes at the same time, such as written to disk 1 and its Parity Block is on disk 2, while writing Data to disk 4 and its Parity Block is on disk 1, which is on online transaction processing (OLTP, ON-LINE Transaction Processing) such as banking system, finance, stock market, etc. or large database
Processing provides the best solution because each of these applications is small, and the disk output is frequent and must be fault tolerant.
In fact, the performance of RAID 5 does not have this ideal, because any data is modified, after the same PARITYBLOCK is read out, then the verification calculation is written back, that is, RMW Cycle (Read-Modify-Write Cycle) This cycle does not include verification calculations); because of the whole body,
R: n (you can read all disks at the same time)
W: 1 (can be written to the number of disks at the same time)
S: N-1 (utilization)
The control of RAID 5 is more complicated, especially using hardware to control the disk array, because this approach is more than other RAID Level to master more things, there are more output demand, both speed, and Processing data, calculates the calibration value, makes error correction, etc., the price is higher; its application is preferably OLTP, as for image processing, etc., is not necessarily optimal.
2. Additional fault tolerance features of disk arrays: Spare or Standby Driver
The fact that the fault tolerance has become the most favored feature of disk arrays. In order to strengthen fault-tolerant functions, and quickly rebuild data in the case of disk failure, the general disk array system can use hot backups. (Hot spare or hot standby driver), the so-called thermal backup is when the Configure disk array system is established, specifying one of the disk as a backup disk, which is usually not working, but a certain array When the disk is faulty, the disk array replaces the fault disk in the backup disk, and automatically uses the data reconstruction of the fault disk in the backup disk, because the reaction is fast, plus the speed of the disk reduces the access of the disk, so data Reconstruction can be completed quickly, and the performance of the system is small. For large-scale data processing centers or control centers that require non-stop, hot spare is more important than avoiding any inconvenience caused by disk failure when the evening or unattended.
Another additional fault tolerance is a bad sector transfer (Bad Sector Reassignment). The bad sector is the main reason for disk failure. Usually, the disk failure occurs when reading and writing, indicating that this disk fault can no longer read and write, and there is even a lot of systems crafted because of the operation of reading and writing, but If the work cannot be completed or replaced by damage, the system performance is greatly reduced, and the maintenance cost of the system is too high. Bad sector shift is when the disk array system finds that the disk has a bad sector, replaces the sector in another blank and unburable sector to extend the service life of the disk, reduce the incidence of bad magnetic disks and the maintenance cost of the system. . Therefore, bad sector transfer functions make disk arrays better fault tolerance while making the entire system have the best cost effectiveness ratio. Other quick-tap memory, such as an external battery reserve disk array, to avoid loss of data in the time of sudden power outages, or write consistency in RAID 1, although it is small technology, but not Neglect. 3. Hardware disk arrays or software disk arrays
There are so-called hardware disk arrays and software disk arrays, because the software disk array is connected to disk connection using a SCSI card, and the general user is mistaken to be a hardware disk array. The above is mainly for hardware disk arrays, and there are several biggest differences with the software disk arrays:
l A complete disk array hardware is connected to the system.
l Built-in CPU, operate in parallel with the host, all I / O is completed in the disk array, reducing the workload of the host, increasing the overall performance of the system.
l There are excellent bus mastering and DMA (Direct Memory Access) capabilities, accelerated access and transmission performance of data.
l Combine with the memory stored without only increases the access and transmission performance of the data, but also increases the life of the disk due to reducing the access to the disk.
l Can fully utilize hardware characteristics and respond quickly.
The software disk array is a program that performs an array through a SCSI card with a disk with a disk, which is cheap because there is no hardware cost (including R & D, production, maintenance, etc.), and the SCSI card is very cheap ( There is also a software disk array uses the specified very expensive SCSI card); its biggest disadvantage is that there are many processes in the host, adding the host's burden, especially the output of large demand. Currently disk array on the market
Most of the system is hardware disk arrays, and less software disk arrays.
4. Disk array or disk array controller
Disk array control cards are generally used in small systems for a single machine. Shared power with the host, there is a risk of lost data in Cache when closing the host power. The disk array control card is only an interface of common bus mode. Its drivers are related to the host, and the operating system used by the host has a relationship, soft, hardware compatibility issues, and potentially increasing the system's unepricality. When replacing the disk array card, you should take a disk corruption, the data is lost, and the risk of stopping at any time.
Separate disk array control is generally used in a larger system, which can be divided into two types:
Single-channel disk arrays and multi-channel disk arrays, single-channel disk arrays can only be connected to one host, with great expansion restrictions. Multi-channel disk arrays can be used in multiple systems simultaneously with a cluster (Cluster) to share disk arrays, which makes the internal array control and single disk arrays unused. Currently, most independent forms of disk array subsystems, itself and the hardware and operating environment of the host system?
-
First, the performance of IDE will not be higher than SCSI. Especially in the case of multitasking. General advertising is given
The maximum transmission speed is not a working speed. Compared with the SCSI disc, the IDE in the same period is mainly larger.
The circuit is relatively simple, so the price is much lower than SCSI, but it is far more than performance.
RAID does not limit how many disks used, the more you should be, the better the time.
For the RAID of the SCSI structure, the maximum number of disks is related to the number of SCSI channels (SCSI bus), and the maximum number of 15 disks (SCSI / 3) is mostly per channel 200 for FC-Al (fiber). Of course, there must be such a large disk box!