Analysis on raid and raid
Let's analyze the main components that affect computer performance, including CPU, bus I/O of the motherboard, memory I/O, hard disk I/O, and Nic I/O. Now the CPU performance is good, however, the overall I/O performance of the computer is low, seriously affecting the computer performance. The current computer's bus I/O and memory I/O speed can reach more than 5G/s, however, disk IO is usually low.
Let's analyze several common methods. For SATA hard disks, the speed is less than 150 MB/s. For SCSI hard disks, the speed is less than 200 MB/s. For SAS hard disks, the speed is about 200 Mb/s, while that of SSD is about 500 Mb/s. Most of the hard disks we use at ordinary times are SATA mechanical hard disks, while the SATA3 interface is relatively fast and can reach 6 GB/s, while scsi sas is generally used for servers, usually with fast speed, it can reach 10 thousands or 20 thousands rpm. SAS is a serial SCSI, while SSD is a solid state disk.
Performance bottlenecks of most hard-disk computers, and IOPS also play a major role. The so-called IOPS is short for Input/Output Operation Per Second, that is, read/write Per Second (IO) the number of operations is mostly used in databases. It is an important parameter to measure the performance of random access. In addition, we found that the defects of modern disks: weak IO performance and poor stability.
RAID, also known as Redundant Array of Independent Disks, is a Redundant Array of cheap Disks. It runs on multiple Disks in parallel to provide computer storage I/O performance. RAID has many types, which are called RAID levels. Modern RAID has 7 categories, and commonly used RAID has 4 categories. That is, RAID0, RAID1, RAID5, and RAID6. for redundancy, it can be analogous to backup. Multiple disk groups become one RAID, but in the OS, there is only one RAID hard disk, RAID5 allows multiple hard disks in parallel to avoid data loss when one disk fails.
For RAID0, it requires at least two hard disks. It reads and writes data to multiple hard disks separately to improve Read and Write Performance. If there are several hard disks, you can divide the data into several copies for writing, its space utilization is the sum of all hard disk space, and its performance is the sum of all hard disk speeds. It has no redundancy capability. Its advantage is that it can achieve parallel read harmony, high space utilization, and the best performance. Its disadvantage is that once a hard disk in RAID fails, all data will be lost.
For RAID1, it requires an even hard disk. When reading data, it reads data from multiple hard disks at the same time to improve reading performance. It has the same reading speed as RAID0, when writing data, it needs to copy the same data to multiple disks to provide redundancy. It is applicable to scenarios with high data security and integrity requirements, and reads far more than writes. Its space utilization is the smallest disk in Raid 1. Its read performance is the sum of the speed of all hard disks, but its write performance is worse than its read performance. Its redundancy capability is that data is complete as long as one hard disk is not damaged. For RAID1, it has fast reading and high redundancy, but the disadvantage is that there are several hard disks that need the same data, and data writing is slow.
For RAID5, it uses at least three hard disks. When reading data, it writes data to the disk in a distributed manner like RAID0. During data reading, it performs parity checks on the data, the verification information is stored on the disk at the same time, and the verification information is used for data recovery. Among them, RAID0 has the highest performance, while RAID1 has the highest redundancy, but there are not many use cases. In the actual production environment, RAID5 and raid6are used. The space utilization is 1-1/hard disk, its read performance is very similar to RAID0, and its write performance is weaker than RAID0. Its redundancy capability is that if a disk is damaged, data will not be lost.
For RAID6, it uses at least four hard disks. Like RAID5, it only saves copies of verification information on multiple hard disks. When reading data, it is the same as RAID5, write Data to the disk in a distributed manner. During data writing, parity is performed on the data. The verification information is saved on the disk at the same time, but an additional verification information is saved. Its space utilization is 1-2/hard disk. Its read performance is close to RAID5, but its write performance is weaker than RAID5. Its redundancy capability is that if one hard disk is damaged, data will not be lost.
RAID implementation can be divided into software implementation and hardware implementation. If it is software implementation, it can be implemented through system functions or software. It does not have independent hardware and interfaces, and it will occupy certain system resources, such as cpu, memory, and hard disk interface speed, affected by the stability of the operating system. For hardware implementation, you can purchase an independent RAID hardware card to implement RAID. Some boards are integrated with RAID hardware, and hardware RAID does not need to occupy other hardware resources, in addition, the stability and speed are higher than those of software RAID.