A method and device for optimizing multi-thread performance of a RAID1-based disk
Patent Information
- Application Number
- CN202310443415.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-24
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2043-04-24
AI Technical Summary
[0006]针对上述多服务同时运行依赖磁盘RAID模式磁盘的多线程深队列的读写性能以及受限于硬盘硬件本身,当前数据中心的访问响应速度不能满足用户需求的缺陷,本发明提供一种基于RAID1的磁盘多线程性能优化的方法及装置,以解决上述技术问题
本发明提供的基于RAID1的磁盘多线程性能优化的方法及装置,在现有Raid1磁盘阵列的两个磁盘间设置辅助双向通信线路,实现Raid卡与每个磁盘多一条可能的辅助通信线路,基于辅助通信链路可以实现两倍带宽实现两个磁盘之间多线程读写均衡,缩短等待响应时间,提升磁盘访问速度。
Smart Images

Figure CN116627322B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of disk performance optimization technology, specifically relating to a method and apparatus for multi-threaded disk performance optimization based on RAID1. Background Technology
[0002] RAID stands for Redundant Arrays of Independent Disks. A RAID array is a group of many independent disks combined into a large-capacity disk array. It leverages the additive effect of individual disks to improve the overall performance of the disk system. RAID divides data into many segments and stores them on separate disks.
[0003] In current scenarios where multiple services simultaneously access disk data, high demands are placed on the disk's random I / O read / write performance. Taking short video and shopping websites as examples, tens of thousands of users are accessing different content and items from different fields every moment. Even with high-performance solid-state drives (SSDs), while sustained read performance can be 5 to 6 times faster than mechanical hard drives, the random 4K performance of a single queue and thread cannot achieve good results. Furthermore, the inherent performance limitations of SSDs mean their maximum speed cannot exceed 70MB / s, and can even drop as low as 20MB / s. This is particularly problematic for user access response times in data centers, which are severely insufficient.
[0004] Operating systems access disks via multiple threads, while the smallest unit of file system access is a disk cluster. Considering permissions and file-level directories, the number of accesses and the amount of data are enormous. Data center servers handle tens of thousands of users, and each access by multiple users requires calculations based on the results of the previous access to determine which sectors and clusters to access next – essentially random access by multiple threads and users. Simultaneous access to disk data by multiple services relies on the read / write performance of the disk's multi-threaded deep queue. Read / write performance is limited by the disk hardware itself. Even with redundant RAID arrays, such as RAID1, while data can be read from a mirror copy when the original data is busy, improving read performance to some extent, the write speed of RAID1 is still relatively slow because data must be written to two disks and compared, failing to meet the user access response speed requirements of data centers.
[0005] Therefore, it is essential to provide a method and apparatus for optimizing disk multi-threading performance based on RAID1 to address the aforementioned shortcomings. Summary of the Invention
[0006] To address the shortcomings of current data centers in meeting user needs due to the limitations of multi-threaded deep queue read / write performance on disks running simultaneously in RAID mode and the fact that access response speeds are insufficient for users due to hardware limitations, this invention provides a method and apparatus for optimizing disk multi-threaded performance based on RAID1 to solve the aforementioned technical problems.
[0007] In a first aspect, the present invention provides a method for optimizing disk multi-threading performance based on RAID1, comprising the following steps: S1. Configure the server's storage in RAID1 mode and add a communication link between the two hard drives in each RAID1 array; S2. Based on the storage application scenario, perform multi-threaded read / write balancing between the two disks of each RAID1 array to optimize storage response speed.
[0008] Furthermore, the specific steps of step S1 are as follows: S11. Obtain the number of disks m in the server and the number of RAID1 arrays n to be configured; S12. Select 2n disks from the m disks of the server according to the required number of RAID arrays n; S13. Add a RAID card, configure the selected disks into a RAID1 array in pairs, and establish a connection between the RAID controller on the RAID card and the two disks in each RAID1 array; S14. Add a communication link between the two disks in each RAID1 array.
[0009] Furthermore, the specific steps of step S13 are as follows: S131. Determine the RAID card addition mode; When the RAID card is in shared mode, proceed to step S132; When in independent RAID card mode, proceed to step S134; S132. Add a RAID card to the server; S133. Configure the selected disks into a RAID1 array by grouping them into two, establish the connection between the RAID controller on the RAID card and the two disks in each RAID1 array, and proceed to step S14; S134. Configure n RAID cards according to the required number of RAID arrays n; S135. Configure the selected disks into a RAID1 array by grouping them into two, and establish a one-to-one correspondence between the RAID1 array and the RAID card; S136. Establish a connection between the RAID controller on the RAID card and two disks in the same RAID1 array.
[0010] Furthermore, the specific steps of step S2 are as follows: S21. Obtain the application scenarios for storage; When the application scenario involves simultaneous reading and writing, proceed to step S22; When the application scenario involves reading large files, proceed to step S23; When the application scenario involves writing large files, proceed to step S24; S22. The RAID controller configures two disks in the RAID1 array, one for data reading and the other for data transmission, and allocates the communication link between the two disks based on the read / write workload. End. S23. The RAID controller selects the disk with the higher speed from the two disks in the RAID1 array, performs dual-link reading on the selected disk through the communication link between the two disks, and then ends. S24. RAID control selects the disk with the higher speed from two disks in the RAID1 array, performs dual-link writing to the selected disk through the communication link between the two disks, and preserves the original write link of the other disk.
[0011] Further, step S21 obtains the application scenario of the storage; When the RAID controller receives both storage and read file requests simultaneously, it is determined to be a simultaneous read / write application scenario. When the RAID controller receives a file read request and the file size exceeds a set threshold, it is considered a large file read scenario. When the RAID controller receives a storage file request and the storage file size exceeds a set threshold, it is determined to be a large file write scenario.
[0012] Furthermore, the specific steps of step S22 are as follows: S221. Configure two disks in the RAID1 array, one as a write disk and the other as a read disk; S222. Configure the link between the RAID controller and the write disk as a write link, configure the link between the RAID controller and the read disk as a read link, and configure the link between the write disk and the read disk as an auxiliary link; The S223 RAID controller uses write links to perform storage tasks on write disks and read links to perform read tasks on read disks. S224. The RAID controller compares the size of storage tasks with the size of read tasks; When the number of storage tasks exceeds the number of read tasks, and the difference between the two exceeds a set threshold, proceed to step S225. When the number of storage tasks is less than the number of read tasks, and the difference between the two is greater than a set threshold, proceed to step S226. When the difference between the two is less than the set threshold, proceed to step S227; The S225 RAID controller uses an auxiliary link to assist the storage task in reading files from the disk, then terminates. The S226 RAID controller uses an auxiliary link to assist read tasks in reading files from the write disk, then terminates. The S227 RAID controller uses secondary links in time periods to assist storage tasks in storing files to the read disk and to assist read tasks in reading files from the write disk, then ends.
[0013] Furthermore, the specific steps of step S23 are as follows: S231. Configure two disks in the RAID1 array as the first read disk and the second read disk; S232. Set the link between the RAID controller and the first read disk as the first read link, and set the link between the RAID controller and the second read disk as the second read link; The S233 RAID controller uses a first read link to read files from a first read disk and a second read link to read files from a second read disk. S234. The RAID controller compares the read rates of the first read link and the second read link; When the reading rate of the first read link is greater than that of the second read link, and the difference between the two is greater than a set threshold, proceed to step S235. When the reading rate of the second read link is greater than that of the first read link, and the difference between the two is greater than a set threshold, proceed to step S236. The S235 RAID controller combines the second read link with the auxiliary link and uses the combined link to read files from the first read disk, skipping the second read disk, thus forming a dual-link read between the RAID controller and the first read disk, and then ends. The S236 RAID controller combines the first read link with the auxiliary link and uses the combined link to read files from the second read disk, skipping the first read disk, thus forming a dual-link read between the RAID controller and the second read disk.
[0014] Furthermore, the specific steps of step S24 are as follows: S241. Configure two disks in the RAID1 array as the first write disk and the second write disk; S242. Set the link between the RAID controller and the first write disk as the first write link, and set the link between the RAID controller and the second write disk as the second write link; The S243 RAID controller uses the first write link to store files to the first write disk and uses the second write link to store files to the second write disk; S244. The RAID controller compares the storage rates of the first write link and the second write link; When the storage rate of the first write link is greater than that of the second write link, and the difference between the two is greater than a set threshold, proceed to step S245. When the storage rate of the second write link is greater than that of the first write link, and the difference between the two is greater than a set threshold, proceed to step S246. S245. While the RAID controller controls the second write link to store files to the second write disk, it also stores files to the first write disk through an auxiliary link, forming a dual-link storage between the RAID controller and the first write disk, and then ends. S246. While controlling the first write link to store files to the first write disk, the RAID controller also stores files to the second write disk through an auxiliary link, forming a dual-link storage between the RAID controller and the second write disk.
[0015] Secondly, the present invention provides an apparatus for optimizing disk multi-threaded performance, comprising: The inter-disk link addition module is used to configure the server's storage in RAID1 mode and add a communication link between the two hard drives in each RAID1 array. The read / write balancing module is used to perform multi-threaded read / write balancing between the two disks of each RAID1 array according to the storage application scenario, thereby optimizing the storage response speed.
[0016] Furthermore, the inter-disk link addition module includes: Disk and RAID1 array acquisition unit, used to obtain the number of disks m in the server and the number of RAID1 arrays n to be configured; The disk selection unit is used to select 2n disks from the m disks of the server according to the required number of RAID arrays n; The RAID1 array creation unit is used to add RAID cards, configure selected disks in pairs to form a RAID1 array, and establish a connection between the RAID controller on the RAID card and the two disks in each RAID1 array. The auxiliary link addition unit is used to add a communication link between two disks in each RAID1 array.
[0017] Furthermore, the RAID1 array building unit includes: The RAID card addition mode determination subunit is used to determine the RAID card addition mode; Adding a sub-unit to a single RAID card allows you to add a RAID card to a server in RAID card sharing mode. The RAID controller shares a configuration subunit, which is used to configure two selected disks as a group into a RAID1 array and establish a connection between the RAID controller on the RAID card and the two disks in each RAID1 array; Add sub-units to multiple RAID cards for independent RAID card mode, and configure n RAID cards according to the required number of RAID arrays n; The RAID1 array and RAID card parallel mapping sub-unit is used to configure two selected disks as a group into a RAID1 array, establishing a one-to-one correspondence between the RAID1 array and the RAID card; The RAID1 array connection setup subunit is used to establish a connection between the RAID controller on the RAID card and two disks in the same RAID1 array.
[0018] Furthermore, the read / write balancing module includes: Application scenario acquisition unit, used to acquire the application scenario of the storage; The communication link time-sharing allocation unit is used to configure the RAID1 array so that one disk in the array can read data and the other can send data when the application scenario is simultaneous read and write. The unit also allocates the communication link between the two disks based on the read and write task volume. The communication link read allocation unit is used when the application scenario is reading large files. The RAID controller selects the disk with the higher speed from the two disks in the RAID1 array and performs dual-link read on the selected disk through the communication link between the two disks. The communication link storage allocation unit is used when the application scenario is writing large files. The RAID controller selects the disk with the higher speed from two disks in the RAID1 array, performs dual-link writing to the selected disk through the communication link between the two disks, and retains the original write link of the other disk.
[0019] Furthermore, the application scenario acquisition unit acquires the application scenario; When the RAID controller receives both storage and read file requests simultaneously, it is determined to be a simultaneous read / write application scenario. When the RAID controller receives a file read request and the file size exceeds a set threshold, it is considered a large file read scenario. When the RAID controller receives a storage file request and the storage file size exceeds a set threshold, it is determined to be a large file write scenario.
[0020] Furthermore, the communication link time-division allocation unit includes: The read and write disks are separated into sub-units, which are used to designate one disk in the RAID1 array as a write disk and the other as a read disk; The read and write links are separated into sub-units, which are used to set the link between the RAID controller and the write disk as a write link, set the link between the RAID controller and the read disk as a read link, and set the link between the write disk and the read disk as an auxiliary link; The read / write task execution subunit is used to execute storage tasks to the write disk using the write link and read tasks to the read disk using the read link in the RAID controller. The read / write task comparison subunit is used to compare the task size of storage tasks with that of read tasks through the RAID controller. The auxiliary write subunit is used by the RAID controller to assist the storage task in storing files to the read disk when the storage task is greater than the read task and the difference between the two is greater than a set threshold. The auxiliary read subunit is used by the RAID controller to assist the read task in reading files from the write disk when the storage task is smaller than the read task and the difference between the two is greater than a set threshold. The auxiliary link time-sharing read / write subunit is used by the RAID controller in time periods to assist the storage task in storing files on the read disk and to assist the read task in reading files from the write disk when the difference between the size of the storage task and the read task is less than a set threshold.
[0021] Furthermore, the communication link reading and allocation unit includes: The disk read setting subunit is used to set two disks in the RAID1 array as the first read disk and the second read disk. The read link setting subunit is used to set the link between the RAID controller and the first read disk as the first read link, and to set the link between the RAID controller and the second read disk as the second read link; The read link allocation subunit is used to read files from the first read disk using the first read link and to read files from the second read disk using the second read link in the RAID controller. The read rate comparison subunit is used to compare the read rates of the first read link and the second read link in the RAID controller; In the first sub-unit of the auxiliary read disk, when the read rate of the first read link is greater than that of the second read link, and the difference between the two is greater than a set threshold, the RAID controller combines the second read link with the auxiliary link and uses the combined link to read files from the first read disk, skipping the second read disk, thus forming a dual-link read between the RAID controller and the first read disk. The second sub-unit of the auxiliary read disk is used when the read rate of the second read link is greater than that of the first read link, and the difference between the two is greater than a set threshold. In this case, the RAID controller combines the first read link with the auxiliary link and uses the combined link to read files from the second read disk, skipping the first read disk, thus forming a dual-link read between the RAID controller and the second read disk.
[0022] Furthermore, the communication link storage allocation unit includes: The write disk configuration subunit configures two disks in the RAID1 array as the first write disk and the second write disk. The write link setting subunit is used to set the link between the RAID controller and the first write disk as the first write link, and to set the link between the RAID controller and the second write disk as the second write link; The write link allocation subunit is used to store files to the first write disk using the first write link and to the second write disk using the second write link in the RAID controller. The write rate comparison subunit is used to compare the storage rates of the first write link and the second write link in the RAID controller; The first sub-unit of the auxiliary write disk, when the storage rate of the first write link is greater than that of the second write link, and the difference between the two is greater than a set threshold, while the RAID controller controls the second write link to store files to the second write disk, it also stores files to the first write disk through the auxiliary link, forming a dual-link storage between the RAID controller and the first write disk. The second sub-unit of the auxiliary write fast disk is used to store files to the second write disk through the auxiliary link when the storage rate of the second write link is greater than that of the first write link and the difference between the two is greater than a set threshold. This forms a dual-link storage between the RAID controller and the second write disk.
[0023] Thirdly, the present invention provides an apparatus including a processor and a memory; The memory is used to store a computer program, and the processor is used to retrieve and run the computer program from the memory, causing the device to perform the method described in the first aspect above.
[0024] Fourthly, the present invention provides a storage medium. The storage medium stores instructions that, when run on a computer, cause the computer to perform the method described in the first aspect above.
[0025] The beneficial effects of this invention are as follows: The present invention provides a method and apparatus for optimizing disk multi-threaded performance based on RAID1. By setting up an auxiliary bidirectional communication line between two disks in an existing RAID1 disk array, the RAID card can have an additional possible auxiliary communication line with each disk. Based on the auxiliary communication link, the bandwidth can be doubled to achieve balanced multi-threaded read and write between the two disks, shorten the waiting response time, and improve the disk access speed.
[0026] Furthermore, the design principle of this invention is reliable, the structure is simple, and it has a very wide range of application prospects.
[0027] Therefore, it is evident that the present invention has outstanding substantive features and significant progress compared with the prior art, and the beneficial effects of its implementation are also obvious. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This is a flowchart of Embodiment 1 of the method for optimizing disk multi-threading performance based on RAID1 according to the present invention.
[0030] Figure 2 This is a flowchart of Embodiment 2 of the method for optimizing disk multi-threading performance based on RAID1 according to the present invention.
[0031] Figure 3 This is a schematic diagram of the process of adding a RAID card and establishing a RAID1 array according to the present invention.
[0032] Figure 4 This is a flowchart illustrating the simultaneous read / write application scenario of the present invention.
[0033] Figure 5 This is a flowchart illustrating the application scenario of reading large files according to the present invention.
[0034] Figure 6 This is a schematic diagram illustrating the application scenario of writing large files according to the present invention.
[0035] Figure 7 This is a schematic diagram of the device for optimizing disk multi-threading performance based on RAID1 according to the present invention. Detailed Implementation
[0036] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.
[0037] The random I / O read / write performance of a disk is limited by its hardware characteristics, resulting in severely unsatisfactory response times for users accessing servers and data centers. Using redundant RAID arrays, such as RAID 1, can improve read performance to some extent by reading data from a mirror copy when the original data is busy. In the existing RAID 1 array operation mode, the RAID driver sends data to every disk in the array. When the RAID controller receives a file, it sends the file unchanged to every disk in the RAID 1 array, and each disk stores the file. When reading a file from the array, the RAID controller performs the read operation from one disk in the array. Read and write operations share the same line, so frequent read and write operations require time-sharing, significantly reducing disk response speed. This application solves this technical problem through the following embodiments.
[0038] Example 1: like Figure 1 As shown, this invention provides a method for optimizing disk multi-threading performance based on RAID1, comprising the following steps: S1. Configure the server's storage in RAID1 mode and add a communication link between the two hard drives in each RAID1 array; S2. Based on the storage application scenario, perform multi-threaded read / write balancing between the two disks of each RAID1 array to optimize storage response speed.
[0039] Example 2: like Figure 2 As shown, this invention provides a method for optimizing disk multi-threading performance based on RAID1, comprising the following steps: S1. Configure the server's storage in RAID1 mode and add a communication link between the two hard drives in each RAID1 array; the specific steps of step S1 are as follows: S11. Obtain the number of disks m in the server and the number of RAID1 arrays n to be configured; S12. Select 2n disks from the m disks of the server according to the required number of RAID arrays n; S13. Add a RAID card, configure the selected disks into a RAID1 array in pairs, and establish a connection between the RAID controller on the RAID card and the two disks in each RAID1 array; S14. Add a communication link between the two disks in each RAID1 array; S2. Based on the storage application scenario, perform multi-threaded read / write balancing between the two disks of each RAID1 array to optimize storage response speed; the specific steps of step S2 are as follows: S21. Obtain the application scenarios for storage; When the application scenario involves simultaneous reading and writing, proceed to step S22; When the application scenario involves reading large files, proceed to step S23; When the application scenario involves writing large files, proceed to step S24; S22. The RAID controller configures two disks in the RAID1 array, one for data reading and the other for data transmission, and allocates the communication link between the two disks based on the read / write workload. End. S23. The RAID controller selects the disk with the higher speed from the two disks in the RAID1 array, performs dual-link reading on the selected disk through the communication link between the two disks, and then ends. S24. RAID control selects the disk with the higher speed from two disks in the RAID1 array, performs dual-link writing to the selected disk through the communication link between the two disks, and preserves the original write link of the other disk.
[0040] Example 3: like Figure 3 As shown, this invention provides a method for optimizing disk multi-threading performance based on RAID1, comprising the following steps: S1. Configure the server's storage in RAID1 mode and add a communication link between the two hard drives in each RAID1 array; the specific steps of step S1 are as follows: S11. Obtain the number of disks m in the server and the number of RAID1 arrays n to be configured; S12. Select 2n disks from the m disks of the server according to the required number of RAID arrays n; S13. Add a RAID card, configure the selected disks in pairs as a RAID1 array, and establish a connection between the RAID controller on the RAID card and the two disks in each RAID1 array; for example... Figure 3 As shown, the specific steps of step S13 are as follows: S131. Determine the RAID card addition mode; When the RAID card is in shared mode, proceed to step S132; When in independent RAID card mode, proceed to step S134; S132. Add a RAID card to the server; S133. Configure the selected disks into a RAID1 array by grouping them into two, establish the connection between the RAID controller on the RAID card and the two disks in each RAID1 array, and proceed to step S14; S134. Configure n RAID cards according to the required number of RAID arrays n; S135. Configure the selected disks into a RAID1 array by grouping them into two, and establish a one-to-one correspondence between the RAID1 array and the RAID card; S136. Establish a connection between the RAID controller on the RAID card and two disks in the same RAID1 array; S14. Add a communication link between the two disks in each RAID1 array; An auxiliary link is introduced between the two disks in a RAID1 array to interconnect the two disks. This means that the RAID card and each HD (Hard Disk Unit) acting as a disk no longer have a single line. As a result, the RAID card has two lines available to each disk, and the RAID controller has two communication lines to each disk, thus doubling the bandwidth for data throughput and greatly improving the disk's read and write capabilities. S2. Based on the storage application scenario, perform multi-threaded read / write balancing between the two disks of each RAID1 array to optimize storage response speed; the specific steps of step S2 are as follows: S21. Obtain the application scenarios for storage; When the application scenario involves simultaneous reading and writing, proceed to step S22; When the application scenario involves reading large files, proceed to step S23; When the application scenario involves writing large files, proceed to step S24; Step S21: Obtain the application scenario for storage; When the RAID controller receives both storage and read file requests simultaneously, it is determined to be a simultaneous read / write application scenario. When the RAID controller receives a file read request and the file size exceeds a set threshold, it is considered a large file read scenario. When the RAID controller receives a storage file request and the storage file size exceeds a set threshold, it is determined to be a large file write scenario. S22. The RAID controller configures two disks in the RAID1 array, one for data reading and the other for data transmission, and allocates the communication link between the two disks based on the read / write workload. End. Figure 4 As shown, the specific steps of step S22 are as follows: S221. Configure two disks in the RAID1 array, one as a write disk and the other as a read disk; S222. Configure the link between the RAID controller and the write disk as a write link, configure the link between the RAID controller and the read disk as a read link, and configure the link between the write disk and the read disk as an auxiliary link; The S223 RAID controller uses write links to perform storage tasks on write disks and read links to perform read tasks on read disks. S224. The RAID controller compares the size of storage tasks with the size of read tasks; When the number of storage tasks exceeds the number of read tasks, and the difference between the two exceeds a set threshold, proceed to step S225. When the number of storage tasks is less than the number of read tasks, and the difference between the two is greater than a set threshold, proceed to step S226. When the difference between the two is less than the set threshold, proceed to step S227; The S225 RAID controller uses an auxiliary link to assist the storage task in reading files from the disk, then terminates. The S226 RAID controller uses an auxiliary link to assist read tasks in reading files from the write disk, then terminates. S227. The RAID controller uses auxiliary links to assist storage tasks in storing files to the read disk and to assist read tasks in reading files from the write disk during the specified period, then ends. When the RAID controller receives both storage and read files simultaneously, it sends the files to the two disks in the RAID1 array intact. At this time, disk data storage can be done from the write link to the disk, or by combining the write link with the auxiliary link to read the disk. Disk data reading can be done from the read link to the disk, or by combining the read link with the auxiliary link to write the disk. Whether the auxiliary link is used for storing or reading data is switched freely according to the size of the RAID controller's read and write tasks. If the read and write tasks are similar, the auxiliary link will store and read data in time periods. S23. The RAID controller selects the disk with the higher speed from the two disks in the RAID1 array, performs dual-link reading of the selected disk through the communication link between the two disks, and then ends; Figure 5 As shown, the specific steps of step S23 are as follows: S231. Configure two disks in the RAID1 array as the first read disk and the second read disk; S232. Set the link between the RAID controller and the first read disk as the first read link, and set the link between the RAID controller and the second read disk as the second read link; The S233 RAID controller uses a first read link to read files from a first read disk and a second read link to read files from a second read disk. S234. The RAID controller compares the read rates of the first read link and the second read link; When the reading rate of the first read link is greater than that of the second read link, and the difference between the two is greater than a set threshold, proceed to step S235. When the reading rate of the second read link is greater than that of the first read link, and the difference between the two is greater than a set threshold, proceed to step S236. The S235 RAID controller combines the second read link with the auxiliary link and uses the combined link to read files from the first read disk, skipping the second read disk, thus forming a dual-link read between the RAID controller and the first read disk, and then ends. The S236 RAID controller combines the first read link with the auxiliary link and uses the combined link to read files from the second read disk, skipping the first read disk, thus forming a dual-link read between the RAID controller and the second read disk; When the RAID controller needs to read a large number of files, it can read different data from the disks through two read links. The role of the auxiliary link is: when the two read disks have different speeds, for example, one read disk has been used for a long time and is worn out, while the other read disk has a faster speed, the RAID controller retains the original read link for the faster disk and forms a composite link with the auxiliary link through the other read link. This creates two channels to read data from the faster read disk at the same time, skipping the slower read disk and fully utilizing the advantages of the high-speed disk. The reverse is also true. S24. RAID control selects the disk with the higher speed from two disks in the RAID1 array, performs dual-link writing to the selected disk through the communication link between the two disks, and preserves the original write link of the other disk; for example... Figure 6 As shown, the specific steps of step S24 are as follows: S241. Configure two disks in the RAID1 array as the first write disk and the second write disk; S242. Set the link between the RAID controller and the first write disk as the first write link, and set the link between the RAID controller and the second write disk as the second write link; The S243 RAID controller uses the first write link to store files to the first write disk and uses the second write link to store files to the second write disk; S244. The RAID controller compares the storage rates of the first write link and the second write link; When the storage rate of the first write link is greater than that of the second write link, and the difference between the two is greater than a set threshold, proceed to step S245. When the storage rate of the second write link is greater than that of the first write link, and the difference between the two is greater than a set threshold, proceed to step S246. S245. While the RAID controller controls the second write link to store files to the second write disk, it also stores files to the first write disk through an auxiliary link, forming a dual-link storage between the RAID controller and the first write disk, and then ends. S246. While controlling the first write link to store files to the first write disk, the RAID controller also stores files to the second write disk through the auxiliary link, forming a dual-link storage between the RAID controller and the second write disk; When a RAID controller needs to store a large number of files, it can use two write links to store different data to two write disks. The role of the auxiliary link is as follows: when the two write disks have different speeds, for example, one write disk has been used for a long time and is more worn, while the other write disk has a faster speed, the RAID controller can use the original write link for the faster write disk, and also form a composite link with the auxiliary link through the other write link. This creates two channels to simultaneously write data to the faster write disk, while also maintaining the original write link for the slower disk. This fully utilizes the advantages of dual channels and makes up for the problem of insufficient disk speed.
[0041] Example 4: like Figure 4 As shown, the present invention provides an apparatus for optimizing disk multi-threaded performance, comprising: The inter-disk link addition module is used to configure the server's storage in RAID1 mode and add a communication link between the two hard drives in each RAID1 array. The read / write balancing module is used to perform multi-threaded read / write balancing between the two disks of each RAID1 array according to the storage application scenario, thereby optimizing the storage response speed.
[0042] Example 5: like Figure 4 As shown, the present invention provides an apparatus for optimizing disk multi-threaded performance, comprising: The inter-disk link addition module is used to configure the server's storage in RAID1 mode and add a communication link between the two hard drives in each RAID1 array; the inter-disk link addition module includes: Disk and RAID1 array acquisition unit, used to obtain the number of disks m in the server and the number of RAID1 arrays n to be configured; The disk selection unit is used to select 2n disks from the m disks of the server according to the required number of RAID arrays n; The RAID1 array creation unit is used to add RAID cards, configure selected disks in pairs to form a RAID1 array, and establish a connection between the RAID controller on the RAID card and the two disks in each RAID1 array. Auxiliary link addition unit, used to add a communication link between two disks in each RAID1 array; The read / write balancing module is used to perform multi-threaded read / write balancing between the two disks of each RAID1 array according to the storage application scenario, thereby optimizing the storage response speed. The read / write balancing module includes: Application scenario acquisition unit, used to acquire the application scenario of the storage; The communication link time-sharing allocation unit is used to configure the RAID1 array so that one disk in the array can read data and the other can send data when the application scenario is simultaneous read and write. The unit also allocates the communication link between the two disks based on the read and write task volume. The communication link read allocation unit is used when the application scenario is reading large files. The RAID controller selects the disk with the higher speed from the two disks in the RAID1 array and performs dual-link read on the selected disk through the communication link between the two disks. The communication link storage allocation unit is used when the application scenario is writing large files. The RAID controller selects the disk with the higher speed from two disks in the RAID1 array, performs dual-link writing to the selected disk through the communication link between the two disks, and retains the original write link of the other disk.
[0043] Example 6: like Figure 4 As shown, the present invention provides an apparatus for optimizing disk multi-threaded performance, comprising: The inter-disk link addition module is used to configure the server's storage in RAID1 mode and add a communication link between the two hard drives in each RAID1 array; the inter-disk link addition module includes: Disk and RAID1 array acquisition unit, used to obtain the number of disks m in the server and the number of RAID1 arrays n to be configured; The disk selection unit is used to select 2n disks from the m disks of the server according to the required number of RAID arrays n; The RAID1 array creation unit is used to add a RAID card, configure selected disks in pairs to form a RAID1 array, and establish the connection between the RAID controller on the RAID card and the two disks in each RAID1 array. The RAID1 array creation unit includes: The RAID card addition mode determination subunit is used to determine the RAID card addition mode; Adding a sub-unit to a single RAID card allows you to add a RAID card to a server in RAID card sharing mode. The RAID controller shares a configuration subunit, which is used to configure two selected disks as a group into a RAID1 array and establish a connection between the RAID controller on the RAID card and the two disks in each RAID1 array; Add sub-units to multiple RAID cards for independent RAID card mode, and configure n RAID cards according to the required number of RAID arrays n; The RAID1 array and RAID card parallel mapping sub-unit is used to configure two selected disks as a group into a RAID1 array, establishing a one-to-one correspondence between the RAID1 array and the RAID card; The RAID1 array connection configuration subunit is used to establish a connection between the RAID controller on the RAID card and two disks in the same RAID1 array. Auxiliary link addition unit, used to add a communication link between two disks in each RAID1 array; The read / write balancing module is used to perform multi-threaded read / write balancing between the two disks of each RAID1 array according to the storage application scenario, thereby optimizing the storage response speed. The read / write balancing module includes: The application scenario acquisition unit is used to acquire the application scenario of the storage; the application scenario acquisition unit acquires the application scenario. When the RAID controller receives both storage and read file requests simultaneously, it is determined to be a simultaneous read / write application scenario. When the RAID controller receives a file read request and the file size exceeds a set threshold, it is considered a large file read scenario. When the RAID controller receives a storage file request and the storage file size exceeds a set threshold, it is determined to be a large file write scenario. The communication link time-sharing allocation unit is used when the application scenario involves simultaneous read and write operations. In this unit, the RAID controller configures two disks in the RAID1 array, one for data reading and the other for data transmission, and allocates communication links between the two disks based on the read / write workload. The communication link time-sharing allocation unit includes: The read and write disks are separated into sub-units, which are used to designate one disk in the RAID1 array as a write disk and the other as a read disk; The read and write links are separated into sub-units, which are used to set the link between the RAID controller and the write disk as a write link, set the link between the RAID controller and the read disk as a read link, and set the link between the write disk and the read disk as an auxiliary link; The read / write task execution subunit is used to execute storage tasks to the write disk using the write link and read tasks to the read disk using the read link in the RAID controller. The read / write task comparison subunit is used to compare the task size of storage tasks with that of read tasks through the RAID controller. The auxiliary write subunit is used by the RAID controller to assist the storage task in storing files to the read disk when the storage task is greater than the read task and the difference between the two is greater than a set threshold. The auxiliary read subunit is used by the RAID controller to assist the read task in reading files from the write disk when the storage task is smaller than the read task and the difference between the two is greater than a set threshold. The auxiliary link time-sharing read / write subunit is used by the RAID controller to assist the storage task in storing files to the read disk and assist the read task in reading files from the write disk when the difference between the size of the storage task and the read task is less than a set threshold. A communication link read allocation unit is used when the application scenario involves reading large files. The RAID controller selects the disk with the higher speed from two disks in the RAID1 array and performs dual-link read operations on the selected disk through the communication link between the two disks. The communication link read allocation unit includes: The disk read setting subunit is used to set two disks in the RAID1 array as the first read disk and the second read disk. The read link setting subunit is used to set the link between the RAID controller and the first read disk as the first read link, and to set the link between the RAID controller and the second read disk as the second read link; The read link allocation subunit is used to read files from the first read disk using the first read link and to read files from the second read disk using the second read link in the RAID controller. The read rate comparison subunit is used to compare the read rates of the first read link and the second read link in the RAID controller; In the first sub-unit of the auxiliary read disk, when the read rate of the first read link is greater than that of the second read link, and the difference between the two is greater than a set threshold, the RAID controller combines the second read link with the auxiliary link and uses the combined link to read files from the first read disk, skipping the second read disk, thus forming a dual-link read between the RAID controller and the first read disk. The second sub-unit of the auxiliary fast read disk is used when the read rate of the second read link is greater than that of the first read link, and the difference between the two is greater than a set threshold. In this case, the RAID controller combines the first read link with the auxiliary link and uses the combined link to read files from the second read disk, skipping the first read disk, thus forming a dual-link read between the RAID controller and the second read disk. The communication link storage allocation unit is used when the application scenario involves writing large files. RAID control selects the disk with the higher speed from two disks in the RAID1 array, performs dual-link writing to the selected disk through the communication link between the two disks, and retains the original write link of the other disk. The communication link storage allocation unit includes: The write disk configuration subunit configures two disks in the RAID1 array as the first write disk and the second write disk. The write link setting subunit is used to set the link between the RAID controller and the first write disk as the first write link, and to set the link between the RAID controller and the second write disk as the second write link; The write link allocation subunit is used to store files to the first write disk using the first write link and to the second write disk using the second write link in the RAID controller. The write rate comparison subunit is used to compare the storage rates of the first write link and the second write link in the RAID controller; The first sub-unit of the auxiliary write disk, when the storage rate of the first write link is greater than that of the second write link, and the difference between the two is greater than a set threshold, while the RAID controller controls the second write link to store files to the second write disk, it also stores files to the first write disk through the auxiliary link, forming a dual-link storage between the RAID controller and the first write disk. The second sub-unit of the auxiliary write fast disk is used to store files to the second write disk through the auxiliary link when the storage rate of the second write link is greater than that of the first write link and the difference between the two is greater than a set threshold. This forms a dual-link storage between the RAID controller and the second write disk.
[0044] Example 7: This invention provides a device, including a processor and a memory; The memory is used to store computer programs, and the processor is used to call and run the computer programs from the memory, so that the device performs the methods described in Embodiment 1, Embodiment 2 or Embodiment 3 above.
[0045] Example 8: This invention provides a storage medium, The storage medium stores instructions that, when run on a computer, cause the computer to execute the methods described in Embodiment 1, Embodiment 2, or Embodiment 3.
[0046] Although the present invention has been described in detail with reference to the accompanying drawings and preferred embodiments, the invention is not limited thereto. Various equivalent modifications or substitutions can be made to the embodiments of the invention by those skilled in the art without departing from the spirit and essence of the invention, and such modifications or substitutions should all be within the scope of the invention. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the invention should also be covered within the protection scope of the invention. Therefore, the protection scope of the invention should be determined by the scope of the claims.
Claims
1. A method for optimizing disk multi-threading performance based on RAID1, characterized in that, Includes the following steps: S1. Configure the server's storage in RAID1 mode. Establish the original communication links between the two hard drives of each RAID1 array and the RAID controller. Add an independent auxiliary bidirectional communication link between the two hard drives. The auxiliary bidirectional communication link is independent of the original communication link between the hard drive and the RAID controller. S2. Based on the storage application scenario, and utilizing the existing communication link and the additional independent auxiliary bidirectional communication link, multi-threaded read / write balancing is performed between the two disks of each RAID1 array to optimize the storage response speed.
2. The method for optimizing disk multi-threading performance based on RAID1 as described in claim 1, characterized in that, The specific steps of step S1 are as follows: S11. Obtain the number of disks m in the server and the number of RAID1 arrays n to be configured; S12. Select 2n disks from the m disks of the server according to the required number of RAID arrays n; S13. Add a RAID card, configure the selected disks into a RAID1 array in pairs, and establish a connection between the RAID controller on the RAID card and the two disks in each RAID1 array; S14. Add a communication link between the two disks in each RAID1 array.
3. The method for optimizing disk multi-threading performance based on RAID1 as described in claim 2, characterized in that, The specific steps of step S13 are as follows: S131. Determine the RAID card addition mode; When the RAID card is in shared mode, proceed to step S132; When in independent RAID card mode, proceed to step S134; S132. Add a RAID card to the server; S133. Configure the selected disks into a RAID1 array by grouping them into two, establish the connection between the RAID controller on the RAID card and the two disks in each RAID1 array, and proceed to step S14; S134. Configure n RAID cards according to the required number of RAID arrays n; S135. Configure the selected disks into a RAID1 array by grouping them into two, and establish a one-to-one correspondence between the RAID1 array and the RAID card; S136. Establish a connection between the RAID controller on the RAID card and two disks in the same RAID1 array.
4. The method for optimizing disk multi-threading performance based on RAID1 as described in claim 1, characterized in that, The specific steps of step S2 are as follows: S21. Obtain the application scenarios for storage; When the application scenario involves simultaneous reading and writing, proceed to step S22; When the application scenario involves reading large files, proceed to step S23; When the application scenario involves writing large files, proceed to step S24; S22. The RAID controller configures two disks in the RAID1 array, one for data reading and the other for data transmission, and allocates the communication link between the two disks based on the read / write workload. End. S23. The RAID controller selects the disk with the higher speed from the two disks in the RAID1 array, performs dual-link reading on the selected disk through the communication link between the two disks, and then ends. S24. RAID control selects the disk with the higher speed from two disks in the RAID1 array, performs dual-link writing to the selected disk through the communication link between the two disks, and preserves the original write link of the other disk.
5. The method for optimizing disk multi-threading performance based on RAID1 as described in claim 4, characterized in that, The specific steps of step S22 are as follows: S221. Configure two disks in the RAID1 array, one as a write disk and the other as a read disk; S222. Configure the link between the RAID controller and the write disk as a write link, configure the link between the RAID controller and the read disk as a read link, and configure the link between the write disk and the read disk as an auxiliary link; The S223 RAID controller uses write links to perform storage tasks on write disks and read links to perform read tasks on read disks. S224. The RAID controller compares the size of storage tasks with the size of read tasks; When the number of storage tasks exceeds the number of read tasks, and the difference between the two exceeds a set threshold, proceed to step S225. When the number of storage tasks is less than the number of read tasks, and the difference between the two is greater than a set threshold, proceed to step S226. When the difference between the two is less than the set threshold, proceed to step S227; The S225 RAID controller uses an auxiliary link to assist the storage task in reading files from the disk, then terminates. The S226 RAID controller uses an auxiliary link to assist read tasks in reading files from the write disk, then terminates. The S227 RAID controller uses secondary links in time periods to assist storage tasks in storing files to the read disk and to assist read tasks in reading files from the write disk, then ends.
6. The method for optimizing disk multi-threading performance based on RAID1 as described in claim 4, characterized in that, The specific steps of step S23 are as follows: S231. Configure two disks in the RAID1 array as the first read disk and the second read disk; S232. Set the link between the RAID controller and the first read disk as the first read link, and set the link between the RAID controller and the second read disk as the second read link; The S233 RAID controller uses a first read link to read files from a first read disk and a second read link to read files from a second read disk. S234. The RAID controller compares the read rates of the first read link and the second read link; If the reading rate of the first read link is greater than that of the second read link, and the difference between the two is greater than a set threshold, proceed to step S235. If the reading rate of the second read link is greater than that of the first read link, and the difference between the two is greater than a set threshold, proceed to step S236. The S235 RAID controller combines the second read link with the auxiliary link and uses the combined link to read files from the first read disk, skipping the second read disk, thus forming a dual-link read between the RAID controller and the first read disk, and then ends. The S236 RAID controller combines the first read link with the auxiliary link and uses the combined link to read files from the second read disk, skipping the first read disk, thus forming a dual-link read between the RAID controller and the second read disk.
7. The method for optimizing disk multi-threading performance based on RAID1 as described in claim 4, characterized in that, The specific steps of step S24 are as follows: S241. Configure two disks in the RAID1 array as the first write disk and the second write disk; S242. Set the link between the RAID controller and the first write disk as the first write link, and set the link between the RAID controller and the second write disk as the second write link; The S243 RAID controller uses the first write link to store files to the first write disk and uses the second write link to store files to the second write disk; S244. The RAID controller compares the storage rates of the first write link and the second write link; If the storage rate of the first write link is greater than that of the second write link, and the difference between the two is greater than a set threshold, proceed to step S245. If the storage rate of the second write link is greater than that of the first write link, and the difference between the two is greater than a set threshold, proceed to step S246. S245. While the RAID controller controls the second write link to store files to the second write disk, it also stores files to the first write disk through an auxiliary link, forming a dual-link storage between the RAID controller and the first write disk, and then ends. S246. While controlling the first write link to store files to the first write disk, the RAID controller also stores files to the second write disk through an auxiliary link, forming a dual-link storage between the RAID controller and the second write disk.
8. An apparatus for optimizing disk multi-threaded performance, characterized in that, include: The disk link addition module is used to configure the server's storage in RAID1 mode. Each RAID1 array has two hard drives that establish an existing communication link with the RAID controller, and an additional independent auxiliary bidirectional communication link is added between the two hard drives. The auxiliary bidirectional communication link is independent of the existing communication link between the hard drive and the RAID controller. The read / write balancing module is used to perform multi-threaded read / write balancing between the two disks of each RAID1 array based on the storage application scenario and by utilizing the original communication link and the additional independent auxiliary bidirectional communication link, thereby optimizing the storage response speed.
9. A device, characterized in that, Including processor and memory; The memory is used to store a computer program, and the processor is used to retrieve and run the computer program from the memory, causing the device to perform the method described in any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium stores instructions that, when run on a computer, cause the computer to perform the method described in any one of claims 1-7.
Citation Information
Patent Citations
A storage management method and device capable of isolating fault disks automatically
CN106990919A
Method, apparatus and program for providing hybrid disk mirroring and striping
CN1518697A