CN113687943A - Method, device and equipment for dynamically adjusting disk scheduling strategy - Google Patents

Method, device and equipment for dynamically adjusting disk scheduling strategy Download PDF

Info

Publication number
CN113687943A
CN113687943A CN202110864576.2A CN202110864576A CN113687943A CN 113687943 A CN113687943 A CN 113687943A CN 202110864576 A CN202110864576 A CN 202110864576A CN 113687943 A CN113687943 A CN 113687943A
Authority
CN
China
Prior art keywords
disk
monitored
scheduling strategy
determining
strategy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110864576.2A
Other languages
Chinese (zh)
Inventor
轩艳东
海鑫
马翱宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Mass Institute Of Information Technology
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Shandong Mass Institute Of Information Technology
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Mass Institute Of Information Technology, Zhengzhou Yunhai Information Technology Co Ltd filed Critical Shandong Mass Institute Of Information Technology
Priority to CN202110864576.2A priority Critical patent/CN113687943A/en
Publication of CN113687943A publication Critical patent/CN113687943A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method, a device, equipment and a storage medium for dynamically adjusting a disk scheduling strategy, wherein the method comprises the following steps: determining a disk which needs to realize dynamic adjustment of a scheduling strategy as a disk to be monitored; monitoring the IO index item of the disk to be monitored in real time or at regular time, and acquiring index data of the disk to be monitored corresponding to the IO index item in a preset time period before the current moment; determining a scheduling strategy corresponding to the disk type and the index data of the disk to be monitored as a target scheduling strategy, and adjusting the current scheduling strategy of the disk to be monitored as the target scheduling strategy. Therefore, by monitoring the IO index item of the disk, the optimal scheduling strategy is automatically selected and takes effect in real time based on the monitored index data corresponding to the IO index item and the disk type of the disk, the dynamic adjustment of the disk scheduling strategy can be realized aiming at complex and variable service scenes, the stability and the running speed of a system to which the disk belongs are ensured, and the system performance is effectively improved.

Description

