A slow disk detection method, device, and computer-readable and writable storage medium
By using two preset intervals to detect sliding windows in distributed storage clusters, the I/O timeout probability is calculated, and the problem of high error judgment rate of slow disk detection in the prior art is solved, accurate detection and processing under different business pressures is achieved, and the stability and performance of the system are improved.
Patent Information
- Application Number
- CN202111143369.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-09-28
AI Technical Summary
When detecting slow disks, the prior art cannot effectively distinguish different business pressure scenarios, resulting in a high misjudgment rate and affecting the stability and performance of distributed storage clusters.
Two preset intervals are used as sliding windows to calculate the service duration, I/O times and I/O timeout times of the hard disk respectively. The I/O timeout probability of the first and second preset intervals is determined whether the hard disk is a slow disk, and specific detection and processing methods are provided to adapt to different business pressure scenarios.
It reduces the misjudgment rate of slow disk detection, improves the accuracy of detection and the reliability of distributed storage clusters, and ensures that slow disks can be effectively screened under different business pressures.
Smart Images

Figure CN113903389B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data storage, and in particular to a slow disk detection method and device, and a computer-readable and writable storage medium. Background Art
[0002] In a distributed storage cluster system, massive amounts of business data are stored on hard drives. The quality of these hard drives directly impacts the stability of the distributed storage cluster. In application scenarios, hard drive abnormalities are primarily categorized into two types: "bad drives" and "slow drives." A "bad drive" primarily manifests as a complete inability to read or write data normally, with obvious and easily detectable characteristics. A "slow drive" primarily manifests as bad sectors, lags, and jitter. During I / O (Input / Output) interactions, the presence of a slow drive can cause occasional I / O timeouts. This subtle characteristic does not pose a significant impact, but it can gradually degrade the business performance of the distributed storage cluster. Therefore, a slow drive detection solution is necessary to prepare for and mitigate distributed storage cluster system failures and ensure system reliability.
[0003] Existing technologies lack specific detection and processing methods for scenarios with high and low business pressure, which increases the false positive rate for slow disk detection. For example, one method detects slow disks based on the number of I / O request timeouts and average service time. However, high business pressure and busy disks during a preset period can lead to I / O timeouts, resulting in false positives for the target disk. Therefore, overcoming the technical limitations of existing technologies is an urgent problem to be solved. Summary of the Invention
[0004] The present disclosure provides a slow disk detection method, device, and computer-readable and writable storage medium, which screen out slow disks from two time dimensions, and provide specific detection and processing methods for scenarios with greater and lesser business pressure, thereby reducing the misjudgment rate of slow disk detection and improving the accuracy of slow disk detection.
[0005] According to a first aspect of an embodiment of the present disclosure, a slow disk detection method is provided, the method comprising:
[0006] Using the second preset interval as the sliding window, sliding with the first preset interval as the sliding step;
[0007] When the slow disk detection condition is met, obtaining slow disk detection parameters corresponding to each first preset interval and second preset interval in the current sliding window, wherein the slow disk detection parameters include the service time of the hard disk, the number of I / O operations, and the number of I / O timeouts;
[0008] determining a first I / O timeout probability in the first preset interval according to the slow disk detection parameter in the first preset interval;
[0009] Determine the second I / O timeout probability of the second preset interval according to the slow disk detection parameters of the second preset interval;
[0010] When it is determined that the first I / O timeout probability or the second I / O timeout probability exceeds the corresponding I / O timeout threshold, determine that the hard disk is a slow disk.
[0011] In a possible implementation manner, the determining the second I / O timeout probability of the second preset interval according to the I / O times and I / O timeout times collected in the second preset interval includes:
[0012] When it is determined that the first I / O timeout probability does not exceed the corresponding I / O timeout threshold, determine the second I / O timeout probability of the second preset interval according to the I / O times and I / O timeout times collected in the second preset interval.
[0013] In a possible implementation manner, the method further includes:
[0014] If both the first I / O timeout probability and the second I / O timeout probability are less than the corresponding I / O timeout thresholds, and I / O timeouts occur in a plurality of consecutive first preset intervals within the current sliding window, determine the number of the consecutive first preset intervals;
[0015] If the number of the consecutive first preset intervals is greater than the set interval number, determine that the hard disk is a slow disk.
[0016] In a possible implementation manner, the obtaining the first I / O timeout times / second I / O timeout times includes:
[0017] When it is detected that the frequency of I / O timeouts exceeds the set frequency threshold, merge the first I / O timeout times obtained within the third preset interval into one time, and the length of the third preset interval is less than that of the first preset interval.
[0018] In a possible implementation manner, the determining the first I / O timeout probability of the first preset interval according to the slow disk detection parameters of the first preset interval includes:
[0019] Calculate the average I / O timeout frequency of the first preset interval according to the ratio of the I / O timeout times of the first preset interval to the service duration of the hard disk in the first preset interval;
[0020] Calculate the average I / O frequency of the first preset interval according to the ratio of the I / O times of the first preset interval to the service duration of the hard disk in the first preset interval;
[0021] Calculate the first I / O timeout probability of the first preset interval according to the ratio of the average I / O timeout frequency of the first preset interval to the average I / O frequency of the first preset interval.
[0022] In a possible implementation manner, the determining the second I / O timeout probability of the second preset interval according to the slow disk detection parameter of the second preset interval includes:
[0023] Calculate the average I / O timeout frequency of the second preset interval according to the ratio of the number of I / O timeouts in the second preset interval to the service duration of the hard disk in the second preset interval;
[0024] Calculate the average I / O frequency of the second preset interval according to the ratio of the number of I / Os in the second preset interval to the service duration of the hard disk in the second preset interval;
[0025] Calculate the second I / O timeout probability of the second preset interval according to the ratio of the average I / O timeout frequency of the second preset interval to the average I / O frequency of the second preset interval.
[0026] In a possible implementation manner, when the slow disk detection condition is satisfied, obtain the slow disk detection parameters corresponding to each first preset interval and second preset interval in the current sliding window, where the slow disk detection parameters include the service duration of the hard disk, the number of I / Os, and the number of I / O timeouts, including:
[0027] Obtain the mapping relationship table of the hard disk slot number, hard disk label, service time, number of I / Os, and number of I / O timeouts established by the data node;
[0028] According to the service time, number of I / Os, and number of I / O timeouts of the hard disk in the mapping relationship table, obtain the slow disk detection parameters corresponding to each first preset interval and second preset interval in the current sliding window.
[0029] In a possible implementation manner, when determining that the hard disk is a slow disk, it further includes:
[0030] Mark the hard disk as a slow disk;
[0031] Isolate the hard disk and report it to the metadata node, and stop writing service data;
[0032] Transfer the data on the hard disk to other hard disks of the data node or hard disks of other data nodes through load balancing.
[0033] According to the second aspect of the embodiments of the present disclosure, there is provided a slow disk detection device, and the device includes:
[0034] A second preset interval sliding module, configured to use a second preset interval as a sliding window and slide with a first preset interval as a sliding step length;
[0035] A slow disk detection parameter acquisition module, configured to, when a slow disk detection condition is met, acquire slow disk detection parameters corresponding to each first preset interval and the second preset interval within the current sliding window, where the slow disk detection parameters include the service duration, the number of I / O operations, and the number of I / O timeouts of the hard disk;
[0036] A first I / O timeout probability determination module, configured to determine a first I / O timeout probability of the first preset interval according to the slow disk detection parameters of the first preset interval;
[0037] A second I / O timeout probability determination module, configured to determine a second I / O timeout probability of the second preset interval according to the slow disk detection parameters of the second preset interval;
[0038] A slow disk determination module, configured to determine that the hard disk is a slow disk when the first I / O timeout probability or the second I / O timeout probability exceeds a corresponding I / O timeout threshold.
[0039] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device including: a processor; a memory for storing processor-executable instructions; wherein, the processor runs the executable instructions to implement the steps of the above-mentioned slow disk detection method.
[0040] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable and writable storage medium, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the above-mentioned slow disk detection method are implemented.
[0041] In addition, the technical effects brought by any implementation manner in the second aspect to the fourth aspect can refer to the technical effects brought by different implementation manners in the first aspect, which will not be elaborated here.
[0042] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:
[0043] By setting two preset intervals to detect the hard disk from the local to the whole, the detection dimension is expanded, which can effectively cope with different scenarios. At the same time, the hard disks are independent of each other and there is no dependence, ensuring the uniqueness of the detection result and the low coupling of the detection scheme.
[0044] Considering the hot plugging situation of data nodes and the different orders of magnitude of the service duration of the hard disk and the number of received I / O requests, by unifying the detection points of each hard disk from the perspective of the probability of I / O timeout per unit time, the detection accuracy is improved. Description of the Drawings
[0045] To more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following briefly introduces the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present disclosure. For those of ordinary skill in the art, other accompanying drawings can be obtained based on these drawings without creative efforts.
[0046] Figure 1 It is a schematic diagram of an application scenario shown according to an exemplary embodiment;
[0047] Figure 2 It is a flowchart of a slow disk detection method shown according to an exemplary embodiment;
[0048] Figure 3 It is a schematic diagram of a sliding window in a slow disk detection method shown according to an exemplary embodiment;
[0049] Figure 4 It is a schematic diagram of the sliding window after sliding in a slow disk detection method shown according to an exemplary embodiment;
[0050] Figure 5 It is an overall flowchart of a slow disk detection method shown according to an exemplary embodiment;
[0051] Figure 6 It is a schematic diagram for determining a slow disk in a scenario with low service pressure in a slow disk detection method shown according to an exemplary embodiment;
[0052] Figure 7 It is a flowchart for detecting a slow disk in a slow disk detection method shown according to an exemplary embodiment;
[0053] Figure 8 It is a schematic diagram of the module structure of a slow disk detection device shown according to an exemplary embodiment;
[0054] Figure 9 It is a schematic diagram of an electronic device for a slow disk detection method shown according to an exemplary embodiment;
[0055] Figure 10 It is a schematic diagram of a program product for a slow disk detection method shown according to an exemplary embodiment. Detailed implementation manners
[0056] To make the objectives, technical solutions, and advantages of the present disclosure clearer, the following further describes the present disclosure in detail with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present disclosure, rather than all embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present disclosure.
[0057] Some terms appearing in the text are explained as follows:
[0058] 1. In the embodiments of the present disclosure, the term "and / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0059] 2. Terms such as "first", "second", etc. in the specification, claims and the above-mentioned drawings of the present disclosure are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described here can be implemented in an order other than those illustrated or described here.
[0060] The application scenarios described in the embodiments of the present disclosure are for more clearly explaining the technical solutions of the embodiments of the present disclosure, and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. Those of ordinary skill in the art know that with the emergence of new application scenarios, the technical solutions provided by the embodiments of the present disclosure are equally applicable to similar technical problems. Among them, in the description of the present disclosure, unless otherwise specified, the meaning of "a plurality" is two or more.
[0061] In the prior art, specific detection and processing methods are not given for larger and smaller business pressure scenarios, thus increasing the false positive rate of slow disk detection.
[0062] To solve the above problems, the present disclosure provides a slow disk detection method, device and computer-readable storage medium, which statistically calculate the I / O timeout probability of each hard disk from two time dimensions, screen out slow disks, and give specific detection and processing methods for larger and smaller business pressure scenarios in particular, reduce the false positive rate of slow disk detection, and improve the accuracy of slow disk detection.
[0063] First, refer to Figure 1 , which is a schematic diagram of the application scenario of the embodiments of the present disclosure. User 10 logs in to the metadata server 12 in the distributed storage cluster storage system through the client installed in the user device 11. Among them, the client can be a web browser or an application client installed in a mobile user device such as a mobile phone or a tablet computer.
[0064] The user device 11 is communicatively connected to the metadata server 12 via a network, which can be a local area network, a wide area network, etc. The user device 11 can be a portable device (such as a mobile phone, a tablet, a laptop computer, etc.), or a personal computer (PC, Personal Computer), and the metadata server 12 can be any device capable of providing Internet services.
[0065] A possible form of communication between the user device 11 and the metadata server 12 is that the user can log in to the corresponding slow disk detection platform and send the slow disk detection instruction of the user 10 to the metadata server 12 through the communication network, and the data node 13 in the metadata server 12 determines whether each hard disk belonging to the data node 13 is a slow disk.
[0066] In the embodiments of the present disclosure, the data node 13 uses the second preset interval as a sliding window and slides with the first preset interval as a sliding step; when the slow disk detection condition is satisfied, the slow disk detection parameters corresponding to each of the first preset interval and the second preset interval within the current sliding window are obtained, and the slow disk detection parameters include the service duration, the number of I / O operations, and the number of I / O timeouts of the hard disk; according to the slow disk detection parameters of the first preset interval, the first I / O timeout probability of the first preset interval is determined; according to the slow disk detection parameters of the second preset interval, the second I / O timeout probability of the second preset interval is determined; when it is determined that the first I / O timeout probability or the second I / O timeout probability exceeds the corresponding I / O timeout threshold, it is determined that the hard disk is a slow disk.
[0067] In the embodiments of the present disclosure, a slow disk detection method is provided. Based on the same concept, a slow disk detection device, an electronic device, and a computer-readable storage medium are also provided.
[0068] Embodiment 1
[0069] The following uses specific embodiments to illustrate a slow disk detection method provided by the present disclosure. This method is applied to a data node in a distributed storage cluster storage system, such as Figure 2 As shown, it includes:
[0070] Step 201, using the second preset interval as a sliding window and sliding with the first preset interval as a sliding step;
[0071] Specifically, the second preset interval is n times the first preset interval. The first preset interval and the second preset interval and the multiple relationship n between the two can be set according to the actual situation, or can be directly completed through the configuration file of the data node. The first preset interval is represented by I1, and the second preset interval is represented by I2 (I2 = {I 11 ,I 12 ,I 13,...,I 1n is represented by. As Figure 3 shown, the first preset interval is 1 day, and the second preset interval is 7 days. Taking the second preset interval as a sliding window and sliding it with the first preset interval as the sliding step, as Figure 4 shown, the sliding step of the sliding window is 1 day, changing from the original position of [0, 7] to the position of [1, 8]. The present disclosure sets two preset intervals to detect the hard disk from local to whole, expanding the detection dimension and being able to effectively cope with different scenarios. At the same time, the hard disks are independent of each other and there is no dependence, ensuring the uniqueness of the detection result and the low coupling of the detection scheme.
[0072] Step 202, when the slow disk detection condition is satisfied, obtain the slow disk detection parameters corresponding to each first preset interval and second preset interval within the current sliding window, where the slow disk detection parameters include the service duration, I / O times, and I / O timeout times of the hard disk;
[0073] Specifically, the service duration of the hard disk is the total response duration of the hard disk to process I / O requests in the first preset interval or the second preset interval, the I / O timeout times of the hard disk are the total number of times the hard disk responds with timeout when processing I / O requests in the first preset interval or the second preset interval, and the I / O times of the hard disk are the total number of times the hard disk processes I / O requests in the first preset interval or the second preset interval, including the I / O timeout times.
[0074] Step 203, determine the first I / O timeout probability of the first preset interval according to the slow disk detection parameters of the first preset interval;
[0075] Specifically, the first I / O timeout probability is expressed as the probability of I / O timeout occurring per unit time in the first preset interval, and the first I / O timeout probability of the first preset interval is determined according to the service duration, I / O times, and I / O timeout times of the hard disk in the first preset interval.
[0076] Step 204, determine the second I / O timeout probability of the second preset interval according to the slow disk detection parameters of the second preset interval;
[0077] Specifically, the second I / O timeout probability is expressed as the probability of I / O timeout occurring per unit time in the second preset interval, and the second I / O timeout probability of the second preset interval is determined according to the service duration, I / O times, and I / O timeout times of the hard disk in the second preset interval. There is a situation of hot plugging of data nodes, and the service duration of the hard disk and the order of magnitude of receiving I / O requests are different. By unifying the detection points of each hard disk from the perspective of the probability of I / O timeout occurring per unit time, the detection accuracy is improved.
[0078] Step 205: When it is determined that the first I / O timeout probability or the second I / O timeout probability exceeds the corresponding I / O timeout threshold, determine that the hard disk is a slow disk.
[0079] Specifically, if it is determined that the first I / O timeout probability exceeds the corresponding I / O timeout threshold, determine that the hard disk is a slow disk; otherwise, determine the second I / O timeout probability in the second preset interval. If it is determined that the second I / O timeout probability exceeds the corresponding I / O timeout threshold, determine that the hard disk is a slow disk.
[0080] The slow disk detection method provided by the embodiments of the present disclosure can statistically calculate the I / O timeout probability of each hard disk from two time dimensions of the first preset interval and the second preset interval. By comparing with the thresholds in the corresponding intervals respectively, slow disks are screened out, reducing the misjudgment rate of slow disk detection and improving the accuracy of slow disk detection.
[0081] When the slow disk detection condition is met, it can be set as needed, which can be triggered periodically, triggered at a certain time point, or triggered according to the data storage situation. As an optional implementation manner, it can be determined whether the detection condition is met according to the configuration item in the configuration file. The above configuration item is a configuration item indicating whether to turn on the slow disk detection switch. When it is determined to turn on the slow disk detection switch according to the configuration item, it is determined that the slow disk detection condition is met.
[0082] The above configuration file may further include the first preset interval, the second preset interval, the corresponding thresholds, and other related configuration items.
[0083] As an optional implementation manner, when this method is applied to a data node, each data node can establish its own mapping relationship table in the memory. The role of this mapping relationship table is to establish the data information corresponding to each hard disk in multiple hard disks of the data node for determining slow disk detection parameters. Specifically, the content of this mapping relationship table may include: hard disk slot number, hard disk label, service time, number of I / Os, and number of I / O timeouts. Then, the above slow disk detection parameters can be determined according to the mapping relationship table established in the memory. Specifically, the hard disk slot number is the slot number of the hard disk in the server where it is located; the hard disk label is used to identify normal disks, slow disks, bad disks, and unknown disks. The embodiments of the present disclosure only target normal disks and slow disks. According to the hard disk label, it is determined whether the hard disk is a slow disk. By reading the service time of the hard disk, the service time of the hard disk in the first preset interval and the service time of the hard disk in the second preset interval are determined. By reading the number of I / Os of the hard disk, the number of I / Os of the hard disk in the first preset interval and the number of I / Os of the hard disk in the second preset interval are determined. By reading the number of I / O timeouts of the hard disk, the number of I / O timeouts of the hard disk in the first preset interval and the number of I / O timeouts of the hard disk in the second preset interval are determined.
[0084] As an alternative implementation, when determining that the hard disk is a slow disk, it further includes:
[0085] Mark the hard disk as a slow disk;
[0086] Isolate the hard disk and report it to the metadata node, and stop writing business data;
[0087] Transfer the data on the hard disk to other hard disks of the data node or hard disks of other data nodes through load balancing.
[0088] Specifically, this process is an existing technology. There are currently various methods to implement load balancing, such as dynamic load balancing methods, etc., which will not be elaborated here.
[0089] Figure 5 Is an overall flowchart of a slow disk detection method shown according to an exemplary embodiment, which is applied to a data node in a distributed storage cluster, such as Figure 5 As shown, it includes:
[0090] Step 501, each data node in the distributed storage cluster system reads the configuration file;
[0091] Specifically, when the data node starts, it reads the configuration file, and according to the configuration items in the configuration file, determines whether to turn on the slow disk detection switch, so that the data node can perform real-time detection on the hard disk.
[0092] Step 502, according to the configuration items in the configuration file, determine whether to enable slow disk detection. If slow disk detection is not enabled, directly end;
[0093] Step 503, according to the configuration items in the configuration file, if slow disk detection is enabled, set each preset interval, each preset interval threshold, and other related configuration items according to the configuration file;
[0094] Specifically, it is necessary to set the first preset interval and the corresponding threshold, the second preset interval and the corresponding threshold, etc.
[0095] Step 504, each data node establishes a mapping relationship table in the memory, and dynamically updates the content of the above mapping relationship table as the hard disk business data is input and output;
[0096] Step 505, each data node performs periodic I / O performance statistics on the hard disks it belongs to according to the mapping relationship table;
[0097] Specifically, it can be statistically calculated every time the sliding window slides, that is, according to the above content of the mapping relationship table, determine the current sliding window and the slow disk detection parameters of each first preset interval within the sliding window.
[0098] It should be noted that when a new slide occurs in the sliding window, only one first preset interval is updated. For the second preset interval that is not updated, since the slow disk determination has been performed according to the slow disk detection parameter before, only the slow disk detection parameters of the updated first preset interval need to be counted.
[0099] Step 506: Detect whether the hard disk is a slow disk according to the counted slow disk detection parameters of the first preset interval. If it is not a slow disk, execute Step 507; otherwise, execute Step 508.
[0100] Step 507: Detect whether the hard disk is a slow disk according to the counted slow disk detection parameters of the second preset interval. If it is not a slow disk, execute Step 505; otherwise, execute Step 508.
[0101] Specifically, in the initial stage when the data node is powered on, if the duration of slow disk detection statistics has not reached the second preset interval, the second I / O timeout probability of the second preset interval is not calculated, and only the first I / O timeout probability of the first preset interval is calculated. Because the hard disk on the data node is new hardware in the initial stage of power-on, the situation of slow disks can be basically ignored. When the duration of statistical data reaches the second preset interval, calculate the second I / O timeout probability of the second preset interval, slide according to the length of the first preset interval, and clear the data not in the second preset interval.
[0102] Step 508: The data node marks the hard disk as a slow disk and dynamically updates the mapping relation table.
[0103] Specifically, only the data node needs to modify the relation table in the memory, which will not cause pressure on the system, memory, and network bandwidth of the data node, improving the availability of the storage cluster.
[0104] Step 509: Isolate the hard disk and report it to the metadata node, and stop writing business data.
[0105] Step 510: Transfer the data on the hard disk to other hard disks of the data node or hard disks of other data nodes through load balancing.
[0106] Specifically, Steps 508 - 510 are used to ensure the availability, reliability, and access efficiency of the distributed storage cluster.
[0107] As an optional implementation manner, the methods for calculating the first I / O timeout probability and the second I / O timeout probability in this embodiment are as follows:
[0108] 1) First I / O timeout probability
[0109] Calculate the average I / O timeout frequency of the first preset interval according to the ratio of the I / O timeout times of the first preset interval to the service duration of the hard disk in the first preset interval.
[0110] Calculate the average I / O frequency of the first preset interval according to the ratio of the number of I / Os in the first preset interval to the service duration of the hard disk in the first preset interval;
[0111] Calculate the first I / O timeout probability of the first preset interval according to the ratio of the average I / O timeout frequency in the first preset interval to the average I / O frequency in the first preset interval.
[0112] 2) Second I / O timeout probability
[0113] Calculate the average I / O timeout frequency of the second preset interval according to the ratio of the number of I / O timeouts in the second preset interval to the service duration of the hard disk in the second preset interval;
[0114] Calculate the average I / O frequency of the second preset interval according to the ratio of the number of I / Os in the second preset interval to the service duration of the hard disk in the second preset interval;
[0115] Calculate the second I / O timeout probability of the second preset interval according to the ratio of the average I / O timeout frequency in the second preset interval to the average I / O frequency in the second preset interval.
[0116] Under normal business environment, slow disks can be detected by the above method, but in actual business scenarios, there will be scenarios with high and low business pressures. The business volume in the scenario with low business pressure is less than the normal business volume, which affects the reliability of the distributed cluster.
[0117] As an optional implementation manner, the method further includes:
[0118] If both the first I / O timeout probability and the second I / O timeout probability are less than the corresponding I / O timeout thresholds, and there are multiple consecutive first preset intervals with I / O timeouts in the current sliding window, determine the number of the multiple consecutive first preset intervals;
[0119] If the number of the multiple consecutive first preset intervals is greater than the set interval number, determine that the hard disk is a slow disk.
[0120] Specifically, the business volume of this scenario is less than the normal business volume, and it may occur that both the first I / O timeout probability of the first preset interval and the second I / O timeout probability of the second preset interval are less than the corresponding I / O timeout thresholds, but the hard disk experiences an I / O timeout starting from the i-th first preset interval I 1i until the j-th first preset interval I in the second preset interval where it is located 1jWhen an I / O timeout ends and the number of the first preset intervals with I / O timeouts is greater than or equal to the set number of intervals, that is, j - i + 1 ≥ N, where 1 ≤ i < j ≤ n, n is the multiple of the second preset interval to the first preset interval, and N is the set number of intervals, and the size of N can be set according to the actual situation, then it is determined that the hard disk is a slow disk.
[0121] As Figure 6 shown, in the configuration file of the data node of the present disclosure, the threshold N is set to n is set to 7. Starting from the 2nd to the 6th first preset intervals where I / O timeouts occur continuously, then i = 2, j = 6. According to j - i + 1 ≥ N, it is determined that this hard disk is a slow disk.
[0122] According to the characteristics of the slow disk, the present disclosure considers the scenario with relatively small business pressure. There may be hard disks that do not meet the first preset interval threshold and the second preset interval threshold, but have I / O timeouts continuously in multiple first preset intervals. The present disclosure effectively screens out slow disks for this phenomenon and timely performs data migration, improving the reliability of the distributed cluster.
[0123] In the scenario with relatively large business pressure, the relatively large business pressure will cause the hard disk to jitter and result in high-frequency I / O timeouts, which is likely to cause misjudgment of the target hard disk.
[0124] As an optional implementation manner, the obtaining of the first I / O timeout count includes:
[0125] When it is detected that the frequency of I / O timeouts exceeds the set frequency threshold, the first I / O timeout counts obtained within the third preset interval are merged into one time, and the length of the third preset interval is less than the first preset interval.
[0126] Specifically, to improve the accuracy of slow disk detection, when it is detected that the frequency of I / O timeouts exceeds the set frequency threshold, the data node needs to set the third preset interval, merge the first I / O timeout counts obtained within the third preset interval into one time, and normally record the I / O timeout counts that occur outside the third preset interval. The length of the third preset interval is less than the first preset interval.
[0127] For example, the third preset interval is set to 30 seconds (s). When an I / O timeout occurs at time t, the data node records it. If an I / O timeout still occurs within the interval [t, t + 30], it will no longer be recorded, that is, only one I / O timeout is recorded within the interval [t, t + 30]. If an I / O timeout occurs outside the interval [t, t + 30], the I / O timeout count is normally recorded.
[0128] In a scenario with high business pressure, the I / O timeout counts that frequently occur within the third preset interval are merged and only counted once, reducing the misjudgment probability of a large business being determined as a slow disk, thereby improving the accuracy of slow disk detection.
[0129] Figure 7 It is a flowchart for detecting a slow disk of a slow disk detection method shown according to an exemplary embodiment, as Figure 7 shown, including:
[0130] Step 701, obtain slow disk detection parameters according to the mapping relation table;
[0131] Specifically, according to the service time of the hard disk, the I / O occurrence time, and the I / O timeout time in the mapping relation table, obtain the slow disk detection parameters corresponding to each first preset interval and second preset interval within the current sliding window.
[0132] Step 702, determine the first I / O timeout probability of the first preset interval;
[0133] As mentioned above, in the first preset interval, before determining the first I / O timeout probability, it is necessary to calculate the frequency of I / O timeout according to the corresponding slow disk detection parameters, that is, the number of I / O timeouts per unit time. If the frequency of I / O timeout exceeds the set frequency threshold, the first I / O timeout counts obtained within the third preset interval are merged into one, and the first I / O timeout counts that occur outside the third preset interval are recorded normally, and then the first I / O timeout probability of the first preset interval is determined. If the frequency of I / O timeout does not exceed the set frequency threshold, the first I / O timeout probability of the first preset interval is directly determined.
[0134] Step 703, determine whether the first I / O timeout probability exceeds the corresponding I / O timeout threshold. If so, execute step 708; otherwise, execute step 704;
[0135] Specifically, step 704, determine the second I / O timeout probability of the second preset interval;
[0136] Step 705, determine whether the second I / O timeout probability exceeds the corresponding I / O timeout threshold. If so, execute step 708; otherwise, execute step 706;
[0137] Step 706, obtain the number of consecutive first preset intervals within the current sliding window;
[0138] Step 707, determine whether the number of the consecutive first preset intervals is greater than the set interval number. If so, execute step 708; otherwise, execute step 709;
[0139] Step 708, determine that the hard disk is a slow disk;
[0140] Step 709: Determine that the hard disk is not a slow disk.
[0141] Embodiment 2
[0142] Based on the same inventive concept, an embodiment of the present disclosure further provides a slow disk detection device. Since this device is the same as the device in the method of the embodiment of the present disclosure, and the principle of solving problems by this device is similar to that of the method, the implementation of this device can refer to the implementation of the method, and the repeated parts will not be elaborated.
[0143] As Figure 8 shown, the above device includes the following modules:
[0144] The second preset interval sliding module 801 is configured to use the second preset interval as a sliding window and slide with the first preset interval as a sliding step length;
[0145] The slow disk detection parameter acquisition module 802 is configured to, when the slow disk detection condition is satisfied, acquire the slow disk detection parameters corresponding to each first preset interval and the second preset interval within the current sliding window, where the slow disk detection parameters include the service duration, the number of I / Os, and the number of I / O timeouts of the hard disk;
[0146] The first I / O timeout probability determination module 803 is configured to determine the first I / O timeout probability of the first preset interval according to the slow disk detection parameters of the first preset interval;
[0147] The second I / O timeout probability determination module 804 is configured to determine the second I / O timeout probability of the second preset interval according to the slow disk detection parameters of the second preset interval;
[0148] The slow disk determination module 805 is configured to determine that the hard disk is a slow disk when the first I / O timeout probability or the second I / O timeout probability exceeds the corresponding I / O timeout threshold.
[0149] As an optional implementation manner, the second I / O timeout probability determination module is configured to determine the second I / O timeout probability of the second preset interval according to the number of I / Os and the number of I / O timeouts collected in the second preset interval, including:
[0150] When it is determined that the first I / O timeout probability does not exceed the corresponding I / O timeout threshold, determine the second I / O timeout probability of the second preset interval according to the number of I / Os and the number of I / O timeouts collected in the second preset interval.
[0151] As an optional implementation manner, the device further includes:
[0152] The first preset interval number determination module is used to determine the number of consecutive first preset intervals that have I / O timeouts within the current sliding window if both the first I / O timeout probability and the second I / O timeout probability are less than their corresponding I / O timeout thresholds.
[0153] The slow disk determination module is further used to determine that the hard disk is a slow disk if the number of consecutive first preset intervals is greater than the set interval number.
[0154] As an optional implementation manner, the slow disk detection parameter acquisition module is used to acquire the first I / O timeout times, including:
[0155] When it is detected that the frequency of I / O timeouts exceeds the set frequency threshold, the first I / O timeout times obtained within the third preset interval are merged into one time, and the length of the third preset interval is less than that of the first preset interval.
[0156] As an optional implementation manner, the first I / O timeout probability determination module is used to determine the first I / O timeout probability of the first preset interval according to the slow disk detection parameters of the first preset interval, including:
[0157] Calculate the average I / O timeout frequency of the first preset interval according to the ratio of the I / O timeout times of the first preset interval to the service duration of the hard disk in the first preset interval;
[0158] Calculate the average I / O frequency of the first preset interval according to the ratio of the I / O times of the first preset interval to the service duration of the hard disk in the first preset interval;
[0159] Calculate the first I / O timeout probability of the first preset interval according to the ratio of the average I / O timeout frequency of the first preset interval to the average I / O frequency of the first preset interval.
[0160] As an optional implementation manner, the second I / O timeout probability determination module is used to determine the second I / O timeout probability of the second preset interval according to the slow disk detection parameters of the second preset interval, including:
[0161] Calculate the average I / O timeout frequency of the second preset interval according to the ratio of the I / O timeout times of the second preset interval to the service duration of the hard disk in the second preset interval;
[0162] Calculate the average I / O frequency of the second preset interval according to the ratio of the I / O times of the second preset interval to the service duration of the hard disk in the second preset interval;
[0163] Calculate the second I / O timeout probability of the second preset interval according to the ratio of the average I / O timeout frequency to the average I / O frequency of the second preset interval.
[0164] As an optional implementation manner, the slow disk detection parameter acquisition module is configured to, when the slow disk detection condition is satisfied, acquire the slow disk detection parameters corresponding to each first preset interval and second preset interval within the current sliding window, where the slow disk detection parameters include the service duration, I / O count, and I / O timeout count of the hard disk, and include:
[0165] Acquire the mapping relation table of the hard disk slot number, hard disk label, service time, I / O count, and I / O timeout count established by the data node;
[0166] According to the service time, I / O count, and I / O timeout count of the hard disk in the mapping relation table, acquire the slow disk detection parameters corresponding to each first preset interval and second preset interval within the current sliding window.
[0167] As an optional implementation manner, when the slow disk determination module determines that the hard disk is a slow disk, it is further configured to:
[0168] Mark the hard disk as a slow disk;
[0169] Isolate the hard disk and report it to the metadata node, and stop writing service data;
[0170] Transfer the data on the hard disk to other hard disks of the data node or hard disks of other data nodes through load balancing.
[0171] Embodiment 3
[0172] Based on the same inventive concept, the present disclosure also provides a slow disk detection electronic device in this embodiment. Since this electronic device is the electronic device in the method of the present disclosure embodiment, and the principle of this electronic device to solve problems is similar to that of the method, the implementation of this electronic device can refer to the implementation of the method, and the repeated parts will not be elaborated.
[0173] Next, refer to Figure 9 to describe the electronic device 90 according to this implementation manner of the present disclosure. Figure 9 The shown electronic device 90 is only an example and should not bring any limitation to the functions and usage scope of the present disclosure embodiment.
[0174] As Figure 9As shown, the electronic device 90 may be embodied in the form of a general computing device. For example, it may be a terminal device. The components of the electronic device 90 may include, but are not limited to: at least one of the above-mentioned processors 91, at least one memory 92 that stores processor-executable instructions, and a bus 93 that connects different system components (including the memory 92 and the processor 91).
[0175] The processor runs the executable instructions to implement the following steps:
[0176] Use the second preset interval as a sliding window and slide with the first preset interval as the sliding step;
[0177] When the slow disk detection condition is met, obtain the slow disk detection parameters corresponding to each first preset interval and the second preset interval within the current sliding window. The slow disk detection parameters include the service duration, I / O count, and I / O timeout count of the hard disk;
[0178] Determine the first I / O timeout probability of the first preset interval according to the slow disk detection parameters of the first preset interval;
[0179] Determine the second I / O timeout probability of the second preset interval according to the slow disk detection parameters of the second preset interval;
[0180] When it is determined that the first I / O timeout probability or the second I / O timeout probability exceeds the corresponding I / O timeout threshold, determine that the hard disk is a slow disk.
[0181] As an optional implementation, the processor is used to execute to determine the second I / O timeout probability of the second preset interval according to the I / O count and I / O timeout count collected in the second preset interval, including:
[0182] When it is determined that the first I / O timeout probability does not exceed the corresponding I / O timeout threshold, determine the second I / O timeout probability of the second preset interval according to the I / O count and I / O timeout count collected in the second preset interval.
[0183] As an optional implementation, the processor is further used to execute:
[0184] If both the first I / O timeout probability and the second I / O timeout probability are less than the corresponding I / O timeout threshold, and I / O timeouts occur in a plurality of consecutive first preset intervals within the current sliding window, determine the number of the plurality of consecutive first preset intervals;
[0185] If the number of the plurality of consecutive first preset intervals is greater than the set interval number, determine that the hard disk is a slow disk.
[0186] As an alternative implementation, the processor is configured to execute obtaining the first I / O timeout count, including:
[0187] When it is detected that the frequency of I / O timeouts exceeds a set frequency threshold, the first I / O timeout counts obtained within a third preset interval are combined into one time, and the length of the third preset interval is less than that of the first preset interval.
[0188] As an alternative implementation, the processor is configured to execute determining the first I / O timeout probability of the first preset interval according to the slow disk detection parameters of the first preset interval, including:
[0189] Calculate the average I / O timeout frequency of the first preset interval according to the ratio of the I / O timeout count of the first preset interval to the service duration of the hard disk in the first preset interval;
[0190] Calculate the average I / O frequency of the first preset interval according to the ratio of the I / O count of the first preset interval to the service duration of the hard disk in the first preset interval;
[0191] Calculate the first I / O timeout probability of the first preset interval according to the ratio of the average I / O timeout frequency of the first preset interval to the average I / O frequency of the first preset interval.
[0192] As an alternative implementation, the processor is configured to execute determining the second I / O timeout probability of the second preset interval according to the slow disk detection parameters of the second preset interval, including:
[0193] Calculate the average I / O timeout frequency of the second preset interval according to the ratio of the I / O timeout count of the second preset interval to the service duration of the hard disk in the second preset interval;
[0194] Calculate the average I / O frequency of the second preset interval according to the ratio of the I / O count of the second preset interval to the service duration of the hard disk in the second preset interval;
[0195] Calculate the second I / O timeout probability of the second preset interval according to the ratio of the average I / O timeout frequency of the second preset interval to the average I / O frequency of the second preset interval.
[0196] As an alternative implementation, when the slow disk detection condition is met, the processor is configured to execute obtaining the slow disk detection parameters corresponding to each first preset interval and second preset interval within the current sliding window, where the slow disk detection parameters include the service duration of the hard disk, the I / O count, and the I / O timeout count, including:
[0197] Obtain the mapping relationship table of the hard disk slot number, hard disk label, service time, I / O count, and I / O timeout count established by the data node;
[0198] Obtain slow disk detection parameters corresponding to each first preset interval and second preset interval in the current sliding window according to the service time, I / O times, and I / O timeout times of the hard disk in the mapping relation table.
[0199] As an optional implementation manner, when the processor is used to execute the determination that the hard disk is a slow disk, it further includes:
[0200] Mark the hard disk as a slow disk;
[0201] Isolate the hard disk and report it to the metadata node, and stop writing service data;
[0202] Transfer the data on the hard disk to other hard disks of the data node or hard disks of other data nodes through load balancing.
[0203] Bus 93 represents one or more of several types of bus architectures, including a memory bus or memory controller, a peripheral bus, a processor, or a local area bus using any bus architecture in multiple bus architectures.
[0204] The memory 92 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 921 and / or cache memory 922, and may further include read-only memory (ROM) 923.
[0205] The memory 92 may further include a program / utilities 925 having a set (at least one) of program modules 924. Such program modules 924 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. The implementation of a network environment may be included in each or some combination of these examples.
[0206] The electronic device 90 can also communicate with one or more external devices 94 (such as a keyboard, a pointing device, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 90, and / or communicate with any device that enables the electronic device 90 to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 95. Moreover, the electronic device 90 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 96. As shown in the figure, the network adapter 96 communicates with other modules of the electronic device 90 through the bus 93. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 90, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0207] Embodiment 4
[0208] In some possible implementation manners, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to enable the terminal device to execute the steps of each module in the slow disk detection device according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification. For example, the terminal device can be used to adopt a second preset interval as a sliding window and slide with a first preset interval as a sliding step; when the slow disk detection condition is met, obtain the slow disk detection parameters corresponding to each first preset interval and the second preset interval within the current sliding window, where the slow disk detection parameters include the service duration, the number of I / Os, and the number of I / O timeouts of the hard disk; determine the first I / O timeout probability of the first preset interval according to the slow disk detection parameters of the first preset interval; determine the second I / O timeout probability of the second preset interval according to the slow disk detection parameters of the second preset interval; when it is determined that the first I / O timeout probability or the second I / O timeout probability exceeds the corresponding I / O timeout threshold, determine that the hard disk is a slow disk.
[0209] The program product may employ any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0210] As Figure 10 shown, a program product 100 for slow disk detection according to an embodiment of the present disclosure is described. It may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, the readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0211] The readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which the readable program code is carried. Such a propagated data signal may take various forms, including - but not limited to - an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. The readable signal medium may also be any readable medium other than the readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0212] The program code contained on the readable medium may be transmitted using any appropriate medium, including - but not limited to - wireless, wired, optical fiber, RF, etc., or any suitable combination of the foregoing.
[0213] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0214] It should be noted that although several modules or sub-modules of the system are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more of the above-described modules may be embodied in one module. Conversely, the features and functions of one module described above may be further divided and embodied by multiple modules.
[0215] In addition, although the operations of the various modules of the system of the present disclosure are described in a specific order in the drawings, this does not require or imply that the operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Additionally or alternatively, some operations may be omitted, multiple operations may be combined into one operation for execution, and / or one operation may be decomposed into multiple operations for execution.
[0216] Those skilled in the art should understand that the embodiments of the present disclosure may be provided as a method, a system, or a computer program product. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0217] The present disclosure is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices produce an apparatus for implementing the functions specified in one or more flows Figure 1 one or more flows and / or blocks Figure 1 or one or more blocks.
[0218] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction apparatus that implements the functions specified in one or more flows Figure 1 one or more flows and / or blocks Figure 1 or one or more blocks.
[0219] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows Figure 1 one or more flows and / or blocks Figure 1 or one or more blocks.
[0220] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0221] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A slow disk detection method, applied to a data node, characterized in that, The method includes: Using a second preset interval as a sliding window and sliding with a first preset interval as a sliding step; When the slow disk detection condition is met, obtaining the slow disk detection parameters corresponding to each first preset interval and the second preset interval within the current sliding window, where the slow disk detection parameters include the service duration, I / O count, and I / O timeout count of the hard disk; Determining a first I / O timeout probability of the first preset interval according to the slow disk detection parameters of the first preset interval; Determining a second I / O timeout probability of the second preset interval according to the slow disk detection parameters of the second preset interval; When it is determined that the first I / O timeout probability or the second I / O timeout probability exceeds the corresponding I / O timeout threshold, determining that the hard disk is a slow disk.
2. The method according to claim 1, wherein The determining the second I / O timeout probability of the second preset interval according to the I / O count and I / O timeout count collected in the second preset interval includes: When it is determined that the first I / O timeout probability does not exceed the corresponding I / O timeout threshold, determining the second I / O timeout probability of the second preset interval according to the I / O count and I / O timeout count collected in the second preset interval.
3. The method according to claim 1, wherein It further includes: If both the first I / O timeout probability and the second I / O timeout probability are less than the corresponding I / O timeout thresholds, and I / O timeouts occur in multiple consecutive first preset intervals within the current sliding window, determining the number of the consecutive first preset intervals; If the number of the consecutive first preset intervals is greater than a set interval number, determining that the hard disk is a slow disk.
4. The method according to claim 1, wherein The obtaining the first I / O timeout count includes: When it is detected that the frequency of I / O timeouts exceeds a set frequency threshold, merging the first I / O timeout counts obtained within a third preset interval into one time, where the length of the third preset interval is less than the first preset interval.
5. The method according to claim 1, wherein The determining the first I / O timeout probability of the first preset interval according to the slow disk detection parameters of the first preset interval includes: Calculating an average I / O timeout frequency of the first preset interval according to the ratio of the I / O timeout count of the first preset interval to the service duration of the hard disk in the first preset interval; Calculating an average I / O frequency of the first preset interval according to the ratio of the I / O count of the first preset interval to the service duration of the hard disk in the first preset interval; Calculating the first I / O timeout probability of the first preset interval according to the ratio of the average I / O timeout frequency of the first preset interval to the average I / O frequency of the first preset interval.
6. The method according to claim 1, characterized in that The determining the second I / O timeout probability of the second preset interval according to the slow disk detection parameters of the second preset interval includes: Calculating an average I / O timeout frequency of the second preset interval according to the ratio of the I / O timeout count of the second preset interval to the service duration of the hard disk in the second preset interval; Calculating an average I / O frequency of the second preset interval according to the ratio of the I / O count of the second preset interval to the service duration of the hard disk in the second preset interval; Calculating the second I / O timeout probability of the second preset interval according to the ratio of the average I / O timeout frequency of the second preset interval to the average I / O frequency of the second preset interval.
7. The method according to claim 1, characterized in that, When the slow disk detection condition is met, obtain the slow disk detection parameters corresponding to each first preset interval and second preset interval within the current sliding window respectively. The slow disk detection parameters include the service duration, the number of I / Os, and the number of I / O timeouts of the hard disk, including: Obtain the mapping relationship table of the hard disk slot number, hard disk label, service time, number of I / Os, and number of I / O timeouts established by the data node for the hard disk; According to the service time of the hard disk, the time when an I / O occurs, and the time when an I / O timeout occurs in the mapping relationship table, obtain the slow disk detection parameters corresponding to each first preset interval and second preset interval within the current sliding window respectively.
8. The method according to any one of claims 1 to 3, characterized in that, When determining that the hard disk is a slow disk, it further includes: Mark the hard disk as a slow disk; Isolate the hard disk and report it to the metadata node, and stop writing service data; Transfer the data on the hard disk to other hard disks of the data node or hard disks of other data nodes through load balancing.
9. A slow disk detection device, characterized in that, The device includes: A second preset interval sliding module, configured to use the second preset interval as a sliding window and slide with the first preset interval as a sliding step; A slow disk detection parameter acquisition module, configured to obtain the slow disk detection parameters corresponding to each first preset interval and second preset interval within the current sliding window when the slow disk detection condition is met. The slow disk detection parameters include the service duration, the number of I / Os, and the number of I / O timeouts of the hard disk; A first I / O timeout probability determination module, configured to determine the first I / O timeout probability of the first preset interval according to the slow disk detection parameters of the first preset interval; A second I / O timeout probability determination module, configured to determine the second I / O timeout probability of the second preset interval according to the slow disk detection parameters of the second preset interval; A slow disk determination module, configured to determine that the hard disk is a slow disk when the first I / O timeout probability or the second I / O timeout probability exceeds the corresponding I / O timeout threshold.
10. An electronic device, characterized in that, It includes: A processor; A memory for storing instructions executable by the processor; wherein, the processor realizes the steps of the method according to any one of claims 1 to 8 by running the executable instructions.
11. A computer-readable and writable storage medium, on which computer instructions are stored, characterized in that, When the instruction is executed by the processor, the steps of the method according to any one of claims 1 to 8 are realized.
Citation Information
Patent Citations
Processing method and device for detecting slow disk
CN103488544A
Slow disk detection method, device and equipment and storage medium
CN112416639A