A method, device and equipment for dynamically adjusting disk scheduling strategy
By monitoring the IO indicators of the disk and dynamically adjusting the scheduling strategy in combination with the disk type, the problem that the existing technology is difficult to adapt to complex and changeable business scenarios is solved, and the system performance is improved.
Patent Information
- Application Number
- CN202110864576.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-29
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-07-29
AI Technical Summary
The existing technology is difficult to adapt to complex and changeable business scenarios, resulting in poor performance of the disk-owned system.
By monitoring the IO indicator items of the disk in real time or time, obtaining the indicator data within the preset time period before the current time, determining the corresponding scheduling strategy based on the disk type, and dynamically adjusting the scheduling strategy of the disk.
It realizes dynamic adjustments to complex and changeable business scenarios, ensures the stability and operation speed of the disk-owned system, and effectively improves system performance.
Smart Images

Figure CN113687943B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and more specifically, to a method, device, equipment and storage medium for dynamically adjusting a disk scheduling strategy. Background Art
[0002] A disk scheduling strategy is a method for scheduling the IO (Input / Output) of a disk, hereinafter referred to as a scheduling strategy. In the prior art, it is usually necessary to manually analyze the business scenarios corresponding to the disk to select the optimal scheduling strategy, and implement the disk IO scheduling according to the optimal scheduling strategy. However, the inventors have found that business scenarios are not static, and it is possible that the currently set optimal scheduling strategy is no longer the optimal scheduling strategy after the business has been running for a period of time. Therefore, the method of implementing scheduling strategy setting in the prior art cannot adapt to complex and changeable business scenarios, which in turn leads to poor performance of the system to which the disk belongs. Summary of the invention
[0003] The purpose of the present invention is to provide a method, device, equipment and storage medium for dynamically adjusting disk scheduling strategies, which can realize dynamic adjustment of disk scheduling strategies for complex and changeable business scenarios, ensure the stability and operating speed of the system to which the disk belongs, and effectively improve system performance.
[0004] In order to achieve the above object, the present invention provides the following technical solutions:
[0005] A method for dynamically adjusting a disk scheduling strategy, comprising:
[0006] Determine the disks that need to implement dynamic adjustment of scheduling policies as the disks to be monitored;
[0007] Monitor the IO index items of the disk to be monitored in real time or periodically, and obtain the index data of the disk to be monitored corresponding to the IO index items within a preset time period before the current moment;
[0008] A scheduling policy corresponding to the disk type and index data of the disk to be monitored is determined as a target scheduling policy, and a current scheduling policy of the disk to be monitored is adjusted to the target scheduling policy.
[0009] Preferably, determining a scheduling strategy corresponding to both the disk type and the index data of the disk to be monitored as a target scheduling strategy includes:
[0010] If the indicator data indicates that the IO merging rate is less than the minimum merging rate threshold, the NOOP scheduling strategy is determined as the target scheduling strategy;
[0011] If the indicator data indicates that the IO merger rate is greater than the merger rate maximum threshold, then when the disk type is a mechanical disk, the NOOP scheduling strategy is determined as the target scheduling strategy, and when the disk type is not a mechanical disk, the DEADLINE scheduling strategy is determined as the target scheduling strategy;
[0012] If the indicator data is between the minimum threshold of the merge rate and the maximum threshold of the merge rate and the read / write ratio is less than the minimum threshold of the ratio, then the write operation priority strategy is determined as the target scheduling strategy; if the indicator data is between the minimum threshold of the merge rate and the maximum threshold of the merge rate and the read / write ratio is greater than the maximum threshold of the ratio, then the read operation priority strategy is determined as the target scheduling strategy; if the indicator data is between the minimum threshold of the merge rate and the maximum threshold of the merge rate and the read / write ratio is between the minimum threshold of the ratio and the maximum threshold of the ratio, then when the disk type is a mechanical disk, the ANTICIPATORY scheduling strategy is determined as the target scheduling strategy; when the disk type is not a mechanical disk, the NOOP scheduling strategy is determined as the target scheduling strategy.
[0013] Preferably, real-time monitoring of the IO index items of the disk to be monitored includes:
[0014] If there are multiple disks to be monitored, multiple sub-threads are used to monitor the IO index items of the multiple disks to be monitored in a one-to-one correspondence manner.
[0015] Preferably, before adjusting the current scheduling strategy of the disk to be monitored to the target scheduling strategy, the method further includes:
[0016] Send the IO in the IO queue to the disk to be monitored, and suspend the IO service;
[0017] After adjusting the current scheduling strategy of the disk to be monitored to the target scheduling strategy, the method further includes:
[0018] The IO service is released to complete the IO in the disk to be monitored.
[0019] Preferably, adjusting the current scheduling strategy of the disk to be monitored to the target scheduling strategy includes:
[0020] If the current scheduling policy of the disk to be monitored is the target scheduling policy, the IO index items of the disk to be monitored continue to be monitored; otherwise, the current scheduling policy of the disk to be monitored is replaced with the target scheduling policy.
[0021] Preferably, before real-time or periodic monitoring of the IO index items of the disk to be monitored, the method further includes:
[0022] Based on the mark preset by the user, it is determined that the IO indicator items of the disk to be monitored need to be monitored in real time or it is determined that the IO indicator items of the disk to be monitored need to be monitored periodically.
[0023] Preferably, after adjusting the current scheduling strategy of the disk to be monitored to the target scheduling strategy, the method further includes:
[0024] The information that the current scheduling policy of the disk to be monitored has been adjusted to the target scheduling policy is output for the user to know.
[0025] A device for dynamically adjusting a disk scheduling strategy, comprising:
[0026] A determination module is used to: determine the disk for which the scheduling policy needs to be dynamically adjusted as the disk to be monitored;
[0027] The monitoring module is used to: monitor the IO index items of the disk to be monitored in real time or at a fixed time, and obtain the index data of the disk to be monitored corresponding to the IO index items within a preset time period before the current moment;
[0028] The adjustment module is used to: determine the scheduling strategy corresponding to the disk type and indicator data of the disk to be monitored as the target scheduling strategy, and adjust the current scheduling strategy of the disk to be monitored to the target scheduling strategy.
[0029] A device for dynamically adjusting a disk scheduling strategy, comprising:
[0030] Memory for storing computer programs;
[0031] A processor is used to implement the steps of the method for dynamically adjusting the disk scheduling strategy as described in any of the above items when executing the computer program.
[0032] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for dynamically adjusting a disk scheduling strategy as described in any one of the above items are implemented.
[0033] The present invention provides a method, device, equipment and storage medium for dynamically adjusting disk scheduling strategies, the method comprising: determining that the disk for which the scheduling strategy needs to be dynamically adjusted is a disk to be monitored; monitoring the IO index items of the disk to be monitored in real time or regularly, and obtaining the index data of the disk to be monitored corresponding to the IO index items in a preset time period before the current moment; determining that the scheduling strategy corresponding to the disk type and index data of the disk to be monitored is the target scheduling strategy, and adjusting the current scheduling strategy of the disk to be monitored to the target scheduling strategy. The present application monitors the IO index items of the disk in real time or regularly, obtains the index data corresponding to the IO index items that can represent the current business scenario, and then determines the corresponding scheduling strategy as the optimal scheduling strategy in combination with the index data and the disk type of the disk, and adjusts the actual scheduling strategy of the disk to the optimal scheduling strategy. It can be seen that the present application monitors the IO index items of the disk, automatically selects the optimal scheduling strategy based on the corresponding index data of the monitored IO index items and the disk type of the disk, and takes effect in real time, so that the dynamic adjustment of the disk scheduling strategy can be realized for complex and changeable business scenarios, and the stability and running speed of the system to which the disk belongs can be ensured, and the system performance can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0035] Figure 1 A flowchart of a method for dynamically adjusting a disk scheduling strategy provided by an embodiment of the present invention;
[0036] Figure 2 A schematic diagram of an implementation of determining a target scheduling strategy in a method for dynamically adjusting a disk scheduling strategy provided by an embodiment of the present invention;
[0037] Figure 3 A diagram of an implementation architecture of a method for dynamically adjusting a disk scheduling strategy provided by an embodiment of the present invention;
[0038] Figure 4 A flowchart of a method for dynamically adjusting a disk scheduling strategy provided by an embodiment of the present invention in a specific application scenario;
[0039] Figure 5 A structural diagram of a device for dynamically adjusting disk scheduling strategy provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] See also Figure 1 , which shows a flow chart of a method for dynamically adjusting a disk scheduling strategy provided by an embodiment of the present invention, which may specifically include:
[0042] S11: Determine the disk for which the scheduling policy needs to be dynamically adjusted as the disk to be monitored.
[0043] The execution subject of a method for dynamically adjusting a disk scheduling strategy provided by an embodiment of the present invention may be a corresponding device, and the device may be called a disk IO service monitoring module, that is, the present application implements dynamic adjustment of the disk scheduling strategy by extending the disk IO service monitoring module. Among them, the disk scheduling strategy has the same meaning as the scheduling strategy, and IO refers to read and write operations, that is, input and output operations. When it is determined that it is necessary to implement dynamic adjustment of any disk scheduling strategy, the embodiment of the present application may determine that any disk is a disk to be monitored, and then implement subsequent corresponding operations for the any disk.
[0044] S12: monitor the IO index items of the disk to be monitored in real time or periodically, and obtain index data of the IO index items corresponding to the disk to be monitored within a preset time period before the current moment.
[0045] The preset time period can be set according to actual needs, such as 10 minutes, 20 minutes, 30 minutes, etc.; the IO index items can be set according to actual needs, such as IO consolidation rate and read / write ratio, etc.; among them, the IO consolidation rate is the ratio of the number of IOs that can be merged within the preset time period to the total number of IOs within the preset time period, and the read / write ratio is the ratio of the number of read IOs divided by the number of write IOs within the preset time period. After determining the disk to be monitored, the IO index items of the disk to be monitored are monitored in real time or at regular intervals to obtain the value of the IO index items for the disk to be monitored within the preset time period between the current moment, that is, the index data.
[0046] S13: Determine a scheduling policy corresponding to the disk type and indicator data of the disk to be monitored as a target scheduling policy, and adjust the current scheduling policy of the disk to be monitored to the target scheduling policy.
[0047] Disk types may include mechanical disks, Nvme disks, SSD disks, and remote storage disks; based on this, after obtaining the index data of the disk to be monitored, the embodiment of the present application can determine the corresponding scheduling strategy as the target scheduling strategy in combination with the disk type and index data of the disk to be monitored, and then adjust the current scheduling strategy of the disk to be monitored to the target scheduling strategy. Among them, for different disk types and index data, the corresponding optimal scheduling strategy can be obtained in advance, and then the corresponding relationship between the business scenario represented by the disk type and index data and the corresponding optimal scheduling strategy can be obtained; accordingly, after obtaining the disk type and index data of the disk to be monitored, the scheduling strategy with a corresponding relationship with the disk type and index data can be determined, that is, the optimal scheduling strategy corresponding to the disk type and index data, and then the actual scheduling strategy of the disk to be monitored is adjusted to the optimal adjustment strategy.
[0048] This application monitors the IO index items of the disk in real time or periodically to obtain the corresponding index data of the IO index items that can represent the current business scenario, and then determines the corresponding scheduling strategy as the optimal scheduling strategy based on the index data and the disk type of the disk, and adjusts the actual scheduling strategy of the disk to the optimal scheduling strategy. It can be seen that this application monitors the IO index items of the disk, automatically selects the optimal scheduling strategy based on the corresponding index data of the monitored IO index items and the disk type of the disk, and takes effect in real time, so that the dynamic adjustment of the disk scheduling strategy can be achieved for complex and changeable business scenarios, which can ensure the stability and operation speed of the system to which the disk belongs, and effectively improve the system performance.
[0049] A method for dynamically adjusting a disk scheduling strategy provided by an embodiment of the present invention determines a scheduling strategy corresponding to the disk type and index data of a disk to be monitored as a target scheduling strategy, which may include:
[0050] If the indicator data indicates that the IO consolidation rate is less than the minimum consolidation rate threshold, the NOOP scheduling strategy is determined as the target scheduling strategy;
[0051] If the indicator data indicates that the IO merge rate is greater than the maximum merge rate threshold, the NOOP scheduling strategy is determined as the target scheduling strategy when the disk type is a mechanical disk, and the DEADLINE scheduling strategy is determined as the target scheduling strategy when the disk type is not a mechanical disk;
[0052] If the indicator data is between the lowest merge rate threshold and the highest merge rate threshold and the read / write ratio is less than the lowest ratio threshold, the write operation priority strategy is determined as the target scheduling strategy; if the indicator data is between the lowest merge rate threshold and the highest merge rate threshold and the read / write ratio is greater than the highest ratio threshold, the read operation priority strategy is determined as the target scheduling strategy; if the indicator data is between the lowest merge rate threshold and the highest merge rate threshold and the read / write ratio is between the lowest ratio threshold and the highest ratio threshold, then when the disk type is a mechanical disk, the ANTICIPATORY scheduling strategy is determined as the target scheduling strategy; when the disk type is not a mechanical disk, the NOOP scheduling strategy is determined as the target scheduling strategy.
[0053] The process of determining the target scheduling strategy can be as follows Figure 2As shown. Among them, the IO merger rate is between the minimum merger rate threshold and the maximum merger rate threshold: the IO merger rate is less than or equal to the maximum merger rate threshold, and the IO merger rate is greater than or equal to the minimum merger rate threshold; the read / write ratio is between the minimum ratio threshold and the maximum ratio threshold: the read / write ratio is less than or equal to the maximum ratio threshold, and the read / write ratio is greater than or equal to the maximum ratio threshold; and the minimum merger rate threshold, the maximum merger rate threshold, the minimum ratio threshold and the maximum ratio threshold can be set according to actual needs, such as the minimum merger rate threshold and the minimum ratio threshold can both be 30%, and the maximum merger rate threshold and the maximum ratio threshold can both be 70%. Specifically, indicator analysis is performed based on the indicator data corresponding to the IO indicator items. If it is determined that the IO merger rate is less than the minimum merger rate threshold, it means that the corresponding IO is sequential IO. If it is determined that the IO merger rate is greater than the maximum merger rate threshold, it means that the corresponding IO is random IO. If it is determined that the IO merger rate is between the minimum merger rate threshold and the maximum merger rate threshold, it is necessary to implement indicator analysis based on the read / write ratio. When implementing indicator analysis based on the read / write ratio, if the read / write ratio is less than the minimum ratio threshold, it means that the write operation accounts for a large proportion. If the read / write ratio is greater than the maximum ratio threshold, it means that the read ratio accounts for a large proportion. If the read / write ratio is between the minimum ratio threshold and the maximum ratio threshold, it means that it is mixed reading and writing. For the above situation, if it is sequential IO (that is, sequential writing and sequential reading), the NOOP scheduling strategy is determined as the target scheduling strategy; if it is random IO (that is, random writing and random reading), the DEADLINE scheduling strategy is determined as the target scheduling strategy when the disk is a mechanical disk, and the NOOP scheduling strategy is determined as the target scheduling strategy when the disk is an Nvme disk, an SSD disk, or a remote storage disk; if the reading ratio is high, the scheduling strategy that prioritizes the reading operation is determined as the target scheduling strategy, if the writing ratio is high, the scheduling strategy that prioritizes the writing operation is determined as the target scheduling strategy, if it is mixed reading and writing, the ANTICIPATORY scheduling strategy is determined as the target scheduling strategy when the disk is a mechanical disk, and the NOOP scheduling strategy is determined as the target scheduling strategy when the disk is an Nvme disk, an SSD disk, or a remote storage disk. In this way, the corresponding scheduling strategy is selected in different business scenarios to ensure that the scheduling strategy is the optimal scheduling strategy that conforms to the current business scenario.
[0054] A method for dynamically adjusting a disk scheduling strategy provided by an embodiment of the present invention monitors IO index items of a disk to be monitored in real time, which may include:
[0055] If there are multiple disks to be monitored, multiple sub-threads are used to monitor the IO index items of the multiple disks to be monitored in a one-to-one correspondence manner.
[0056] In the embodiment of the present application, the user can install a disk IO service monitoring module, and then configure which disks need to be dynamically adjusted in the scheduling strategy for the disk IO service monitoring module (all configurations can be defaulted); then, after starting the monitoring service of the disk IO service monitoring module, the main service of the disk IO service monitoring module will start a corresponding sub-thread for each disk to be monitored according to the number of disks to be monitored, and the sub-thread will be responsible for the IO indicator items corresponding to the disk to be monitored; thereby, the IO indicator items of multiple disks to be monitored can be monitored one by one in parallel through multiple sub-threads, thereby improving the monitoring efficiency.
[0057] A method for dynamically adjusting a disk scheduling strategy provided by an embodiment of the present invention may further include, before adjusting the current scheduling strategy of the disk to be monitored to the target scheduling strategy:
[0058] Send the IO in the IO queue to the disk to be monitored and suspend the IO business;
[0059] After adjusting the current scheduling policy of the disk to be monitored to the target scheduling policy, the following can also be included:
[0060] Release the IO service to complete the IO in the disk to be monitored.
[0061] In order to achieve the maximum number of IOs scheduled according to the optimal scheduling strategy and thus effectively improve system performance, before adjusting the scheduling strategy of the disk to be monitored, the embodiment of the present application can flush the IOs in the IO queue corresponding to the disk to be monitored to the disk to be monitored, and suspend the IO business, that is, temporarily not execute the IOs flushed to the disk to be monitored; after adjusting the scheduling strategy of the disk to be monitored, the IO business is released to execute the IOs in the disk to be monitored.
[0062] A method for dynamically adjusting a disk scheduling policy provided by an embodiment of the present invention, which adjusts the current scheduling policy of a disk to be monitored to a target scheduling policy, may include:
[0063] If the current scheduling policy of the disk to be monitored is the target scheduling policy, the IO indicator items of the disk to be monitored continue to be monitored; otherwise, the current scheduling policy of the disk to be monitored is replaced with the target scheduling policy.
[0064] If the current scheduling policy of the monitored disk is the target scheduling policy, it means that there is no need to change its current scheduling policy. Otherwise, the current scheduling policy of the monitored disk is modified to the target scheduling policy, thereby avoiding useless adjustment of the scheduling policy and ensuring the adjustment efficiency of the scheduling policy.
[0065] A method for dynamically adjusting a disk scheduling strategy provided by an embodiment of the present invention may further include, before real-time or periodic monitoring of IO indicators of a disk to be monitored:
[0066] Based on the mark preset by the user, it is determined that the IO indicator items of the disk to be monitored need to be monitored in real time or it is determined that the IO indicator items of the disk to be monitored need to be monitored periodically.
[0067] It should be noted that whether it is necessary to monitor the IO indicator items of the disk to be monitored in real time and then implement the corresponding scheduling strategy adjustment, or to monitor the IO indicator items of the disk to be monitored every certain time period (timing) and then implement the corresponding scheduling strategy adjustment, the user can achieve it by setting the corresponding mark, so that the user can realize the setting of scheduling strategy adjustment according to actual needs, thereby improving the user experience.
[0068] A method for dynamically adjusting a disk scheduling strategy provided by an embodiment of the present invention may further include:
[0069] The information that the current scheduling policy of the disk to be monitored has been adjusted to the target scheduling policy is output for the user to know.
[0070] After completing the adjustment of the scheduling strategy of the disk to be monitored in the embodiment of the present application, the adjustment completion information can also be output, and the adjustment completion information can also include the target scheduling strategy of the disk to be monitored, so that the user can timely know the scheduling status of the disk to be monitored, and then implement corresponding operations based on this.
[0071] In a specific implementation, a method for dynamically adjusting disk scheduling strategy provided by an embodiment of the present invention can be applied to a Linux system. In this case, it follows the Linux kernel module design, and its implementation architecture diagram can be as follows: Figure 3 As shown, the flow chart can be Figure 4 As shown, it may specifically include:
[0072] 1) The user installs the disk IO service monitoring module and configures which disks need to be monitored (all disks can be monitored by default);
[0073] 2) Start monitoring service;
[0074] 3) The main service will start a child thread for each disk that needs to be monitored based on the number of disks;
[0075] 4) The child thread is responsible for monitoring the IO indicators of the disk to which it belongs:
[0076] Mainly monitor the percentage of continuous IO. If the ratio is too low, it means that most of the current IO is random (or too many small files are read and written). If the ratio is too high, it means that most of the IO is sequential.
[0077] 5) Calculate the average value within a period (the period can be configured: 10, 20, 30 minutes);
[0078] 6) Predict the appropriate scheduling strategy based on the IO consolidation rate and read / write ratio:
[0079] The judgment rules are as follows: mainly based on the analysis of the read / write ratio and IO consolidation rate, determine the sequential read / write, random read / write, and mixed read / write situations, and then select the appropriate scheduling strategy based on the storage medium type;
[0080] 7) Determine whether the current scheduling strategy is in compliance;
[0081] 8) If yes, continue monitoring to select appropriate scheduling strategy when indicators change;
[0082] 9) If it does not meet the requirements, switch the scheduling strategy.
[0083] It can be seen that this application adds a disk IO business monitoring module in addition to the kernel IO scheduling strategy. It specifies the disk to be monitored through custom configuration, monitors the IO index items of the response disk, and automatically selects the most suitable scheduling strategy according to the IO index items and takes effect in real time. That is, this application dynamically and real-time adjusts the disk scheduling strategy according to the business type, maximizes the use of its IOPS and bandwidth, improves the resource utilization of the storage disk, improves IO performance, and adapts it to complex and changeable business scenarios; in addition, it is necessary to install this disk IO business monitoring module in the kernel and start the monitoring service; its service also runs in the system kernel and belongs to the operating system kernel module, which can ensure the stability and running speed of the system.
[0084] In addition, if there are new disk media (new types of disks) that support better scheduling strategies in the future, the disk type, business scenarios and corresponding scheduling strategies of the new disk media can be added to the disk IO business monitoring module as plug-ins, so that the corresponding better scheduling strategies can be selected based on the disk type and business scenarios of the new disk media to achieve scheduling.
[0085] The embodiment of the present invention also provides a device for dynamically adjusting the disk scheduling strategy, such as Figure 5 As shown, it may include:
[0086] The determination module 11 is used to: determine the disk for which the scheduling policy needs to be dynamically adjusted as the disk to be monitored;
[0087] The monitoring module 12 is used to: monitor the IO index items of the disk to be monitored in real time or at a fixed time, and obtain the index data of the IO index items corresponding to the disk to be monitored within a preset time period before the current moment;
[0088] The adjustment module 13 is used to: determine the scheduling policy corresponding to the disk type and index data of the disk to be monitored as the target scheduling policy, and adjust the current scheduling policy of the disk to be monitored to the target scheduling policy.
[0089] An embodiment of the present invention further provides a device for dynamically adjusting a disk scheduling strategy, which may include:
[0090] Memory for storing computer programs;
[0091] A processor is used to implement the steps of any of the above methods for dynamically adjusting disk scheduling strategies when executing a computer program.
[0092] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods for dynamically adjusting a disk scheduling strategy can be implemented.
[0093] It should be noted that the description of the relevant parts of the apparatus, device and storage medium for dynamically adjusting the disk scheduling strategy provided by the embodiment of the present invention can be found in the detailed description of the corresponding parts of the method for dynamically adjusting the disk scheduling strategy provided by the embodiment of the present invention, which will not be repeated here. In addition, the parts of the above technical solutions provided by the embodiment of the present invention that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive elaboration.
[0094] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for dynamically adjusting a disk scheduling strategy, characterized in that: include: Determine the disks that need to implement dynamic adjustment of scheduling policies as the disks to be monitored; Monitor the IO index items of the disk to be monitored in real time or periodically, and obtain the index data of the disk to be monitored corresponding to the IO index items within a preset time period before the current moment; Determine a scheduling strategy corresponding to the disk type and index data of the disk to be monitored as a target scheduling strategy, and adjust the current scheduling strategy of the disk to be monitored to the target scheduling strategy; Among them, the determination of the scheduling strategy corresponding to the disk type and indicator data of the disk to be monitored as the target scheduling strategy includes: if the indicator data indicates that the IO merger rate is less than the minimum merger rate threshold, then determining the NOOP scheduling strategy as the target scheduling strategy; if the indicator data indicates that the IO merger rate is greater than the maximum merger rate threshold, then determining the NOOP scheduling strategy as the target scheduling strategy when the disk type is a mechanical disk, and determining the DEADLINE scheduling strategy as the target scheduling strategy when the disk type is not a mechanical disk; if the indicator data is between the minimum merger rate threshold and the maximum merger rate threshold and the read / write ratio is less than the minimum ratio threshold, then determining the write operation priority strategy as the target scheduling strategy, if the indicator data is between the minimum merger rate threshold and the maximum merger rate threshold and the read / write ratio is greater than the maximum ratio threshold, then determining the read operation priority strategy as the target scheduling strategy, if the indicator data is between the minimum merger rate threshold and the maximum merger rate threshold and the read / write ratio is between the minimum ratio threshold and the maximum ratio threshold, then determining the ANTICIPATORY scheduling strategy as the target scheduling strategy when the disk type is a mechanical disk, and determining the NOOP scheduling strategy as the target scheduling strategy when the disk type is not a mechanical disk.
2. The method according to claim 1, characterized in that: Real-time monitoring of the IO indicators of the disk to be monitored includes: If there are multiple disks to be monitored, multiple sub-threads are used to monitor the IO index items of the multiple disks to be monitored in a one-to-one correspondence manner.
3. The method according to claim 2, characterized in that Before adjusting the current scheduling strategy of the disk to be monitored to the target scheduling strategy, the method further includes: Send the IO in the IO queue to the disk to be monitored, and suspend the IO service; After adjusting the current scheduling strategy of the disk to be monitored to the target scheduling strategy, the method further includes: The IO service is released to complete the IO in the disk to be monitored.
4. The method according to claim 3, characterized in that Adjusting the current scheduling strategy of the disk to be monitored to the target scheduling strategy includes: If the current scheduling policy of the disk to be monitored is the target scheduling policy, the IO index items of the disk to be monitored continue to be monitored; otherwise, the current scheduling policy of the disk to be monitored is replaced with the target scheduling policy.
5. The method according to claim 4, characterized in that Before real-time or periodic monitoring of the IO index items of the disk to be monitored, the method further includes: Based on the mark preset by the user, it is determined that the IO indicator items of the disk to be monitored need to be monitored in real time or it is determined that the IO indicator items of the disk to be monitored need to be monitored periodically.
6. The method according to claim 5, characterized in that After adjusting the current scheduling strategy of the disk to be monitored to the target scheduling strategy, the method further includes: The information that the current scheduling policy of the disk to be monitored has been adjusted to the target scheduling policy is output for the user to know.
7. A device for dynamically adjusting disk scheduling strategy, characterized in that: include: A determination module is used to: determine the disk for which the scheduling policy needs to be dynamically adjusted as the disk to be monitored; The monitoring module is used to: monitor the IO index items of the disk to be monitored in real time or at a fixed time, and obtain the index data of the disk to be monitored corresponding to the IO index items within a preset time period before the current moment; An adjustment module is used to: determine a scheduling strategy corresponding to the disk type and index data of the disk to be monitored as a target scheduling strategy, and adjust the current scheduling strategy of the disk to be monitored to the target scheduling strategy; The adjustment module is specifically used to determine the NOOP scheduling strategy as the target scheduling strategy if the indicator data indicates that the IO merger rate is less than the minimum merger rate threshold; if the indicator data indicates that the IO merger rate is greater than the maximum merger rate threshold, then when the disk type is a mechanical disk, the NOOP scheduling strategy is determined as the target scheduling strategy, and when the disk type is not a mechanical disk, the DEADLINE scheduling strategy is determined as the target scheduling strategy; if the indicator data is between the minimum merger rate threshold and the maximum merger rate threshold and the read / write ratio is less than the minimum ratio threshold, then the write operation priority strategy is determined as the target scheduling strategy; if the indicator data is between the minimum merger rate threshold and the maximum merger rate threshold and the read / write ratio is greater than the maximum ratio threshold, then the read operation priority strategy is determined as the target scheduling strategy; if the indicator data is between the minimum merger rate threshold and the maximum merger rate threshold and the read / write ratio is between the minimum ratio threshold and the maximum ratio threshold, then when the disk type is a mechanical disk, the ANTICIPATORY scheduling strategy is determined as the target scheduling strategy, and when the disk type is not a mechanical disk, the NOOP scheduling strategy is determined as the target scheduling strategy.
8. A device for dynamically adjusting disk scheduling strategy, characterized in that: include: Memory for storing computer programs; A processor is used to implement the steps of the method for dynamically adjusting the disk scheduling strategy as described in any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for dynamically adjusting the disk scheduling strategy according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Information processing method and solid state disk
CN106201347A