Method, device and equipment for dynamically adjusting disk scheduling strategy
Technical Field
The present invention relates to the field of storage technologies, and in particular, to a method, an apparatus, a device, and a storage medium for dynamically adjusting a disk scheduling policy.
Background
The disk scheduling policy is a method for scheduling IO (Input/Output) of a disk, and is hereinafter referred to as a scheduling policy; in the prior art, it is usually necessary to manually analyze a service scenario corresponding to a disk to select an optimal scheduling policy, and implement scheduling of disk IO according to the optimal scheduling policy, but the inventor finds that a service scenario is not constant, and it is possible that the currently set optimal scheduling policy is not the optimal scheduling policy after a service is run for a period of time; therefore, the method for implementing scheduling policy setting in the prior art cannot adapt to complex and variable service scenarios, and further causes poor performance of the system to which the disk belongs.
Disclosure of Invention
The invention aims to provide a method, a device, equipment and a storage medium for dynamically adjusting a disk scheduling strategy, which can realize the dynamic adjustment of the disk scheduling strategy aiming at complex and variable service scenes, ensure the stability and the running speed of a system to which a disk belongs and effectively improve the performance of the system.
In order to achieve the above purpose, the invention provides the following technical scheme:
a method for dynamically adjusting a disk scheduling policy, comprising:
determining a disk which needs to realize dynamic adjustment of a scheduling strategy as a disk to be monitored;
monitoring the IO index item of the disk to be monitored in real time or at regular time, and acquiring index data of the disk to be monitored corresponding to the IO index item in a preset time period before the current moment;
determining a scheduling strategy corresponding to the disk type and the index data of the disk to be monitored as a target scheduling strategy, and adjusting the current scheduling strategy of the disk to be monitored as the target scheduling strategy.
Preferably, determining the scheduling policy corresponding to both the disk type and the index data of the disk to be monitored as the target scheduling policy includes:
if the index data indicate that the IO merging rate is smaller than the lowest merging rate threshold, determining that the NOOP scheduling strategy is a target scheduling strategy;
if the index data indicate that the IO merging rate is greater than the highest merging rate threshold, determining that the NOOP scheduling strategy is the target scheduling strategy when the disk type is a mechanical disk, and determining that the DEADLINE scheduling strategy is the target scheduling strategy when the disk type is not the mechanical disk;
if the index data is between the minimum merging rate threshold and the maximum merging rate threshold and the read/write duty ratio is smaller than the minimum duty ratio threshold, determining that the write operation strategy processed preferentially is a target scheduling strategy, if the index data is between the minimum merging rate threshold and the maximum merging rate threshold and the read/write duty ratio is larger than the maximum duty ratio threshold, determining that the read operation strategy processed preferentially is a target scheduling strategy, if the index data is between the minimum merging rate threshold and the maximum merging rate threshold and the read/write duty ratio is between the minimum duty ratio threshold and the maximum duty ratio threshold, determining that the ANTICIPATORY scheduling strategy is a target scheduling strategy when the disk type is a mechanical disk, and determining that the NOOP scheduling strategy is a target scheduling strategy when the disk type is not a mechanical disk.
Preferably, the monitoring the IO index item of the disk to be monitored in real time includes:
and if a plurality of disks to be monitored are determined, monitoring the IO index items of the plurality of disks to be monitored in a one-to-one corresponding mode by utilizing a plurality of sub threads.
Preferably, before adjusting the current scheduling policy of the disk to be monitored to the target scheduling policy, the method further includes:
issuing the IO in the IO queue to the disk to be monitored, and suspending IO service;
after the current scheduling policy of the disk to be monitored is adjusted to the target scheduling policy, the method further includes:
and releasing the IO service to complete IO in the disk to be monitored.
Preferably, the adjusting the current scheduling policy of the disk to be monitored to the target scheduling policy includes:
if the current scheduling strategy of the disk to be monitored is the target scheduling strategy, the IO index item of the disk to be monitored is continuously monitored, otherwise, the current scheduling strategy of the disk to be monitored is replaced by the target scheduling strategy.
Preferably, before monitoring the IO indicator item of the disk to be monitored in real time or at regular time, the method further includes:
and determining the IO index item of the disk to be monitored which needs to be monitored in real time or determining the IO index item of the disk to be monitored which needs to be monitored at regular time based on a mark preset by a user.
Preferably, after the current scheduling policy of the disk to be monitored is adjusted to the target scheduling policy, the method further includes:
and outputting the information that the current scheduling strategy of the disk to be monitored is adjusted to the target scheduling strategy for a user to know.
An apparatus for dynamically adjusting a disk scheduling policy, comprising:
a determination module to: determining a disk which needs to realize dynamic adjustment of a scheduling strategy as a disk to be monitored;
a monitoring module to: monitoring the IO index item of the disk to be monitored in real time or at regular time, and acquiring index data of the disk to be monitored corresponding to the IO index item in a preset time period before the current moment;
an adjustment module to: determining a scheduling strategy corresponding to the disk type and the index data of the disk to be monitored as a target scheduling strategy, and adjusting the current scheduling strategy of the disk to be monitored as the target scheduling strategy.
An apparatus for dynamically adjusting a disk scheduling policy, comprising:
a memory for storing a computer program;
a processor configured to implement the steps of the method for dynamically adjusting a disk scheduling policy according to any one of the above when executing the computer program.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of dynamically adjusting a disk scheduling policy as set forth in any one of the above.
The invention provides a method, a device, equipment and a storage medium for dynamically adjusting a disk scheduling strategy, wherein the method comprises the following steps: determining a disk which needs to realize dynamic adjustment of a scheduling strategy as a disk to be monitored; monitoring the IO index item of the disk to be monitored in real time or at regular time, and acquiring index data of the disk to be monitored corresponding to the IO index item in a preset time period before the current moment; determining a scheduling strategy corresponding to the disk type and the index data of the disk to be monitored as a target scheduling strategy, and adjusting the current scheduling strategy of the disk to be monitored as the target scheduling strategy. According to the method and the device, the index data corresponding to the IO index item capable of representing the current service scene is obtained by monitoring the IO index item of the disk in real time or at regular time, the corresponding scheduling strategy is determined to be the optimal scheduling strategy by combining the index data and the disk type of the disk, and the actual scheduling strategy of the disk is adjusted to be the optimal scheduling strategy. Therefore, the method and the device have the advantages that the IO index items of the disks are monitored, the optimal scheduling strategy is automatically selected and takes effect in real time based on the monitored index data corresponding to the IO index items and the disk types of the disks, so that the dynamic adjustment of the disk scheduling strategy can be realized for complex and variable service scenes, the stability and the running speed of a system to which the disks belong can be guaranteed, and the system performance is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for dynamically adjusting a disk scheduling policy according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating implementation of determining a target scheduling policy in a method for dynamically adjusting a disk scheduling policy according to an embodiment of the present invention;
fig. 3 is an implementation architecture diagram of a method for dynamically adjusting a disk scheduling policy according to an embodiment of the present invention;
fig. 4 is a flowchart of a method for dynamically adjusting a disk scheduling policy in a specific application scenario according to an embodiment of the present invention;
fig. 5 is a structural diagram of an apparatus for dynamically adjusting a disk scheduling policy according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a flowchart of a method for dynamically adjusting a disk scheduling policy according to an embodiment of the present invention is shown, where the method specifically includes:
s11: and determining the disk which needs to realize the dynamic adjustment of the scheduling strategy as the disk to be monitored.
The execution main body of the method for dynamically adjusting the disk scheduling policy provided by the embodiment of the invention can be a corresponding device, and the device can be called a disk IO service monitoring module, that is, the method and the device realize the dynamic adjustment of the disk scheduling policy by expanding the disk IO service monitoring module. The disk scheduling policy and the scheduling policy have the same meaning, and IO is read-write operation, i.e. input-output operation. When it is determined that dynamic adjustment of any disk scheduling policy needs to be implemented, 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.
S12: monitoring the IO index item of the disk to be monitored in real time or at regular time, and acquiring index data of the IO index item corresponding to the disk to be monitored in a preset time period before the current moment.
The preset time period can be set according to actual needs, such as 10 minutes, 20 minutes, 30 minutes and the like; the IO index items can be set according to actual needs, such as IO merging rate, read/write ratio and the like; the IO merging rate is the proportion of the number of the IOs which can be merged in the preset time period to the total number of the IOs in the preset time period, and the read/write proportion is the ratio of the number of the read IOs divided by the number of the write IOs in the preset time period. After the disk to be monitored is determined, monitoring the IO index item of the disk to be monitored in real time or at regular time to obtain the value of the IO index item generated for the disk to be monitored in a preset time period between the current moments, namely index data.
S13: determining a scheduling strategy corresponding to the disk type and the index data of the disk to be monitored as a target scheduling strategy, and adjusting the current scheduling strategy of the disk to be monitored as the target scheduling strategy.
The disk types may include mechanical disks, Nvme disks, SSD disks, and remote storage disks; based on this, after the index data of the disk to be monitored is obtained, the embodiment of the application can determine the corresponding scheduling policy as the target scheduling policy by combining the disk type of the disk to be monitored and the index data, and further adjust the current scheduling policy of the disk to be monitored to the target scheduling policy. The method comprises the steps that corresponding optimal scheduling strategies can be obtained in advance aiming at different disk types and index data, and then the corresponding relation between a service scene represented by the combination of the disk types and the index data and the corresponding optimal scheduling strategies is obtained; correspondingly, after the disk type and the index data of the disk to be monitored are obtained, the scheduling strategy having the corresponding relation with the disk type and the index data, that is, the optimal scheduling strategy corresponding to the disk type and the index data, can be determined, and then the actual scheduling strategy of the disk to be monitored is adjusted to the optimal adjustment strategy.
According to the method and the device, the index data corresponding to the IO index item capable of representing the current service scene is obtained by monitoring the IO index item of the disk in real time or at regular time, the corresponding scheduling strategy is determined to be the optimal scheduling strategy by combining the index data and the disk type of the disk, and the actual scheduling strategy of the disk is adjusted to be the optimal scheduling strategy. Therefore, the method and the device have the advantages that the IO index items of the disks are monitored, the optimal scheduling strategy is automatically selected and takes effect in real time based on the monitored index data corresponding to the IO index items and the disk types of the disks, so that the dynamic adjustment of the disk scheduling strategy can be realized for complex and variable service scenes, the stability and the running speed of a system to which the disks belong can be guaranteed, and the system performance is effectively improved.
The method for dynamically adjusting a disk scheduling policy provided in the embodiment of the present invention determines a scheduling policy corresponding to both a disk type and index data of a disk to be monitored as a target scheduling policy, and may include:
if the index data indicate that the IO merging rate is smaller than the lowest merging rate threshold, determining the NOOP scheduling strategy as a target scheduling strategy;
if the index data indicate that the IO merging rate is greater than the highest merging rate threshold, determining that the NOOP scheduling strategy is the target scheduling strategy when the disk type is a mechanical disk, and determining that the DEADLINE scheduling strategy is the target scheduling strategy when the disk type is not the mechanical disk;
if the index data is between the lowest merging rate threshold and the highest merging rate threshold and the read/write duty ratio is smaller than the lowest duty ratio threshold, determining that the write operation strategy processed preferentially is a target scheduling strategy, if the index data is between the lowest merging rate threshold and the highest merging rate threshold and the read/write duty ratio is larger than the highest duty ratio threshold, determining that the read operation strategy processed preferentially is a target scheduling strategy, if the index data is between the lowest merging rate threshold and the highest merging rate threshold and the read/write duty ratio is between the lowest duty ratio threshold and the highest duty ratio threshold, determining that the ANTICIPATORY scheduling strategy is the target scheduling strategy when the disk type is a mechanical disk, and determining that the NOOP scheduling strategy is the target scheduling strategy when the disk type is not a mechanical disk.
The process of determining the target scheduling policy may be as shown in fig. 2. Wherein, the IO merging rate between the lowest merging rate threshold and the highest merging rate threshold is: the IO merging rate is smaller than or equal to the highest merging rate threshold, and the IO merging rate is larger than or equal to the lowest merging rate threshold; the ratio of read/write duty ratio between the lowest threshold value of duty ratio and the highest threshold value of duty ratio is as follows: the read/write duty ratio is less than or equal to the duty ratio highest threshold, and the read/write duty ratio is greater than or equal to the duty ratio highest threshold; the minimum merging rate threshold, the maximum merging rate threshold, the minimum ratio threshold and the maximum ratio threshold may be set according to actual needs, for example, the minimum merging rate threshold and the minimum ratio threshold may be 30%, and the maximum merging rate threshold and the maximum ratio threshold may be 70%. Specifically, index analysis is performed on the basis of index data corresponding to the IO index items, if the IO merging rate is determined to be smaller than the lowest merging rate threshold, the corresponding IO is indicated to be sequential IO, if the IO merging rate is determined to be larger than the highest merging rate threshold, the corresponding IO is indicated to be random IO, and if the IO merging rate is determined to be between the lowest merging rate threshold and the highest merging rate threshold, the index analysis needs to be realized on the basis of the read/write ratio; when the index analysis is realized based on the read/write ratio, if the read/write ratio is smaller than the ratio minimum threshold, the write operation ratio is more, if the read/write ratio is larger than the ratio maximum threshold, the read ratio is more, and if the read/write ratio is between the ratio minimum threshold and the ratio maximum threshold, the mixed read/write is performed. For the above situation, if the order is sequential IO (i.e. sequential write and sequential read), determining that the NOOP scheduling policy is the target scheduling policy; if the data is random IO (namely random write and random read), determining a DEADLINE scheduling strategy as a target scheduling strategy when the magnetic disk is a mechanical disk, and determining an NOOP scheduling strategy as the target scheduling strategy when the magnetic disk is an Nvme disk or an SSD disk or a remote storage magnetic disk; if the read occupation ratio is more, the scheduling strategy for preferentially processing the read operation is determined to be a target scheduling strategy, if the write occupation ratio is more, the scheduling strategy for preferentially processing the write operation is determined to be the target scheduling strategy, if the write occupation ratio is more, the anti performance scheduling strategy is determined to be the target scheduling strategy when the magnetic disk is a mechanical disk, and the NOOP scheduling strategy is determined to be the target scheduling strategy when the magnetic disk is an Nvme disk, an SSD disk or a remote storage disk. Therefore, the corresponding scheduling strategy is selected under different service scenes, and the scheduling strategy is guaranteed to be the optimal scheduling strategy which is consistent with the current service scene.
The method for dynamically adjusting the disk scheduling policy provided by the embodiment of the invention monitors the IO index item of the disk to be monitored in real time, and may include:
and if a plurality of disks to be monitored are determined, monitoring the IO index items of the plurality of disks to be monitored in a one-to-one corresponding mode by utilizing the plurality of sub threads.
In the embodiment of the application, a user can install a disk IO service monitoring module, and then configure which disks need to be dynamically adjusted in a scheduling policy for the disk IO service monitoring module (all configurations can be defaulted); after the monitoring service of the disk IO service monitoring module is started, the main service of the disk IO service monitoring module starts a corresponding sub-thread for each disk to be monitored according to the number of the disks of the disk to be monitored, and the sub-thread is responsible for the IO index item corresponding to the disk to be monitored; therefore, IO index items can be monitored by the plurality of sub threads in parallel in one-to-one correspondence to the plurality of disks to be monitored, and monitoring efficiency is improved.
The method for dynamically adjusting a disk scheduling policy provided in the embodiment of the present invention may further include, before adjusting a current scheduling policy of a disk to be monitored to a target scheduling policy:
issuing the IO in the IO queue to a disk to be monitored, and suspending IO service;
after the current scheduling policy of the disk to be monitored is adjusted to the target scheduling policy, the method may further include:
and releasing the IO service to complete IO in the disk to be monitored.
In order to maximize the number of IO scheduled according to the optimal scheduling policy, and further effectively improve system performance, in the embodiment of the present application, before the scheduling policy of the disk to be monitored is adjusted, IO in the IO queue corresponding to the disk to be monitored may be brushed to the disk to be monitored, and an IO service is suspended, that is, IO brushed to the disk to be monitored is not temporarily executed; and releasing the IO service after the adjustment of the scheduling strategy of the disk to be monitored is realized so as to execute the IO in the disk to be monitored.
The method for dynamically adjusting a disk scheduling policy provided by the embodiment of the present invention adjusts a current scheduling policy of a disk to be monitored to a target scheduling policy, and may include:
and if the current scheduling strategy of the disk to be monitored is the target scheduling strategy, continuously monitoring the IO index item of the disk to be monitored, otherwise, replacing the current scheduling strategy of the disk to be monitored with the target scheduling strategy.
If the current scheduling strategy of the disk to be monitored is the target scheduling strategy, the current scheduling strategy does not need to be changed, otherwise, the current scheduling strategy of the disk to be monitored is modified into the target scheduling strategy, so that useless adjustment of the scheduling strategy is avoided, and the adjustment efficiency of the scheduling strategy is ensured.
The method for dynamically adjusting the disk scheduling policy provided in the embodiment of the present invention may further include, before monitoring the IO index item of the disk to be monitored in real time or at regular time:
and determining the IO index item of the disk to be monitored which needs to be monitored in real time or determining the IO index item of the disk to be monitored which needs to be monitored at regular time based on the mark preset by the user.
It should be noted that, for whether the IO index item of the disk to be monitored needs to be monitored in real time to realize the corresponding scheduling policy adjustment, or the IO index item of the disk to be monitored needs to be monitored every certain period of time (timing) to realize the corresponding scheduling policy adjustment, both the IO index item and the corresponding scheduling policy adjustment can be realized by setting a corresponding mark by a user, so that the user can conveniently realize the setting of the scheduling policy adjustment according to actual needs, and user experience is improved.
The method for dynamically adjusting a disk scheduling policy provided in the embodiment of the present invention may further include, after adjusting a current scheduling policy of a disk to be monitored to a target scheduling policy:
and outputting the information that the current scheduling strategy of the disk to be monitored is adjusted to the target scheduling strategy for the user to know.
After the adjustment of the disk scheduling policy to be monitored is completed, the adjusted information can be output, and the adjusted information can also include the target scheduling policy of the disk to be monitored, so that a user can timely know the scheduling condition of the disk to be monitored, and further corresponding operation is realized based on the scheduling condition.
In a specific implementation manner, the method for dynamically adjusting a disk scheduling policy provided by the embodiment of the present invention may be applied to a Linux system, where the Linux system follows a Linux kernel module design, an implementation architecture diagram of the method may be shown in fig. 3, and a flowchart may be shown in fig. 4, and specifically may include:
1) a user installs a disk IO service monitoring module, and configures which disks need to be monitored (all the disks need to be monitored by default);
2) starting a monitoring service;
3) the main service starts a sub thread for each disk to be monitored according to the number of the disks;
4) the sub-thread is responsible for monitoring IO indexes of the disk:
the percentage of continuous IO is mainly monitored, if the ratio is too low, most of the continuous IO is proved to be random IO (or too many small files are read and written), and if the ratio is too high, most of the continuous IO is proved to be sequential IO;
5) the average value in one period is counted (period configurable: 10. 20, 30 minutes);
6) pre-judging a proper scheduling strategy according to the IO merging rate and the read/write ratio:
the decision rule is as follows: analyzing the read/write proportion and the IO merging rate mainly according to indexes, judging the conditions of sequential reading and writing, random reading and writing and mixed reading and writing, and then selecting a proper scheduling strategy according to the type of a storage medium;
7) judging whether the current scheduling strategy is in accordance with;
8) if the indexes are changed, continuing monitoring so as to select a proper scheduling strategy;
9) if not, the scheduling strategy is switched.
The method includes the steps that a disk IO service monitoring module is additionally arranged outside a kernel IO scheduling strategy, a disk to be monitored is appointed through self-defined configuration, IO index items of a response disk are monitored, the most conforming scheduling strategy is automatically selected according to the IO index items and becomes effective in real time, namely the scheduling strategy of the disk is dynamically and real-timely adjusted according to service types, IOPS and bandwidth of the scheduling strategy are utilized to the maximum extent, resource utilization rate of the storage disk is improved, IO performance is improved, and the scheduling strategy is made to adapt to complex and changeable service scenes; in addition, the disk IO service monitoring module needs to be installed in the kernel, and monitoring service is started; the service of the system runs in a system kernel, belongs to an operating system kernel module, and can ensure the stability and the running speed of the system.
In addition, if a new disk medium (a new type of disk) supports a better scheduling policy subsequently, the disk type, the service scenario, and the corresponding scheduling policy of the new disk medium can be added to the disk IO service monitoring module as plug-ins, so that a corresponding better scheduling policy can be selected to implement scheduling subsequently based on the disk type and the service scenario of the new disk medium.
An embodiment of the present invention further provides a device for dynamically adjusting a disk scheduling policy, as shown in fig. 5, where the device may include:
a determining module 11, configured to: determining a disk which needs to realize dynamic adjustment of a scheduling strategy as a disk to be monitored;
a monitoring module 12 for: monitoring IO index items of a disk to be monitored in real time or at regular time, and acquiring index data of the IO index items corresponding to the disk to be monitored in a preset time period before the current moment;
an adjustment module 13 configured to: determining a scheduling strategy corresponding to the disk type and the index data of the disk to be monitored as a target scheduling strategy, and adjusting the current scheduling strategy of the disk to be monitored as the target scheduling strategy.
An embodiment of the present invention further provides a device for dynamically adjusting a disk scheduling policy, where the device may include:
a memory for storing a computer program;
a processor for implementing the steps of the method for dynamically adjusting a disk scheduling policy according to any one of the above items when executing a computer program.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for dynamically adjusting a disk scheduling policy may be implemented as described above.
It should be noted that for the description of the relevant parts in the apparatus, the device, and the storage medium for dynamically adjusting the disk scheduling policy provided in the embodiment of the present invention, reference is made to the detailed description of the corresponding parts in the method for dynamically adjusting the disk scheduling policy provided in the embodiment of the present invention, and details are not described here again. In addition, parts of the above technical solutions provided in the embodiments 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, so as to avoid redundant description.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for dynamically adjusting a disk scheduling policy, comprising:
determining a disk which needs to realize dynamic adjustment of a scheduling strategy as a disk to be monitored;
monitoring the IO index item of the disk to be monitored in real time or at regular time, and acquiring index data of the disk to be monitored corresponding to the IO index item in a preset time period before the current moment;
determining a scheduling strategy corresponding to the disk type and the index data of the disk to be monitored as a target scheduling strategy, and adjusting the current scheduling strategy of the disk to be monitored as the target scheduling strategy.
2. The method of claim 1, wherein determining the scheduling policy corresponding to both the disk type and the index data of the disk to be monitored as a target scheduling policy comprises:
if the index data indicate that the IO merging rate is smaller than the lowest merging rate threshold, determining that the NOOP scheduling strategy is a target scheduling strategy;
if the index data indicate that the IO merging rate is greater than the highest merging rate threshold, determining that the NOOP scheduling strategy is the target scheduling strategy when the disk type is a mechanical disk, and determining that the DEADLINE scheduling strategy is the target scheduling strategy when the disk type is not the mechanical disk;
if the index data is between the minimum merging rate threshold and the maximum merging rate threshold and the read/write duty ratio is smaller than the minimum duty ratio threshold, determining that the write operation strategy processed preferentially is a target scheduling strategy, if the index data is between the minimum merging rate threshold and the maximum merging rate threshold and the read/write duty ratio is larger than the maximum duty ratio threshold, determining that the read operation strategy processed preferentially is a target scheduling strategy, if the index data is between the minimum merging rate threshold and the maximum merging rate threshold and the read/write duty ratio is between the minimum duty ratio threshold and the maximum duty ratio threshold, determining that the ANTICIPATORY scheduling strategy is a target scheduling strategy when the disk type is a mechanical disk, and determining that the NOOP scheduling strategy is a target scheduling strategy when the disk type is not a mechanical disk.
3. The method according to claim 2, wherein the monitoring of the IO indicator item of the disk to be monitored in real time includes:
and if a plurality of disks to be monitored are determined, monitoring the IO index items of the plurality of disks to be monitored in a one-to-one corresponding mode by utilizing a plurality of sub threads.
4. The method of claim 3, wherein before adjusting the current scheduling policy of the disk to be monitored to the target scheduling policy, the method further comprises:
issuing the IO in the IO queue to the disk to be monitored, and suspending IO service;
after the current scheduling policy of the disk to be monitored is adjusted to the target scheduling policy, the method further includes:
and releasing the IO service to complete IO in the disk to be monitored.
5. The method of claim 4, wherein adjusting the current scheduling policy of the disk to be monitored to the target scheduling policy comprises:
if the current scheduling strategy of the disk to be monitored is the target scheduling strategy, the IO index item of the disk to be monitored is continuously monitored, otherwise, the current scheduling strategy of the disk to be monitored is replaced by the target scheduling strategy.
6. The method according to claim 5, before monitoring the IO indicator item of the disk to be monitored in real time or at regular time, further comprising:
and determining the IO index item of the disk to be monitored which needs to be monitored in real time or determining the IO index item of the disk to be monitored which needs to be monitored at regular time based on a mark preset by a user.
7. The method of claim 6, wherein after adjusting the current scheduling policy of the disk to be monitored to the target scheduling policy, further comprising:
and outputting the information that the current scheduling strategy of the disk to be monitored is adjusted to the target scheduling strategy for a user to know.
8. An apparatus for dynamically adjusting a disk scheduling policy, comprising:
a determination module to: determining a disk which needs to realize dynamic adjustment of a scheduling strategy as a disk to be monitored;
a monitoring module to: monitoring the IO index item of the disk to be monitored in real time or at regular time, and acquiring index data of the disk to be monitored corresponding to the IO index item in a preset time period before the current moment;
an adjustment module to: determining a scheduling strategy corresponding to the disk type and the index data of the disk to be monitored as a target scheduling strategy, and adjusting the current scheduling strategy of the disk to be monitored as the target scheduling strategy.
9. An apparatus for dynamically adjusting a disk scheduling policy, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method for dynamically adjusting a disk scheduling policy according to any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, having a computer program stored thereon, which, when being executed by a processor, carries out the steps of the method for dynamically adjusting a disk scheduling policy according to any one of claims 1 to 7.
CN202110864576.2A 2021-07-29 2021-07-29 Method, device and equipment for dynamically adjusting disk scheduling strategy Pending CN113687943A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110864576.2A CN113687943A (en) 2021-07-29 2021-07-29 Method, device and equipment for dynamically adjusting disk scheduling strategy

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110864576.2A CN113687943A (en) 2021-07-29 2021-07-29 Method, device and equipment for dynamically adjusting disk scheduling strategy

