CN112306823A - Disk management method, system, device and computer readable storage medium - Google Patents
Disk management method, system, device and computer readable storage medium Download PDFInfo
- Publication number
- CN112306823A CN112306823A CN201910699315.2A CN201910699315A CN112306823A CN 112306823 A CN112306823 A CN 112306823A CN 201910699315 A CN201910699315 A CN 201910699315A CN 112306823 A CN112306823 A CN 112306823A
- Authority
- CN
- China
- Prior art keywords
- disk
- expansion ratio
- node
- performance
- files
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3409—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
- G06F11/3419—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the application provides a disk management method, which comprises the following steps: detecting the number of files stored in a magnetic disk; and judging the current disk performance of the disk according to the number of the stored files, and executing corresponding operation according to the current disk performance. The embodiment of the application also provides a disk management system, computer equipment and a computer readable storage medium. The technical scheme provided by the embodiment of the application can effectively evaluate the current disk performance of the disk and execute corresponding operation based on the evaluation result.
Description
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a disk performance evaluation method, a disk management method, a system, equipment and a computer readable storage medium.
Background
As internet services evolve, more and more content is stored in remote servers. For example, a user or business may give content to a data center that can provide mass storage services for storage; alternatively, the Content provider distributes the Content to a remote CDN (Content Delivery Network) server, and delivers the Content to the "edge" of the Network closest to the user, so as to increase the speed at which the user acquires the Content.
Whether it is a server as a data center node or a CDN server, it is faced with reading and writing of massive data. How to evaluate the performance of the disk and execute the storage operation becomes one of the technical difficulties to be solved by the parties.
Disclosure of Invention
Embodiments of the present application provide a disk performance evaluation method, a disk management method, a system, a computer device, and a computer-readable storage medium, which are used to solve the technical problem of how to evaluate disk performance and execute storage operations.
One aspect of the embodiments of the present application provides a disk performance evaluation method, where the method includes: writing a predetermined number of files to a disk; monitoring the change of the consumption time of the predetermined number of files in the writing process; and according to the change of the consumption time, evaluating the influence of the written file quantity on the disk performance.
Optionally, the monitoring the time variation of the consumed time in the process of writing the plurality of files includes: monitoring the consumption time corresponding to each node in the writing process of the files with the preset number; and the consumption time corresponding to each node is equal to the consumption time corresponding to the Mth file from the beginning of writing the first file to the completion of writing the Mth file, each node corresponds to different values of M, and M is a natural number.
Optionally, the evaluating the influence of the number of written files on the performance of the disk includes: acquiring the expansion ratio of the disk corresponding to each node according to the consumption time corresponding to each node and the value of M corresponding to each node; and the expansion ratio corresponding to each node is used for representing the attenuation degree of the disk performance of the disk corresponding to different written file numbers.
Optionally, the evaluating the influence of the number of written files on the performance of the disk further includes: and defining an expansion ratio curve according to the expansion ratio corresponding to each node, wherein the expansion ratio curve represents the mapping relation between each written file quantity and each expansion ratio.
Optionally, obtaining an expansion ratio of the disk corresponding to each node according to the consumption time corresponding to each node and the value of M corresponding to each node includes: calculating the ratio of the consumption time ratio of the ith node to the value of M corresponding to the ith node, and determining that the ratio is the expansion ratio of the ith node; and the consumption time ratio of the ith node is equal to the consumption time corresponding to the ith node divided by the consumption time corresponding to the first node, and the value of M corresponding to the first node is 1.
Optionally, the method further includes: and adjusting the storage strategy of the disk according to the expansion ratio corresponding to each node.
Optionally, adjusting the storage policy of the disk according to the expansion ratio corresponding to each node includes: and adjusting a file quantity threshold according to the expansion ratio corresponding to each node, wherein the file quantity threshold is used for limiting the write-in operation of the disk.
Optionally, adjusting the storage policy of the disk according to the expansion ratio corresponding to each node includes: and switching the current file system of the disk from the first file system to the second file system according to the expansion ratio corresponding to each node.
Optionally, adjusting the storage policy of the disk according to the expansion ratio corresponding to each node includes: and switching the current storage algorithm of the disk from a first storage algorithm to a second storage algorithm according to the expansion ratio corresponding to each node.
Optionally, adjusting the storage policy of the disk according to the expansion ratio corresponding to each node includes: and configuring a virtual file system for the disk according to the expansion ratio corresponding to each node.
An aspect of an embodiment of the present application further provides a disk performance evaluation system, including: the write-in module is used for writing a preset number of files into a magnetic disk; the monitoring module is used for monitoring the change of the consumed time of the preset number of files in the writing process; and the evaluation module is used for evaluating the influence of the written file quantity on the disk performance according to the change of the consumption time.
One aspect of the embodiments of the present application further provides a disk management method, where the disk management method includes: detecting the number of files stored in a magnetic disk; and judging the current disk performance of the disk according to the number of the stored files, and executing corresponding operation according to the current disk performance.
Optionally, the determining the current disk performance of the disk according to the number of the stored files includes: obtaining a target expansion ratio of a plurality of expansion ratios according to the number of the stored files, wherein the target expansion ratio is used for representing the current disk performance; wherein the expansion ratios are obtained in advance and used for evaluating the attenuation degree of the disk performance of the disk corresponding to different stored file numbers.
Optionally, the determining the current disk performance of the disk according to the number of the stored files includes: acquiring a target expansion ratio according to the stored file quantity and an expansion ratio curve, wherein the target expansion ratio is used for representing the current disk performance; wherein the expansion ratio curve is obtained in advance and used for evaluating the attenuation degree of the disk performance of the disk corresponding to different stored file numbers.
Optionally, executing corresponding operations according to the current disk performance includes: comparing the target expansion ratio with a first preset threshold; and limiting the write operation of the magnetic disk if the target expansion ratio is larger than the first preset threshold.
Optionally, executing corresponding operations according to the current disk performance includes: comparing the target expansion ratio with a second preset threshold; and if the target expansion ratio is larger than the second preset threshold value, deleting the aging file or informing the writing device to change the storage path.
Optionally, the determining the current disk performance of the disk according to the number of the stored files includes: acquiring the current variation trend of the disk performance according to the stored file number and the expansion ratio curve; wherein the expansion ratio curve is obtained in advance and used to evaluate a decay tendency of the disk performance of the magnetic disk.
Optionally, executing corresponding operations according to the current disk performance includes: and determining whether to limit the writing operation of the disk, delete an aging file or inform a writing device to change a storage path according to the current change trend.
Optionally, the method further includes: pre-acquiring the plurality of expansion ratios and expansion ratio curves, including: writing N test files into a disk, and recording consumption time corresponding to each node in the process of writing the N test files into the disk, wherein the consumption time corresponding to each node is equal to the consumption time corresponding to the Mth test file from the beginning of writing the first test file to the completion of writing the Mth test file, and each node has different M values; calculating expansion ratios corresponding to the nodes of the disk according to the consumption time corresponding to the nodes and the value of M corresponding to the nodes; and defining an expansion ratio curve according to the expansion ratio corresponding to each node.
Optionally, calculating an expansion ratio corresponding to each node of the disk includes: calculating the ratio of the consumption time ratio of the ith node to the value of M corresponding to the ith node, and determining that the ratio is the expansion ratio of the ith node; and the consumption time ratio of the ith node is equal to the consumption time corresponding to the ith node divided by the consumption time corresponding to the first node, and the value of M corresponding to the first node is 1.
An aspect of an embodiment of the present application further provides a disk management system, including: the detection module is used for detecting the number of files stored in the disk; and the adjusting module is used for judging the current disk performance of the disk according to the number of the stored files and executing corresponding operation according to the current disk performance.
An aspect of the embodiments of the present application further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the disk performance evaluation method or the disk management method.
An aspect of the embodiments of the present application further provides a computer-readable storage medium, in which a computer program is stored, where the computer program is executable by at least one processor, so as to cause the at least one processor to execute the steps of the disk performance evaluation method or the disk management method.
According to the disk management method, the system, the equipment and the computer readable storage medium provided by the embodiment of the application, the current disk performance of the disk is judged according to the number of the stored files, the current disk performance of the disk can be effectively evaluated, and therefore corresponding operation is executed based on the evaluation result.
Drawings
FIG. 1 is a flow chart of a disk performance evaluation method according to a first embodiment of the present application;
FIG. 2 is a flow chart of a disk performance evaluation method according to the second embodiment of the present application;
FIG. 3 is a flowchart schematically illustrating a disk performance evaluation method according to the second embodiment of the present application;
FIG. 4 is a flow chart schematically illustrating a disk management method according to a third embodiment of the present application;
FIG. 5 is a flowchart schematically illustrating a disk management method according to a third embodiment of the present application;
FIG. 6 is a flowchart schematically illustrating a disk management method according to a third embodiment of the present application;
fig. 7 is a flowchart schematically illustrating additional steps of a disk management method according to a third embodiment of the present application;
FIG. 8 is a block diagram schematically illustrating a disk performance evaluation system according to a fourth embodiment of the present application;
FIG. 9 is a block diagram that schematically illustrates a disk management system, in accordance with a fifth embodiment of the present application; and
fig. 10 schematically shows a hardware architecture diagram of a computer device suitable for implementing a disk management method or a disk performance evaluation method according to a sixth embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more clearly understood, the embodiments of the present application are described in further detail below with reference to the accompanying drawings and the embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of the application and are not intended to limit the embodiments of the application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the embodiments in the present application.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
To some extent, the disk performance depends on the remaining capacity of the disk, the disk medium, etc., and the SSD (solid state drive), the solid state drive and the HHD (hard disk drive) exhibit different disk performances.
However, the present inventors have also studied that the disk performance also depends on the number of files. An increase in the number of files stored in a disk can cause performance findings at the bottom of the disk to change. The technical scheme is that the disk performance of the disk is evaluated through the tolerance of the disk in the increase of the number of files.
The following describes an exemplary disk performance evaluation method according to the present embodiment, with the computer device 2 as an execution subject. The computer device 2 may be a server, such as a CDN node or other storage node.
Example one
Fig. 1 schematically shows a flowchart of a disk performance evaluation method according to a first embodiment of the present application. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed.
As shown in fig. 1, the disk performance evaluation method may include steps S100 to S104, where:
step S100, writing a predetermined number of files to a disk.
Step S102, monitoring the change of the consumption time of the files with the preset number in the writing process.
And step S104, evaluating the influence of the written file quantity on the disk performance according to the change of the consumption time.
In an exemplary embodiment, the predetermined number of files may be determined according to the capacity of the disk and the file size. For example, 20 hundred million files of substantially the same size may be written to disk; monitoring the consumption time of 1 file, 10 files, 100 files, 1000 files, 1 ten thousand files, 5 ten thousand files, 20 ten thousand files, … and 20 hundred million files written in the magnetic disk, which correspond to each other; the influence on the writing speed, i.e. the influence on the disk performance, at different file numbers is evaluated based on the time variation of these consumption times, e.g. based on the ratio between the respective consumption times and the corresponding file number.
It will be appreciated that, since the number of files written causes variations in the performance of the disk, the ratio between these consumption times and the corresponding number of files is not proportional, for example, 1 million of files are written for a consumption time of 1 ten thousand seconds, and 20 million of files are written for a consumption time of not 20 ten thousand seconds, but perhaps 40 ten thousand seconds. Therefore, as the number of written files increases, the subsequent writing speed of the disk gradually decreases.
Based on the first embodiment of the application:
the disk performance of the disk can be evaluated according to the number of the written files, so that the disk storage performance of a computer device such as a CDN node under the conditions of intensive requests or high load is known.
Example two
FIG. 2 is a flowchart schematically illustrating a disk performance evaluation method according to a second embodiment of the present application. As shown in fig. 2, the disk performance evaluation method may include steps S200 to S208, where:
step S200, writing a predetermined number of files into the disk.
In an exemplary embodiment, N hundred million files of substantially the same size may be written to disk.
Step S202, monitoring the consumption time corresponding to each node in the writing process of the files with the preset number. And the consumption time corresponding to each node is equal to the consumption time corresponding to the Mth file from the beginning of writing the first file to the completion of writing the Mth file, and each node corresponds to different M values.
It is understood that the embodiment of the present application is to sample the number of files and monitor the time consumed by writing the plurality of files corresponding to each sampling number into the disk. For example, the first node corresponds to the consumption time of 1(M takes 1) file written by the disk, the second node corresponds to the consumption time of 100(M takes 100) files written by the disk, …, and the S-th node corresponds to the consumption time of 20 hundred million (M takes 20 hundred million) files written by the disk.
And step S204, acquiring the expansion ratio of the disk corresponding to each node according to the consumption time corresponding to each node and the value of M corresponding to each node.
And the expansion ratio corresponding to each node is used for representing the attenuation degree of the disk performance of the disk corresponding to different written file numbers.
In an exemplary embodiment, taking the ith node (i is a natural number) as an example, the step S204 may include the step S204A: and calculating the ratio of the consumption time ratio of the ith node to the value of M corresponding to the ith node, and determining that the ratio is the expansion ratio of the ith node. And the consumption time ratio of the ith node is equal to the consumption time corresponding to the ith node divided by the consumption time corresponding to the first node, and the value of M corresponding to the first node is 1.
As described by the following equation: PZDi=(costi/cost1)/(counti/count1);
Wherein PZDiFor the expansion ratio corresponding to the ith node, costiCost for the elapsed time corresponding to the ith node1Count the elapsed time corresponding to the first nodeiValue, count, for M corresponding to the ith node1Is 1.
And step S206, defining an expansion ratio curve according to the expansion ratio corresponding to each node.
The expansion ratio curve represents a mapping relationship between the number of each written file and each expansion ratio, and also represents a storage tendency (e.g., a decay tendency of storage performance) of the disk.
In an exemplary embodiment, as shown in fig. 3, the disk performance evaluation method further includes step S208: and adjusting the storage strategy of the disk according to the expansion ratio corresponding to each node, or adjusting the storage of the disk according to the expansion ratio curve. Illustratively, the storage policy may be adjusted in several ways:
strategy one: and adjusting the file quantity threshold according to the expansion ratio corresponding to each node.
The file quantity threshold is used for limiting the write operation of the disk. It will be appreciated that when the number of files in the disk exceeds the threshold number of files, new files are not allowed to be written until the number of files in the stored files has not been reduced to ensure that the disk performance of the disk is maintained at a predetermined level. This ensures the reading speed of the stored files in the disk.
And (2) strategy two: and switching the current file system of the disk from the first file system to the second file system according to the expansion ratio corresponding to each node.
The current file system may be or may be switched to the following file system: EXT4 (fourth generation extended file system, 4), NTFS (new technology file system), GFS (*** file system), and the like.
Strategy three: and switching the current storage algorithm of the disk from a first storage algorithm to a second storage algorithm according to the expansion ratio corresponding to each node.
The current storage algorithm may be or may be switched to the following storage algorithm: hash algorithm, file sequential ordering method, etc.
And (4) strategy four: and configuring a virtual file system for the disk according to the expansion ratio corresponding to each node.
The Virtual File System (VFS) is a Virtual File System configured based on the current File System of the disk, such as "/proc File System", "sys File System", and the like.
The above several exemplary storage policy adjustment manners may optimize the disk performance of the disk to a certain extent, such as the tolerance of the disk to the increase of the number of files.
It can be understood that, after the storage policy is adjusted in the above manner, to ensure that the disk performance of the disk after the storage policy is adjusted is improved, the disk performance evaluation operation may be performed on the disk after the storage policy is adjusted again.
EXAMPLE III
Fig. 4 schematically shows a flowchart of a disk management method according to a third embodiment of the present application. As shown in fig. 4, the disk management method may include steps S400 to S402, where:
step S400, detecting the number of files stored in the disk.
Step S402, judging the current disk performance of the disk according to the number of the stored files, and executing corresponding operation according to the current disk performance.
The current disk performance may be a current disk performance or a current disk performance trend:
as shown in fig. 5, the step S402 may include the step S402A: and acquiring a target expansion ratio in a plurality of expansion ratios according to the number of the stored files, wherein the target expansion ratio is used for representing the current disk performance. Wherein the expansion ratios are obtained in advance and used for evaluating the attenuation degree of the disk performance of the disk corresponding to different stored file numbers.
As shown in fig. 5, the step S402 may include the step S402B: and acquiring a target expansion ratio according to the stored file number and the expansion ratio curve, wherein the target expansion ratio is used for representing the current disk performance. Wherein the expansion ratio curve is obtained in advance and used for evaluating the attenuation degree of the disk performance of the disk corresponding to different stored file numbers.
As shown in fig. 5, the step S402 may include the step S402C: and acquiring the current variation trend of the disk performance according to the stored file number and the expansion ratio curve. Wherein the expansion ratio curve is obtained in advance and used to evaluate a decay tendency of the disk performance of the magnetic disk.
In an exemplary embodiment, as shown in fig. 6, corresponding operations are performed according to the current disk performance, for example, the following operation policies:
the first operation strategy is as follows: comparing the target expansion ratio with a first preset threshold; and limiting the writing operation of the magnetic disk if the target expansion ratio is larger than the first preset threshold value.
And operation strategy two: comparing the target expansion ratio with a second preset threshold; and if the target expansion ratio is larger than the second preset threshold value, deleting the aging file. For example, the time exceeds a preset time period, or the storage time is long and the long time is the read file.
And operation strategy three: comparing the target expansion ratio with a second preset threshold; if the target expansion ratio is greater than the second preset threshold, notifying the writing device to change the storage path. If the computer device is a CDN node, the warning information may be sent to the content providing device to notify the content providing device to change the cache path and store the cache path in another node.
And (4) operating strategy four: and determining whether to limit the writing operation of the disk, delete an aging file or inform a writing device to change a storage path according to the current change trend of the disk performance.
For example, the expansion ratio curve has the X-axis representing the number of documents and the Y-axis representing the expansion ratio values. Finding a point on the expansion ratio curve according to the number of the stored files, calculating the derivative of the point in the expansion ratio curve direction, and evaluating the current change trend according to the derivative size. If the decay trend is too great, it is shown that continuing to write the file can cause a severe degradation in disk performance. Thus, a threshold value may be set against which the derivative is compared to determine whether to perform the corresponding operation.
Wherein the plurality of expansion ratios and expansion ratio curves are pre-derived. A plurality of expansion ratios are used to evaluate the degree of decay in disk performance of the disk for different numbers of stored files. The expansion ratio curve represents a mapping relationship between each written file number and each expansion ratio (i.e., a degree of attenuation of the disk performance of the disk corresponding to different stored file numbers), and also represents a storage trend of the disk (e.g., a trend of attenuation of the storage performance). As shown in fig. 7, the plurality of expansion ratios may be obtained by: step S700, writing N test files into a disk, and recording consumption time corresponding to each node in the process of writing the N test files into the disk, wherein the consumption time corresponding to each node is equal to the consumption time corresponding to the Mth test file from the beginning of writing the first test file to the completion of writing the Mth test file, and each node has different M values. Step S702, calculating an expansion ratio corresponding to each node of the disk according to the consumption time corresponding to each node and the value of M corresponding to each node. For example, a ratio between the consumption time ratio of the ith node and the value of M corresponding to the ith node is calculated, and the ratio is determined to be the expansion ratio of the ith node. And the consumption time ratio of the ith node is equal to the consumption time corresponding to the ith node divided by the consumption time corresponding to the first node, and the value of M corresponding to the first node is 1. Step S704, an expansion ratio curve is defined according to the expansion ratio corresponding to each node.
M, N is a natural number, M is less than or equal to N.
The expansion ratio curve may be a two-dimensional smooth curve with the number of documents as an X-axis and the numerical value of the expansion ratio as a Y-axis, and the corresponding target expansion ratio may be located according to the number of documents.
Example four
Fig. 8 is a block diagram schematically illustrating a disk performance evaluation system according to a fourth embodiment of the present application, where the disk management system may be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to implement the embodiments of the present application. The program module referred to in the embodiments of the present application refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable for describing the execution process of the disk performance evaluation system in the storage medium than the program itself.
As shown in fig. 8, the disk management system 800 may include a write module 810, a monitor module 820, an evaluation module 830, and an adjustment module 840, wherein:
a writing module 810, configured to write a predetermined number of files to a disk.
A monitoring module 820 for monitoring the change of the consumption time of the predetermined number of files in the writing process.
An evaluation module 830, configured to evaluate, according to the change in the consumption time, an influence of the number of written files on the performance of the disk.
In the exemplary embodiment, monitoring module 820 is further configured to: monitoring the consumption time corresponding to each node in the writing process of the files with the preset number; and the consumption time corresponding to each node is equal to the consumption time corresponding to the Mth file from the beginning of writing the first file to the completion of writing the Mth file, and each node corresponds to different M values.
In the exemplary embodiment, evaluation module 830 is further configured to: acquiring the expansion ratio of the disk corresponding to each node according to the consumption time corresponding to each node and the value of M corresponding to each node; and the expansion ratio corresponding to each node is used for representing the attenuation degree of the disk performance of the disk corresponding to different written file numbers.
In the exemplary embodiment, evaluation module 830 is further configured to: and defining an expansion ratio curve according to the expansion ratio corresponding to each node, wherein the expansion ratio curve represents the mapping relation between each written file quantity and each expansion ratio.
In the exemplary embodiment, evaluation module 830 is further configured to: calculating the ratio of the consumption time ratio of the ith node to the value of M corresponding to the ith node, and determining that the ratio is the expansion ratio of the ith node; and the consumption time ratio of the ith node is equal to the consumption time corresponding to the ith node divided by the consumption time corresponding to the first node, and the value of M corresponding to the first node is 1.
An adjustment module 840 to: and adjusting the storage strategy of the disk according to the expansion ratio corresponding to each node.
In an exemplary embodiment, the adjusting module 840 is further configured to: and adjusting a file quantity threshold according to the expansion ratio corresponding to each node, wherein the file quantity threshold is used for limiting the write-in operation of the disk.
In an exemplary embodiment, the adjusting module 840 is further configured to: and switching the current file system of the disk from the first file system to the second file system according to the expansion ratio corresponding to each node.
In an exemplary embodiment, the adjusting module 840 is further configured to: and switching the current storage algorithm of the disk from a first storage algorithm to a second storage algorithm according to the expansion ratio corresponding to each node.
In an exemplary embodiment, the adjusting module 840 is further configured to: and configuring a virtual file system for the disk according to the expansion ratio corresponding to each node.
EXAMPLE five
Fig. 9 schematically illustrates a block diagram of a disk management system according to a fifth embodiment of the present application, which may be partitioned into one or more program modules, stored in a storage medium, and executed by one or more processors to implement the embodiments of the present application. The program module referred to in the embodiments of the present application refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable for describing the execution process of the disk management system in the storage medium than the program itself.
As shown in fig. 9, the disk management system 900 may include a detection module 910, a tuning module 920, and an evaluation module 930, wherein:
the detecting module 910 is configured to detect the number of files stored in the disk.
An adjusting module 920, configured to determine the current disk performance of the disk according to the number of the stored files, and execute a corresponding operation according to the current disk performance.
In an exemplary embodiment, the adjusting module 920 is further configured to: obtaining a target expansion ratio of a plurality of expansion ratios according to the number of the stored files, wherein the target expansion ratio is used for representing the current disk performance; wherein the expansion ratios are obtained in advance and used for evaluating the attenuation degree of the disk performance of the disk corresponding to different stored file numbers.
In an exemplary embodiment, the adjusting module 920 is further configured to: acquiring a target expansion ratio according to the stored file quantity and an expansion ratio curve, wherein the target expansion ratio is used for representing the current disk performance; wherein the expansion ratio curve is obtained in advance and used for evaluating the attenuation degree of the disk performance of the disk corresponding to different stored file numbers.
In an exemplary embodiment, the adjusting module 920 is further configured to: comparing the target expansion ratio with a first preset threshold; and limiting the write operation of the magnetic disk if the target expansion ratio is larger than the first preset threshold.
In an exemplary embodiment, the adjusting module 920 is further configured to: comparing the target expansion ratio with a second preset threshold; and if the target expansion ratio is larger than the second preset threshold value, deleting the aging file or informing the writing device to change the storage path.
In an exemplary embodiment, the adjusting module 920 is further configured to: acquiring the current variation trend of the disk performance according to the stored file number and the expansion ratio curve; wherein the expansion ratio curve is obtained in advance and used to evaluate a decay tendency of the disk performance of the magnetic disk.
In an exemplary embodiment, the adjusting module 920 is further configured to: and determining whether to limit the writing operation of the disk, delete an aging file or inform a writing device to change a storage path according to the current change trend.
An evaluation module 930 further configured to: pre-acquiring the plurality of expansion ratios and expansion ratio curves, including: writing N test files into a disk, and recording consumption time corresponding to each node in the process of writing the N test files into the disk, wherein the consumption time corresponding to each node is equal to the consumption time corresponding to the Mth test file from the beginning of writing the first test file to the completion of writing the Mth test file, and each node has different M values; calculating expansion ratios corresponding to the nodes of the disk according to the consumption time corresponding to the nodes and the value of M corresponding to the nodes; and defining an expansion ratio curve according to the expansion ratio corresponding to each node.
In the exemplary embodiment, evaluation module 930 is further configured to: calculating expansion ratios corresponding to the nodes of the disk, wherein the expansion ratios comprise: calculating the ratio of the consumption time ratio of the ith node to the value of M corresponding to the ith node, and determining that the ratio is the expansion ratio of the ith node; and the consumption time ratio of the ith node is equal to the consumption time corresponding to the ith node divided by the consumption time corresponding to the first node, and the value of M corresponding to the first node is 1.
EXAMPLE six
Fig. 10 schematically shows a hardware architecture diagram of a computer device suitable for implementing a disk performance evaluation method and/or a disk management method according to a sixth embodiment of the present application. In the present embodiment, the computer device 2 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a command set in advance or stored. For example, the server may be a rack server, a blade server, a tower server, or a rack server (including an independent server or a server cluster composed of a plurality of servers). As shown in fig. 10, the computer device 2 includes at least, but is not limited to: the memory 1010, processor 1020, and network interface 1030 may be communicatively linked to each other via a system bus. Wherein:
the memory 1010 includes at least one type of computer-readable storage medium including flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), Static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 1010 may be an internal storage module of the computer device 2, such as a hard disk or a memory of the computer device 2. In other embodiments, the memory 1010 may be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the computer device 2. Of course, the memory 1010 may also include both internal and external memory modules of the computer device 2. In this embodiment, the memory 1010 is generally used for storing an operating system installed in the computer device 2 and various types of application software, such as program codes of a disk evaluation method or a disk management method. In addition, the memory 1010 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 1020 may be, in some embodiments, a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other data Processing chip. The processor 1020 is generally configured to control the overall operation of the computer device 2, such as performing control and processing related to data interaction or communication with the computer device 2. In this embodiment, the processor 1020 is configured to execute program codes stored in the memory 1010 or process data.
Network interface 1030 may include a wireless network interface or a wired network interface, with network interface 1030 typically being used to establish communication links between computer device 2 and other computer devices. For example, the network interface 1030 is used to connect the computer device 2 with an external terminal through a network, establish a data transmission channel and a communication link between the computer device 2 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), or Wi-Fi.
It should be noted that FIG. 10 only shows a computer device having components 1010 and 1030, but it should be understood that not all of the shown components are required and that more or fewer components may be implemented instead.
In this embodiment, the disk performance evaluation method or the disk management method stored in the memory 1010 may be further divided into one or more program modules and executed by one or more processors (in this embodiment, the processor 1020) to implement the present invention.
EXAMPLE seven
The present embodiment also provides a computer-readable storage medium on which a computer program is stored, the computer program, when executed by a processor, implementing the steps of the disk performance evaluation method or the disk management method in the embodiments.
In this embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device. Of course, the computer-readable storage medium may also include both internal and external storage devices of the computer device. In this embodiment, the computer-readable storage medium is generally used for storing an operating system and various types of application software installed in the computer device, for example, the program code of the disk management method or the disk management method in the embodiment, and the like. Further, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the present invention described above may be implemented by a general purpose computing device, may be integrated into a single computing device or distributed across a network of multiple computing devices, and may alternatively be implemented by program code executable by a computing device, such that the steps shown or described may be executed by a computing device stored in a storage device and, in some cases, may be executed out of order from that shown or described, or separately fabricated into individual circuit modules, or fabricated into a single circuit module from multiple modules or steps of the same. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (12)
1. A disk management method is characterized in that the disk management method comprises the following steps:
detecting the number of files stored in a magnetic disk; and
and judging the current disk performance of the disk according to the number of the stored files, and executing corresponding operation according to the current disk performance.
2. The method of claim 1, wherein determining the current disk performance of the disk according to the number of stored files comprises:
obtaining a target expansion ratio of a plurality of expansion ratios according to the number of the stored files, wherein the target expansion ratio is used for representing the current disk performance;
wherein the expansion ratios are obtained in advance and used for evaluating the attenuation degree of the disk performance of the disk corresponding to different stored file numbers.
3. The method of claim 1, wherein determining the current disk performance of the disk according to the number of stored files comprises:
acquiring a target expansion ratio according to the stored file quantity and an expansion ratio curve, wherein the target expansion ratio is used for representing the current disk performance;
wherein the expansion ratio curve is obtained in advance and used for evaluating the attenuation degree of the disk performance of the disk corresponding to different stored file numbers.
4. The disk management method according to claim 2 or 3, wherein the performing corresponding operations according to the current disk performance includes:
comparing the target expansion ratio with a first preset threshold; and
and limiting the writing operation of the magnetic disk if the target expansion ratio is larger than the first preset threshold value.
5. The disk management method according to claim 2 or 3, wherein the performing corresponding operations according to the current disk performance includes:
comparing the target expansion ratio with a second preset threshold; and
and if the target expansion ratio is larger than the second preset threshold value, deleting the aging file or informing the writing device to change the storage path.
6. The method of claim 1, wherein determining the current disk performance of the disk according to the number of stored files comprises:
acquiring the current variation trend of the disk performance according to the stored file number and the expansion ratio curve;
wherein the expansion ratio curve is obtained in advance and used to evaluate a decay tendency of the disk performance of the magnetic disk.
7. The method according to claim 6, wherein performing corresponding operations according to the current disk performance includes:
and determining whether to limit the writing operation of the disk, delete an aging file or inform a writing device to change a storage path according to the current change trend.
8. The disk management method according to claim 2, 3 or 6, further comprising:
pre-acquiring the plurality of expansion ratios and expansion ratio curves, including:
writing N test files into a disk, and recording consumption time corresponding to each node in the process of writing the N test files into the disk, wherein the consumption time corresponding to each node is equal to the consumption time corresponding to the Mth test file from the beginning of writing the first test file to the completion of writing the Mth test file, and each node has different M values;
calculating expansion ratios corresponding to the nodes of the disk according to the consumption time corresponding to the nodes and the value of M corresponding to the nodes; and
and defining an expansion ratio curve according to the expansion ratio corresponding to each node.
9. The method according to claim 8, wherein calculating the expansion ratio corresponding to each node of the disk comprises:
calculating the ratio of the consumption time ratio of the ith node to the value of M corresponding to the ith node, and determining that the ratio is the expansion ratio of the ith node;
and the consumption time ratio of the ith node is equal to the consumption time corresponding to the ith node divided by the consumption time corresponding to the first node, and the value of M corresponding to the first node is 1.
10. A disk management system, comprising:
the detection module is used for detecting the number of files stored in the disk; and
and the adjusting module is used for judging the current disk performance of the disk according to the number of the stored files and executing corresponding operation according to the current disk performance.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor is adapted to implement the steps of the disk management method according to any of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium having stored thereon a computer program executable by at least one processor to cause the at least one processor to perform the steps of the disk management method according to any of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910699315.2A CN112306823B (en) | 2019-07-31 | 2019-07-31 | Disk management method, system, device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910699315.2A CN112306823B (en) | 2019-07-31 | 2019-07-31 | Disk management method, system, device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112306823A true CN112306823A (en) | 2021-02-02 |
CN112306823B CN112306823B (en) | 2022-05-10 |
Family
ID=74486033
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910699315.2A Active CN112306823B (en) | 2019-07-31 | 2019-07-31 | Disk management method, system, device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112306823B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120297216A1 (en) * | 2011-05-19 | 2012-11-22 | International Business Machines Corporation | Dynamically selecting active polling or timed waits |
CN104794064A (en) * | 2015-04-21 | 2015-07-22 | 华中科技大学 | Cache management method based on region heat degree |
CN108549556A (en) * | 2018-04-16 | 2018-09-18 | 腾讯科技(深圳)有限公司 | A kind of application program accelerated method, device, terminal and storage medium |
CN108668313A (en) * | 2018-03-29 | 2018-10-16 | 广东欧珀移动通信有限公司 | Information processing method, device, mobile terminal and computer readable storage medium |
CN109213453A (en) * | 2018-09-25 | 2019-01-15 | 郑州云海信息技术有限公司 | A kind of disk management method and relevant apparatus |
CN109542701A (en) * | 2018-11-19 | 2019-03-29 | 郑州云海信息技术有限公司 | A kind of disk performance test method and device |
CN109819352A (en) * | 2019-01-28 | 2019-05-28 | 中国联合网络通信集团有限公司 | A kind of fiber data processing system framework and processing method |
-
2019
- 2019-07-31 CN CN201910699315.2A patent/CN112306823B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120297216A1 (en) * | 2011-05-19 | 2012-11-22 | International Business Machines Corporation | Dynamically selecting active polling or timed waits |
CN104794064A (en) * | 2015-04-21 | 2015-07-22 | 华中科技大学 | Cache management method based on region heat degree |
CN108668313A (en) * | 2018-03-29 | 2018-10-16 | 广东欧珀移动通信有限公司 | Information processing method, device, mobile terminal and computer readable storage medium |
CN108549556A (en) * | 2018-04-16 | 2018-09-18 | 腾讯科技(深圳)有限公司 | A kind of application program accelerated method, device, terminal and storage medium |
CN109213453A (en) * | 2018-09-25 | 2019-01-15 | 郑州云海信息技术有限公司 | A kind of disk management method and relevant apparatus |
CN109542701A (en) * | 2018-11-19 | 2019-03-29 | 郑州云海信息技术有限公司 | A kind of disk performance test method and device |
CN109819352A (en) * | 2019-01-28 | 2019-05-28 | 中国联合网络通信集团有限公司 | A kind of fiber data processing system framework and processing method |
Non-Patent Citations (1)
Title |
---|
刘东海: "《应用程序对磁盘性能的需求分析》", 《科技资讯》 * |
Also Published As
Publication number | Publication date |
---|---|
CN112306823B (en) | 2022-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109857592A (en) | Data recovery control method, server and storage medium | |
CN111324303B (en) | SSD garbage recycling method, SSD garbage recycling device, computer equipment and storage medium | |
CN112367384B (en) | Kafka cluster-based dynamic speed limiting method and device and computer equipment | |
CN111400308A (en) | Processing method of cache data, electronic device and readable storage medium | |
CN109597798B (en) | Network file deleting method and device, computer equipment and storage medium | |
CN112235422B (en) | Data processing method and device, computer readable storage medium and electronic device | |
CN108132759B (en) | Method and device for managing data in file system | |
CN112100143B (en) | File compression storage method, device, equipment and storage medium | |
CN112306823B (en) | Disk management method, system, device and computer readable storage medium | |
CN112306824B (en) | Disk performance evaluation method, system, device and computer readable storage medium | |
CN115442262B (en) | Resource evaluation method and device, electronic equipment and storage medium | |
CN116578410A (en) | Resource management method, device, computer equipment and storage medium | |
CN111552438A (en) | Object writing method, device, server and storage medium | |
CN115934354A (en) | Online storage method and device | |
CN109213422B (en) | Hierarchical storage method, hierarchical storage device, and computer-readable storage medium | |
CN115033551A (en) | Database migration method and device, electronic equipment and storage medium | |
CN111966845B (en) | Picture management method, device, storage node and storage medium | |
CN111949604A (en) | File storage method and device, electronic equipment and readable storage medium | |
CN114003576B (en) | Method and device for calculating file traversal progress, computer equipment and storage medium | |
CN113411395B (en) | Access request routing method, device, computer equipment and storage medium | |
CN118132520B (en) | Storage system file processing method, electronic device, storage medium and program product | |
CN109409040B (en) | Method and device for judging time reliability of operating system | |
CN112001805B (en) | Medical insurance data processing method, device, equipment and medium based on fixed time window | |
CN112948370B (en) | Data classification method and device and computer equipment | |
CN114281248B (en) | Method for improving read-write performance of RAM, electronic equipment and medium |
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 |