CN113687943B - A method, device and equipment for dynamically adjusting disk scheduling strategy - Google Patents

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

Info

Publication number
CN113687943B
CN113687943B CN202110864576.2A CN202110864576A CN113687943B CN 113687943 B CN113687943 B CN 113687943B CN 202110864576 A CN202110864576 A CN 202110864576A CN 113687943 B CN113687943 B CN 113687943B
Authority
CN
China
Prior art keywords
disk
monitored
scheduling policy
scheduling
policy
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.)
Active
Application number
CN202110864576.2A
Other languages
Chinese (zh)
Other versions
CN113687943A (en
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/CN113687943B/en
Publication of CN113687943A publication Critical patent/CN113687943A/en
Application granted granted Critical
Publication of CN113687943B publication Critical patent/CN113687943B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00—Arrangements for program control, e.g. control units
    • G06F9/06—Arrangements 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/46—Multiprogramming arrangements
    • G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011—Allocation 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
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00—Error detection; Error correction; Monitoring
    • G06F11/30—Monitoring
    • G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037—Monitoring 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)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method, a device, equipment and a storage medium for dynamically adjusting a disk scheduling strategy, wherein the method comprises the steps of determining a disk needing to be dynamically adjusted by the scheduling strategy as a disk to be monitored; the method comprises the steps of monitoring IO index items of a to-be-monitored disk in real time or at fixed time, obtaining index data of the to-be-monitored disk corresponding to the IO index items in a preset time period before the current moment, determining a scheduling strategy corresponding to the disk type and the index data of the to-be-monitored disk as a target scheduling strategy, and adjusting the current scheduling strategy of the to-be-monitored disk to the target scheduling strategy. Therefore, the application automatically selects the optimal scheduling strategy based on the monitored IO index item corresponding index data and the disk type of the disk and takes effect in real time by monitoring the IO index item of the disk, can realize the dynamic adjustment of the disk scheduling strategy aiming at complex and changeable service scenes, ensures the stability and the running speed of the system of the disk and effectively improves the system performance.

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, which is hereinafter referred to as scheduling policy, in the prior art, a corresponding service scene of the disk is usually needed to be manually analyzed to select an optimal scheduling policy, and the scheduling of IO of the disk is realized according to the optimal scheduling policy, however, the inventor finds that the service scene is not invariable, and the optimal scheduling policy which is possibly set at present is not the optimal scheduling policy after a period of service operation, so that a mode for realizing the setting of the scheduling policy in the prior art cannot adapt to complex and variable service scenes, and further the performance of a system to which the disk belongs is poor.
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 changeable 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 object, the present invention provides the following technical solutions:
A method of dynamically adjusting disk scheduling policies, comprising:
determining a disk needing to realize dynamic adjustment of a scheduling strategy as a disk to be monitored;
Monitoring IO index items of the magnetic disk to be monitored in real time or at fixed time, and acquiring index data of the magnetic disk to be monitored corresponding to the IO index items in a preset time period before the current moment;
Determining a scheduling policy corresponding to the disc type and index data of the disc to be monitored as a target scheduling policy, and adjusting the current scheduling policy of the disc to be monitored as the target scheduling policy.
Preferably, determining the scheduling policy corresponding to the disc type and the index data of the disc to be monitored as the target scheduling policy includes:
If the index data indicates 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 indicates that the IO merging rate is greater than the highest merging rate threshold, determining that the NOOP scheduling policy is a target scheduling policy when the disk type is a mechanical disk, and determining DEADLINE scheduling policy is a target scheduling policy when the disk type is not the mechanical disk;
And 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 priority processing write operation strategy 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 priority processing read operation strategy is a target scheduling strategy, and 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 ANTICIPATORY scheduling strategy as 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 the mechanical disk.
Preferably, the monitoring, in real time, the IO index item of the to-be-monitored disk includes:
if the number of the disks to be monitored is determined to be multiple, the IO index items of the multiple disks to be monitored are monitored in a one-to-one correspondence mode by utilizing multiple sub-threads.
Preferably, before adjusting the current scheduling policy of the to-be-monitored disk 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 to-be-monitored disk is adjusted to the target scheduling policy, the method further comprises:
and releasing the IO service to finish IO in the disk to be monitored.
Preferably, the adjusting the current scheduling policy of the to-be-monitored disk to the target scheduling policy includes:
If the current scheduling policy of the to-be-monitored disk is the target scheduling policy, continuing to monitor the IO index item of the to-be-monitored disk, otherwise, replacing the current scheduling policy of the to-be-monitored disk with the target scheduling policy.
Preferably, before monitoring the IO index item of the disk to be monitored in real time or at fixed time, the method further includes:
Based on a mark preset by a user, determining an IO index item needing to be monitored in real time or determining an IO index item needing to be monitored in a timing mode.
Preferably, after adjusting the current scheduling policy of the to-be-monitored disk to the target scheduling policy, the method further includes:
And outputting the information of the current scheduling strategy of the magnetic disk to be monitored, which is adjusted to the target scheduling strategy, so that the information can be obtained by a user.
An apparatus for dynamically adjusting disk scheduling policies, comprising:
the determining module is used for determining a disk needing to realize dynamic adjustment of the scheduling strategy as a disk to be monitored;
The monitoring module is used for monitoring IO index items of the magnetic disk to be monitored in real time or at fixed time and acquiring index data of the magnetic disk to be monitored corresponding to the IO index items in a preset time period before the current moment;
and the adjustment module is used for determining the scheduling strategy corresponding to the disk type and 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 disk scheduling policies, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of dynamically adjusting disk scheduling policies as claimed in any one of the preceding claims when said computer program is executed.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of a method of dynamically adjusting a disk scheduling policy as claimed in any one of the preceding claims.
The application provides a method, a device, equipment and a storage medium for dynamically adjusting a disk scheduling strategy, wherein the method comprises the steps of determining a disk needing to be dynamically adjusted by the scheduling strategy as a disk to be monitored; the method comprises the steps of monitoring IO index items of a to-be-monitored disk in real time or at fixed time, obtaining index data of the to-be-monitored disk corresponding to the IO index items in a preset time period before the current moment, determining a scheduling strategy corresponding to the disk type and the index data of the to-be-monitored disk as a target scheduling strategy, and adjusting the current scheduling strategy of the to-be-monitored disk to the target scheduling strategy. According to the method, the IO index items of the disk are monitored in real time or at fixed time, the index data corresponding to the IO index items capable of representing the current service scene are obtained, 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 application automatically selects the optimal scheduling strategy based on the monitored IO index item corresponding index data and the disk type of the disk and takes effect in real time by monitoring the IO index item of the disk, thereby realizing the dynamic adjustment of the disk scheduling strategy aiming at complex and changeable service scenes, ensuring the stability and the running speed of the system of the disk and effectively improving the performance of the system.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
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 the implementation of a target scheduling policy determined in a method for dynamically adjusting a disk scheduling policy according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an implementation 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 block diagram of an apparatus for dynamically adjusting a disk scheduling policy according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the 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 may specifically include:
and S11, determining the disk needing to realize 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 application can be a corresponding device, and the device can be called a disk IO service monitoring module, namely the method for dynamically adjusting the disk scheduling policy is realized by expanding the disk IO service monitoring module. The disk scheduling policy has the same meaning as the scheduling policy, and IO is read-write operation, i.e. input-output operation. When the dynamic adjustment of any disk scheduling strategy is determined to be needed, the embodiment of the application can determine that any disk is a disk to be monitored, and further realize the subsequent corresponding operation aiming at the any disk.
And S12, monitoring IO index items of the magnetic disk to be monitored in real time or at fixed time, and acquiring index data of the IO index items corresponding to the magnetic 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 item can be set according to actual needs, such as IO merging rate, read/write duty ratio and the like, wherein the IO merging rate is the ratio of the number of the IOs which can be merged in the preset time period to the number of all the IOs in the preset time period, and the read/write duty ratio is the ratio of the number of the read IOs divided by the number of the write IOs in the preset time period. After determining the disk to be monitored, monitoring IO index items of the disk to be monitored in real time or at fixed time to acquire values of the IO index items which occur in a preset time period between the current moments and the disk to be monitored, namely index data.
S13, determining a scheduling strategy corresponding to the disc type and index data of the disc to be monitored as a target scheduling strategy, and adjusting the current scheduling strategy of the disc to be monitored as the target scheduling strategy.
Based on the method, after index data of the to-be-monitored disk is obtained, the corresponding scheduling strategy can be determined to be a target scheduling strategy by combining the disk type of the to-be-monitored disk and the index data, and then the current scheduling strategy of the to-be-monitored disk is adjusted to be the target scheduling strategy. The method comprises the steps of obtaining a service scene represented by a disc type and index data, obtaining a corresponding optimal scheduling strategy according to different disc types and index data, obtaining a corresponding relation between the service scene represented by the disc type and index data and the corresponding optimal scheduling strategy, and correspondingly, after obtaining the disc type and index data of a disc to be monitored, determining the scheduling strategy with the corresponding relation between the disc type and index data, namely the optimal scheduling strategy corresponding to the disc type and index data, and further adjusting the actual scheduling strategy of the disc to be monitored to the optimal adjusting strategy.
According to the method, the IO index items of the disk are monitored in real time or at fixed time, the index data corresponding to the IO index items capable of representing the current service scene are obtained, 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 application automatically selects the optimal scheduling strategy based on the monitored IO index item corresponding index data and the disk type of the disk and takes effect in real time by monitoring the IO index item of the disk, thereby realizing the dynamic adjustment of the disk scheduling strategy aiming at complex and changeable service scenes, ensuring the stability and the running speed of the system of the disk and effectively improving the performance of the system.
The method for dynamically adjusting the disk scheduling policy provided by the embodiment of the invention determines the scheduling policy corresponding to the disk type and index data of the disk to be monitored as the target scheduling policy, and can comprise the following steps:
if the index data indicates 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 indicates that the IO merging rate is greater than the highest merging rate threshold, determining that the NOOP scheduling policy is a target scheduling policy when the disk type is a mechanical disk, and determining DEADLINE scheduling policy is a target scheduling policy 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 priority processing write operation strategy 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 priority processing read operation strategy 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 ANTICIPATORY that the 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.
The process of determining the target scheduling policy may be as shown in fig. 2. The IO merging rate is between a lowest merging rate threshold and a highest merging rate threshold, wherein 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 read/write duty ratio is between the lowest duty ratio threshold and the highest duty ratio threshold, the read/write duty ratio is smaller than or equal to the highest duty ratio threshold and the read/write duty ratio is larger than or equal to the highest duty ratio threshold, the lowest merging rate threshold, the highest merging rate threshold, the lowest duty ratio threshold and the highest duty ratio threshold can be set according to practical needs, for example, the lowest merging rate threshold and the lowest duty ratio threshold can be 30%, and the highest merging rate threshold and the highest duty ratio threshold can be 70%. Specifically, index analysis is performed based on index data corresponding to IO index items, if the IO merging rate is determined to be smaller than a lowest merging rate threshold, corresponding IOs are described as sequential IOs, if the IO merging rate is determined to be larger than a highest merging rate threshold, corresponding IOs are described as random IOs, if the IO merging rate is determined to be between the lowest merging rate threshold and the highest merging rate threshold, index analysis based on a read/write duty ratio is needed, when index analysis based on the read/write duty ratio is performed, if the read/write duty ratio is smaller than the lowest duty ratio threshold, more writing operation duty ratio is described, if the read/write duty ratio is larger than the highest duty ratio threshold, more writing operation duty ratio is described, and if the read/write duty ratio is between the lowest duty ratio threshold and the highest duty ratio threshold, mixed reading and writing are described. For the above situation, if the order IO (i.e. order write and order read) is the NOOP scheduling policy is determined to be the target scheduling policy, if the order IO (i.e. random write and random read) is the random IO, the DEADLINE scheduling policy is determined to be the target scheduling policy when the disk is the mechanical disk, the NOOP scheduling policy is determined to be the target scheduling policy when the disk is Nvme disk or SSD disk or remote storage disk, the scheduling policy which is preferentially processing the read operation is determined to be the target scheduling policy if the read duty ratio is more, the scheduling policy which is preferentially processing the write operation is determined to be the target scheduling policy if the write duty ratio is more, the ANTICIPATORY scheduling policy is determined to be the target scheduling policy if the disk is the mechanical disk if the hybrid read/write is performed, and the NOOP scheduling policy is determined to be the target scheduling policy when the disk is Nvme disk or SSD disk or remote storage disk. And selecting a corresponding scheduling strategy under different service scenes, and ensuring that the scheduling strategy is an optimal scheduling strategy conforming to the current service scene.
The method for dynamically adjusting the disk scheduling policy provided by the embodiment of the invention can monitor IO index items of the disk to be monitored in real time, and can comprise the following steps:
If the number of the disks to be monitored is determined to be multiple, the IO index items of the multiple disks to be monitored are monitored in a one-to-one correspondence mode by utilizing the multiple sub-threads.
In the embodiment of the application, a user can install the disk IO service monitoring module, so that the disk IO service monitoring module is configured with dynamic adjustment (all the disks can be configured by default) of a scheduling strategy, and after monitoring service of the disk IO service monitoring module is started, a 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 to be monitored, and the sub-thread is responsible for IO index items of the corresponding disk to be monitored, so that monitoring of the IO index items can be realized by the parallel one-to-one correspondence of the plurality of disks to be monitored through the plurality of sub-threads, and the monitoring efficiency is improved.
The method for dynamically adjusting the disk scheduling policy provided by the embodiment of the invention can further comprise the following steps before adjusting the current scheduling policy of the disk to be monitored into the 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 finish the IO in the disk to be monitored.
In order to enable the number of IO to be scheduled to reach the maximum number according to the optimal scheduling strategy, and further effectively improve the system performance, the embodiment of the application can brush down the IO in the IO queue corresponding to the disc to be monitored and suspend IO service, namely, the IO which is brushed down to the disc to be monitored is temporarily not executed, and the IO service is released after the adjustment of the scheduling strategy of the disc to be monitored is realized, so that the IO in the disc to be monitored is executed.
The method for dynamically adjusting the disk scheduling policy provided by the embodiment of the invention adjusts the current scheduling policy of the disk to be monitored into the target scheduling policy, and can comprise the following steps:
if the current scheduling policy of the to-be-monitored disk is the target scheduling policy, continuing to monitor the IO index item of the to-be-monitored disk, otherwise, replacing the current scheduling policy of the to-be-monitored disk with the target scheduling policy.
If the current scheduling policy of the disk to be monitored is the target scheduling policy, the current scheduling policy of the disk to be monitored is not required to be changed, otherwise, the current scheduling policy of the disk to be monitored is modified to be the target scheduling policy, so that useless adjustment of the scheduling policy is avoided, and the adjustment efficiency of the scheduling policy is ensured.
The method for dynamically adjusting the disk scheduling policy provided by the embodiment of the invention can further comprise the following steps before the IO index item of the disk to be monitored is monitored in real time or at fixed time:
Based on a mark preset by a user, determining IO index items needing to be monitored on the disk to be monitored in real time or determining IO index items needing to be monitored on the disk to be monitored in a timing mode.
It should be noted that, for whether the IO index item of the disk to be monitored needs to be monitored in real time so as to realize corresponding adjustment of the scheduling policy, or for monitoring the IO index item of the disk to be monitored so as to realize corresponding adjustment of the scheduling policy when a certain period of time (timing) passes, the adjustment of the scheduling policy can be realized by the user through setting the corresponding mark, so that the user can conveniently realize the setting of the adjustment of the scheduling policy according to the actual needs, and user experience is improved.
The method for dynamically adjusting the disk scheduling policy provided by the embodiment of the invention can further comprise the following steps after adjusting the current scheduling policy of the disk to be monitored into the target scheduling policy:
And outputting the information of the current scheduling strategy of the disk to be monitored, which is adjusted to the target scheduling strategy, so that the information can be obtained by a user.
After the adjustment of the disk scheduling strategy to be monitored is completed, the information of the completion of the adjustment can be output, and the information of the completion of the adjustment can also comprise the target scheduling strategy of the disk to be monitored, so that a user can timely acquire the scheduling condition of the disk to be monitored, and corresponding operation is realized based on the scheduling condition.
In a specific implementation manner, the method for dynamically adjusting the disk scheduling policy provided by the embodiment of the invention can be applied to a Linux system, and at this time, the method conforms to the Linux kernel module design, the implementation structure diagram can be shown in fig. 3, the flow chart can be shown in fig. 4, and the method specifically can include:
1) The user installs a disk IO service monitoring module, configures which disks need to be monitored (all disks can be defaulted to be monitored);
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 belonging disk:
The method mainly monitors the percentage of continuous IO, if the ratio is too low, the current random IO (or too many small file read-write) is proved, and if the ratio is too high, the current random IO is proved to be the sequential IO;
5) Counting the average value in one period (period is configurable: 10, 20, 30 minutes);
6) According to the IO merging rate and the read/write duty ratio, a proper scheduling strategy is prejudged:
the judging rule is that the read/write duty ratio and IO merging rate are mainly analyzed according to indexes, the conditions of sequential read-write, random read-write and mixed read-write are judged, and then a proper scheduling strategy is selected according to the type of the storage medium;
7) Judging whether the current scheduling strategy accords with the current scheduling strategy or not;
8) According with the method, monitoring is continued so as to select a proper scheduling strategy when the index changes;
9) If not, switching the scheduling strategy.
The application is characterized in that a disk IO service monitoring module is newly added outside a kernel IO scheduling strategy, a disk to be monitored is designated through self-defining 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 takes effect in real time, namely, the application dynamically and real-time adjusts the scheduling strategy of the disk according to service types, furthest utilizes the IOPS and bandwidth of the disk, improves the resource utilization rate of the storage disk, improves the IO performance and enables the disk to adapt to complex and changeable service scenes, in addition, the disk IO service monitoring module is required to be installed in the kernel, and monitoring service is started, and the service is also operated in the kernel of the system, belongs to the kernel module of an operating system, and can ensure the stability and the operation speed of the system.
In addition, if a new disk medium (new type of disk) supports a better scheduling policy, the disk type, service scene and corresponding scheduling policy of the new disk medium can be added to the disk IO service monitoring module as plug-in, so that the corresponding better scheduling policy can be selected based on the disk type and service scene of the new disk medium to realize scheduling.
The embodiment of the invention also provides a device for dynamically adjusting the disk scheduling policy, as shown in fig. 5, which may include:
the determining module 11 is used for determining a disk needing to realize dynamic adjustment of the scheduling strategy as a disk to be monitored;
the monitoring module 12 is configured to monitor, in real time or at regular time, an IO index item of a disk to be monitored, and obtain index data of an IO index item corresponding to the disk to be monitored in a preset time period before a current time;
and the adjusting module 13 is used for determining the scheduling strategy corresponding to the disc type and index data of the disc to be monitored as a target scheduling strategy and adjusting the current scheduling strategy of the disc to be monitored as the target scheduling strategy.
The embodiment of the invention also provides a device for dynamically adjusting the disk scheduling strategy, which can comprise:
a memory for storing a computer program;
a processor for implementing the steps of the method of dynamically adjusting disk scheduling policy as any one of the above when executing a computer program.
The embodiment of the invention also provides a computer readable storage medium, and 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 the disk scheduling strategy according to any one of the above steps can be realized.
It should be noted that, the description of the device, the equipment and the relevant part in the storage medium for dynamically adjusting the disk scheduling policy provided by the embodiment of the present invention is please refer to the detailed description of the corresponding part in the method for dynamically adjusting the disk scheduling policy provided by the embodiment of the present invention, which is not repeated herein. In addition, the parts of the above technical solutions provided in the embodiments of the present invention, which are consistent with the implementation principles of the corresponding technical solutions in the prior art, are not described in detail, so that redundant descriptions are avoided.
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 (9)

1. A method for dynamically adjusting disk scheduling policies, comprising:
determining a disk needing to realize dynamic adjustment of a scheduling strategy as a disk to be monitored;
Monitoring IO index items of the magnetic disk to be monitored in real time or at fixed time, and acquiring index data of the magnetic disk to be monitored corresponding to the IO index items in a preset time period before the current moment;
Determining a scheduling strategy corresponding to the disc type and index data of the disc to be monitored as a target scheduling strategy, and adjusting the current scheduling strategy of the disc to be monitored as the target scheduling strategy;
The method comprises the steps of determining that a scheduling policy corresponding to a disc type and index data of a disc to be monitored is a target scheduling policy, determining that the NOOP scheduling policy is the target scheduling policy if the index data indicates that IO merging rate is smaller than a lowest merging rate threshold, determining that the NOOP scheduling policy is the target scheduling policy when the disc type is a mechanical disc if the index data indicates that IO merging rate is larger than the highest merging rate threshold, determining that the DEADLINE scheduling policy is the target scheduling policy when the disc type is not the mechanical disc, determining that the priority processing write operation policy is the target scheduling policy if the index data is between the lowest merging rate threshold and the highest merging rate threshold and the read/write ratio is smaller than the lowest duty ratio threshold, determining that the priority processing read operation policy is the target scheduling policy if the index data is between the lowest merging rate threshold and the highest merging rate and the highest duty ratio threshold, and determining that the read/write ratio is between the lowest and the highest duty ratio threshold, and determining that the mechanical disc type is not the mechanical disc is the target scheduling policy when the index data is the mechanical disc type ANTICIPATORY.
2. The method of claim 1, wherein monitoring the IO indicator entries of the disk to be monitored in real time comprises:
if the number of the disks to be monitored is determined to be multiple, the IO index items of the multiple disks to be monitored are monitored in a one-to-one correspondence mode by utilizing multiple sub-threads.
3. The method of claim 2, further comprising, before adjusting the current scheduling policy of the disk to be monitored to the target scheduling policy:
issuing the IO in the IO queue to the disk to be monitored, and suspending IO service;
After the current scheduling policy of the to-be-monitored disk is adjusted to the target scheduling policy, the method further comprises:
and releasing the IO service to finish IO in the disk to be monitored.
4. A method according to claim 3, wherein adjusting the current scheduling policy of the disk to be monitored to the target scheduling policy comprises:
If the current scheduling policy of the to-be-monitored disk is the target scheduling policy, continuing to monitor the IO index item of the to-be-monitored disk, otherwise, replacing the current scheduling policy of the to-be-monitored disk with the target scheduling policy.
5. The method of claim 4, further comprising, prior to monitoring the IO indicator entries of the disk to be monitored in real time or at regular time:
Based on a mark preset by a user, determining an IO index item needing to be monitored in real time or determining an IO index item needing to be monitored in a timing mode.
6. The method of claim 5, wherein adjusting the current scheduling policy of the to-be-monitored disk to the target scheduling policy further comprises:
And outputting the information of the current scheduling strategy of the magnetic disk to be monitored, which is adjusted to the target scheduling strategy, so that the information can be obtained by a user.
7. An apparatus for dynamically adjusting a disk scheduling policy, comprising:
the determining module is used for determining a disk needing to realize dynamic adjustment of the scheduling strategy as a disk to be monitored;
The monitoring module is used for monitoring IO index items of the magnetic disk to be monitored in real time or at fixed time and acquiring index data of the magnetic disk to be monitored corresponding to the IO index items in a preset time period before the current moment;
The adjustment module is used for determining a scheduling strategy corresponding to the disc type and index data of the disc to be monitored as a target scheduling strategy and adjusting the current scheduling strategy of the disc to be monitored as the target scheduling strategy;
The adjustment module is specifically configured to determine that a NOOP scheduling policy is a target scheduling policy if the index data indicates that the IO merge rate is less than a minimum merge rate threshold, determine that the NOOP scheduling policy is a target scheduling policy if the index data indicates that the IO merge rate is greater than a maximum merge rate threshold, determine that the NOOP scheduling policy is a target scheduling policy if the disk type is a mechanical disk, determine that the DEADLINE scheduling policy is a target scheduling policy if the disk type is not a mechanical disk, determine that the priority processing write operation policy is a target scheduling policy if the index data is between a minimum merge rate threshold and a maximum merge rate threshold and the read/write ratio is less than a minimum duty ratio threshold, determine that the priority processing read operation policy is a target scheduling policy if the index data is between a minimum merge rate threshold and a maximum merge rate threshold and the read/write ratio is between a minimum duty ratio threshold and a maximum duty ratio threshold, and determine that the NOOP scheduling policy is a target scheduling policy if the disk type is a mechanical disk and the disk type is not a mechanical disk.
8. An apparatus for dynamically adjusting disk scheduling policies, comprising:
a memory for storing a computer program;
A processor for implementing the steps of the method for dynamically adjusting disk scheduling policies according to any one of claims 1 to 6 when said computer program is executed.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the method of dynamically adjusting disk scheduling policies according to any of claims 1to 6.
CN202110864576.2A 2021-07-29 2021-07-29 A method, device and equipment for dynamically adjusting disk scheduling strategy Active CN113687943B (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN113687943A CN113687943A (en) 2021-11-23
CN113687943B true CN113687943B (en) 2025-04-29

Family

ID=78578235

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN113687943B (en)

Families Citing this family (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
CN116520969B (en) * 2023-07-04 2023-09-08 四川弘仁财电科技有限公司 Device, system and method for controlling power consumption of server

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201347A (en) * 2016-07-04 2016-12-07 联想(北京)有限公司 Information processing method and solid state hard disc

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783028B (en) * 2019-01-16 2022-07-15 Oppo广东移动通信有限公司 Optimization method and device for I/O scheduling, storage medium and intelligent terminal
CN110515539B (en) * 2019-07-22 2022-05-17 平安科技(深圳)有限公司 Cloud disk mounting method, device, equipment and storage medium based on cloud storage
CN112328453B (en) * 2020-11-10 2024-11-12 北京星辰天合科技股份有限公司 Disk status analysis method and device based on software-defined storage, and electronic device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201347A (en) * 2016-07-04 2016-12-07 联想(北京)有限公司 Information processing method and solid state hard disc

Also Published As

Publication number Publication date
CN113687943A (en) 2021-11-23

Similar Documents

Publication Publication Date Title
US9298563B2 (en) Changing a number of disk agents to backup objects to a storage device
US20160253091A1 (en) Methods and systems to reduce ssd io latency
CN101118477A (en) Method for improving disk data access efficiency
CN110930291B (en) GPU video memory management control method and related device
CN113377278B (en) Solid state drive, garbage collection and control method, device, system and storage medium
CN111858055B (en) Task processing method, server and storage medium
US20130219088A1 (en) Configurable prioritization of data transmission in a data storage topology
CN110674064B (en) A data transmission method, apparatus, device and computer-readable storage medium
US20180260162A1 (en) Storage system, storage device, and hard disk drive scheduling method
CN109032503B (en) A flow control method and device for data migration bandwidth of solid state hard disk
US11194619B2 (en) Information processing system and non-transitory computer readable medium storing program for multitenant service
CN113687943A (en) A method, device and device for dynamically adjusting disk scheduling policy
CN112000205A (en) BMC (baseboard management controller) and heat dissipation strategy adaptation method, device, server and storage medium thereof
WO2022213973A1 (en) Scheduling method and apparatus for io request
US7783797B2 (en) Adaptive bandwidth distribution system for high-performance input/output devices with variable throughput
CN116343849B (en) Method, device, storage medium and equipment for improving SSD hybrid read-write performance
CN106445418A (en) Method and device for self-adaptingread-write services in solid state disk
CN113064722A (en) A kind of graphics card resource allocation switching method and system
CN115098039B (en) Flow control method and device for SSD command, storage medium and SSD device
CN113328957B (en) Flow control method and device and electronic equipment
CN115309341A (en) Small file processing method, system, terminal and medium based on hierarchical storage
CN107220166B (en) A kind of statistical method and device of CPU usage
US20140379846A1 (en) Technique for coordinating memory access requests from clients in a mobile device
CN113655958A (en) How to store application data
CN111506425A (en) Method and device for processing quality of service data

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
GR01 Patent grant
GR01 Patent grant