Publications (1)

Publication Number Publication Date
CN113687943A true CN113687943A (en) 2021-11-23

Family

ID=78578235

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110864576.2A Pending CN113687943A (en) 2021-07-29 2021-07-29 Method, device and equipment for dynamically adjusting disk scheduling strategy

Country Status (1)

Country Link
CN (1) CN113687943A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115658280A (en) * 2022-12-19 2023-01-31 苏州浪潮智能科技有限公司 Method, system, equipment and medium for optimizing IO task
CN116520969A (en) * 2023-07-04 2023-08-01 四川弘仁财电科技有限公司 Device, system and method for controlling power consumption of server

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115658280A (en) * 2022-12-19 2023-01-31 苏州浪潮智能科技有限公司 Method, system, equipment and medium for optimizing IO task
CN116520969A (en) * 2023-07-04 2023-08-01 四川弘仁财电科技有限公司 Device, system and method for controlling power consumption of server
CN116520969B (en) * 2023-07-04 2023-09-08 四川弘仁财电科技有限公司 Device, system and method for controlling power consumption of server

Similar Documents

Publication Publication Date Title
CN113687943A (en) Method, device and equipment for dynamically adjusting disk scheduling strategy
US9454407B2 (en) Service resource allocation
US8424007B1 (en) Prioritizing tasks from virtual machines
US8136113B2 (en) Method and apparatus for adjusting sleep time of fixed high-priority threads
US20150248312A1 (en) Performance-aware job scheduling under power constraints
CN111522636A (en) Application container adjusting method, application container adjusting system, computer readable medium and terminal device
CN110737534A (en) Task processing method and device and server
CN109992366B (en) Task scheduling method and task scheduling device
WO2022213973A1 (en) Scheduling method and apparatus for io request
CN112433881A (en) Data recovery method and device for distributed storage system
CN110674064B (en) Data transmission method, device, equipment and computer readable storage medium
CN108932112B (en) Data read-write method, device, equipment and medium for solid particles
CN113377278A (en) Solid state disk, garbage recycling and controlling method, equipment, system and storage medium
CN109032503B (en) Flow control method and device for data migration bandwidth of solid state disk
US7783797B2 (en) Adaptive bandwidth distribution system for high-performance input/output devices with variable throughput
CN112612587B (en) Spark platform dynamic resource allocation method for flow analysis
CN116248699B (en) Data reading method, device, equipment and storage medium in multi-copy scene
US11194619B2 (en) Information processing system and non-transitory computer readable medium storing program for multitenant service
CN112015326B (en) Cluster data processing method, device, equipment and storage medium
CN111506425A (en) Method and device for processing quality of service data
CN115951845A (en) Disk management method, device, equipment and storage medium
CN114327259B (en) Flash memory channel controller operation method, device, equipment and storage medium
CN109284223B (en) Configurable debugging method and system
CN112612578A (en) Virtual machine monitoring method and device
CN109947365A (en) A kind of distributed storage data verification method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination