Disk management method and device applied to distributed storage cluster
By dynamically adjusting the metadata cache size and performing performance detection in a distributed storage cluster based on HDD capacity, the problem of insufficient cache is solved, and the performance and resource utilization efficiency of HDD are improved.
Patent Information
- Application Number
- CN202510378428.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-07-01
AI Technical Summary
In distributed storage clusters, setting of the same metadata cache size leads to insufficient cache of large-capacity HDDs, resulting in a decrease in the metadata cache hit rate, which in turn affects HDD performance.
Dynamically adjust the size of the metadata cache according to the HDD disk capacity, perform performance detection by counting the hit rate, and output indications when abnormal, realizing dynamic adjustment to achieve performance and resource balance.
It improves the metadata cache hit rate of large-capacity HDD, improves the local file system access performance of HDD, and controls memory usage, achieving a balance between performance and resources.
Smart Images

Figure CN120233950A_ABST
Abstract
Description
Technical Field
[0001] This application relates to data storage technologies, and particularly to a disk management method and apparatus applied to a distributed storage cluster. Background Art
[0002] A distributed storage cluster usually includes N disks. For example, N is 10, 20, etc. In a specific application, at least M of the above N disks are mechanical hard disks (HDDs: Hard Disk Drives). Each HDD has a local file system for disk space management, disk I / O reading and writing, etc. Also, in order to improve the efficiency of disk reading and writing, each HDD is also configured with a corresponding metadata cache for caching metadata information of the local file system.
[0003] In a distributed storage cluster, each HDD is independent, and the metadata cache corresponding to each HDD is default set to a certain value. For example, the metadata cache corresponding to each HDD is 512MB.
[0004] However, for different HDDs, their capacities may be different, such as 2TB HDDs, 8TB HDDs, 26TB HDDs, etc. If the distributed storage cluster does not pay attention to the capacity of the HDDs and directly sets the metadata cache corresponding to each HDD in the distributed storage cluster to the same default value, such as the above-mentioned 512MB, then for a large-capacity HDD, such as a (20TB HDD), the corresponding metadata cache may be insufficient. And insufficient metadata cache will lead to a decrease in the probability that the metadata of the local file system is hit (abbreviated as metadata cache hit rate), such as less than 10%, and then lead to a sharp drop in the performance of the HDD. Summary of the Invention
[0005] This application provides a disk management method and apparatus applied to a distributed storage cluster to dynamically allocate a local file system cache with a size adapted to the capacity of the HDD.
[0006] An embodiment of this application provides a disk management method applied to a distributed storage cluster. The method includes:
[0007] For each mechanical hard disk HDD to be managed in the distributed storage cluster, based on the disk capacity A of the HDD, determine the size Y of the metadata cache that matches the disk capacity A of the HDD;
[0008] Control the HDD to use a metadata cache with a size of Y to cache metadata, and count the hit rate of the metadata in the metadata cache, and perform a performance detection on the HDD based on the hit rate;
[0009] If an abnormality is detected in the performance detection, output an abnormality indication.
[0010] An embodiment of the present application provides a disk management device applied to a distributed storage cluster. The device includes:
[0011] A determination unit, configured to, for each mechanical hard disk HDD to be managed in the distributed storage cluster, determine the size Y of the metadata cache that matches the disk capacity A of the HDD according to the disk capacity A of the HDD.
[0012] A control unit, configured to control the HDD to use a metadata cache with a size of Y to cache metadata, and count the hit rate of the metadata in the metadata cache, perform performance detection on the HDD based on the hit rate, and output an anomaly indication if an anomaly is detected in the performance detection.
[0013] This embodiment provides an electronic device, which includes: a processor and a readable storage medium.
[0014] Wherein, the machine-readable storage medium is used to store computer instructions;
[0015] The processor is configured to execute the computer instructions to implement the steps in the above method.
[0016] It can be seen from the above technical solutions that in this embodiment, first, for each HDD to be managed in the distributed storage cluster, according to the storage unit size P on the HDD specified by the local file system configured for the HDD and the disk capacity A of the HDD, the size Y of the metadata cache that matches the disk capacity A of the HDD is dynamically determined, rather than directly using the default metadata cache size, realizing dynamic allocation of a local file system cache with a size adapted to the capacity of the HDD for the HDD.
[0017] Furthermore, in this embodiment, performance detection is performed on the HDD based on the hit rate of the metadata cache corresponding to the HDD, and the size of the metadata cache can be dynamically adjusted in a timely manner when the hit rate is insufficient, so as to achieve the goal of performance and resource balance. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.
[0019] Figure 1 It is a schematic flowchart provided by an embodiment of the present application;
[0020] Figure 2 It is a schematic flowchart for implementing step 101 provided by an embodiment of the present application;
[0021] Figure 3 It is a schematic diagram of an example provided by an embodiment of the present application;
[0022] Figure 4 Another schematic diagram provided for the embodiments of the present application;
[0023] Figure 5 The device structure diagram provided for the embodiments of the present application;
[0024] Figure 6 The structure diagram of the electronic device provided for the embodiments of the present application. Detailed implementation manners
[0025] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0026] The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. The singular forms "a", "the" and "said" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0027] To enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above objects, features, and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be further described in detail below with reference to the drawings.
[0028] In this embodiment, in the scenario of a distributed storage cluster, for HDD disks with different capacities, the size of the metadata cache corresponding to the HDD is dynamically determined based on the capacity of the HDD disk, so as to realize the linkage between the size of the metadata cache and the size of the HDD capacity, improve the hit rate of the metadata of the local file system in the metadata cache, reduce the HDD busy degree, and improve the overall performance of the distributed storage cluster.
[0029] To make the method provided by the embodiments of the present application clearer, the following is an example description with the help of the drawings:
[0030] See Figure 1 , Figure 1 which is the flowchart of the method provided for the embodiments of the present application. This method can be applied to an electronic device. The electronic device can be integrated into the local file system corresponding to the HDD or can be independently deployed, and this embodiment does not specifically limit it.
[0031] As Figure 1 shown, the process may include the following steps:
[0032] Step 101: For each HDD to be managed in the distributed storage cluster, determine the size of the metadata cache that matches the disk capacity of the HDD (denoted by A) according to the disk capacity of the HDD.
[0033] As an example, each HDD to be managed in the distributed storage cluster refers to an HDD in the distributed storage cluster with a disk capacity greater than a first set capacity, such as 8 TB (terabyte).
[0034] As an example, in this embodiment, according to the disk capacity A of the HDD, the size Y of the metadata cache corresponding to each HDD in the same distributed cluster with a disk capacity greater than or equal to the first set disk capacity, such as 8 TB (terabyte), can be limited to a first value, such as 2 G; while the size Y of the metadata cache corresponding to each HDD in the same distributed cluster with a disk capacity less than the first set disk capacity is set to be less than the first value. For example, taking the first set disk capacity of 8 TB as an example, the size Y of the metadata cache corresponding to each HDD with a disk capacity greater than or equal to 8 TB is 2 GB, and the size Y of the metadata cache corresponding to an HDD with a disk capacity less than 8 TB is set to be less than 2 GB. For example, for an HDD with a disk capacity of 2 TB, the size Y of the metadata cache is 512 MB, and for an HDD with a disk capacity of 4 TB, the size Y of the metadata cache is 1 GB.
[0035] As another example, when specifically implemented, the above Step 101 can also be executed according to the Figure 2 process shown, which will not be elaborated here for the time being.
[0036] Step 102: Control the HDD to use the metadata cache with size Y to cache metadata, and count the hit rate of the metadata in the metadata cache. Based on this hit rate, perform a performance detection on the HDD. If an anomaly is detected in the performance detection, output an anomaly indication.
[0037] Optionally, in this embodiment, the hit rate of the metadata cache will be counted in real time, and a performance detection will be performed on the HDD based on the hit rate to output an anomaly indication when an anomaly is detected. For example, if the hit rate is lower than a set threshold, such as 50%, output a key log, and the key log indicates the hit rate and / or potential information on the performance impact of the HDD storage; and,
[0038] If the disk capacity A of the HDD is less than a second set disk capacity, such as 16 TB, the second set disk capacity is greater than the first set disk capacity, and the hit rate is lower than the hit rate threshold corresponding to the disk capacity A of the HDD, such as 30%, output an alarm for insufficient performance; and,
[0039] If the disk capacity A of the HDD is greater than the second set disk capacity and the hit rate is lower than the hit rate threshold corresponding to the disk capacity A of the HDD, such as 20%, an alarm of insufficient performance is output.
[0040] Optionally, in this embodiment, the above set threshold is greater than or equal to the hit rate threshold corresponding to the disk capacity of any HDD. However, for any two HDDs with different disk capacities, the hit rate thresholds corresponding to the two HDDs are different. For example, for the first HDD and the second HDD to be managed in the distributed storage cluster (the first HDD and the second HDD are any two HDDs to be managed), if the disk capacity of the first HDD is greater than the disk capacity of the second HDD, and the disk capacity of the first HDD is greater than the second set disk capacity, and the disk capacity of the second HDD is less than the second set disk capacity, then the hit rate threshold corresponding to the disk capacity of the first HDD may be less than the hit rate threshold corresponding to the disk capacity of the second HDD. Similarly, if the disk capacity of the first HDD is less than the second set disk capacity, and the disk capacity of the second HDD is greater than or equal to the second set disk capacity, then the hit rate threshold corresponding to the disk capacity of the first HDD is greater than the hit rate threshold corresponding to the disk capacity of the second HDD.
[0041] In this embodiment, by detecting the performance of the HDD based on the hit rate, the size of the metadata cache can be dynamically adjusted in a timely manner when the hit rate is insufficient, so as to achieve the goal of performance and resource balance.
[0042] So far, the Figure 1 shown process is completed.
[0043] Through the Figure 1 shown process, in this embodiment, for each HDD to be managed in the distributed storage cluster, based on the storage unit size P on the HDD specified by the local file system configured for the HDD and the disk capacity A of the HDD, the size Y of the metadata cache matching the disk capacity A of the HDD is dynamically determined, rather than directly using the default metadata cache size, realizing the dynamic allocation of a local file system cache with a size adapted to the capacity of the HDD for the HDD.
[0044] Furthermore, in this embodiment, by detecting the performance of the HDD based on the hit rate of the metadata cache corresponding to the HDD, the size of the metadata cache can be dynamically adjusted in a timely manner when the hit rate is insufficient, so as to achieve the goal of performance and resource balance.
[0045] The following is an example description of step 101:
[0046] Refer to Figure 2 , Figure 2 which is the flowchart of the implementation of step 101 provided by the embodiment of the present application. As Figure 2 shown, the process may include the following steps:
[0047] Step 201: For each hard disk drive (HDD) to be managed in the distributed storage cluster, determine the upper limit of storage objects (denoted by X) for the HDD based on the storage unit size P on the HDD and the disk capacity A of the HDD; the storage space of any storage object on the HDD is P.
[0048] In this embodiment, multiple storage objects may be included on the HDD. Here, the storage object is specifically a storage space block of size P. As for the number of storage objects on the HDD (i.e., the above-mentioned X), it can be calculated based on the storage unit size P on the HDD and the disk capacity A of the HDD. For example, divide A by P to obtain the calculation result; based on the calculation result, determine the upper limit X of the storage objects on the HDD. The following formula exemplifies how to determine X: I1 * A / P. Here, I1 represents a set ratio, such as 95%. Optionally, P can take a value of 4 MB (megabytes).
[0049] Here, the above-mentioned P can be the size of a storage unit (such as a storage block or object) on the HDD specified by the local file system configured for the HDD.
[0050] Step 202: Based on the metadata size (denoted by L) specified by the local file system and the upper limit X of storage objects, determine the size Y (denoted by Y) of the metadata cache that matches the disk capacity A of the HDD.
[0051] Optionally, when specifically implementing this step 102, it may include: calculating the product of X and L, and determining the size Y of the metadata cache corresponding to the HDD based on this product. For example, Y can be determined according to the following formula: Y = X * L.
[0052] Optionally, the above-mentioned L can take a value of 1K, for example.
[0053] Thus far, the Figure 2 shown process is completed.
[0054] Through Figure 2 the shown process, it is finally realized how to determine the size Y of the metadata cache that matches the disk capacity A of the HDD based on the storage unit size P on the HDD specified by the local file system configured for the HDD and the disk capacity A of the HDD.
[0055] Through testing, it is found that in order to avoid the local file system occupying too much memory, for HDDs with a disk capacity greater than or equal to 8TB, this embodiment uniformly adopts a 2GB metadata cache. Figure 3This is illustrated. This enables the current mainstream 16TB HDD to achieve a metadata cache hit rate of over 50% (the disk capacity will be reserved because not all of the 16TB HDD will be allocated), which not only improves the metadata access efficiency of the local file system of the HDD but also controls the memory occupancy of the local file system. Table 1 gives an example:
[0056] HDD Disk Size Metadata Cache Size Estimation of Metadata Hit Rate in Metadata Cache 2TB 512MB 100% 4TB 1GB 100% 8TB 2GB 100% 16TB 2GB 50%+ 20TB 2GB 39%
[0057] Table 1
[0058] For HDDs with a disk capacity less than 8TB, this embodiment uniformly uses a 512MB metadata cache, Figure 4 which is illustrated.
[0059] It can be seen that this embodiment dynamically sets a matching metadata cache size for the HDD according to the different disk capacities of different HDDs to ensure the metadata cache hit rate of the local file system corresponding to the HDD. According to this embodiment, for HDDs with a capacity lower than 8TB, the metadata cache hit rate can reach 100%; for HDDs with an extremely large disk capacity, the metadata cache hit rate can be increased by about 40%, improving the access performance of the local file system of the HDD and at the same time controlling the size of the metadata cache occupied by the HDD, achieving the goal of performance and resource balance.
[0060] The following describes the device provided by the embodiment of the present application:
[0061] See Figure 5 , Figure 5 which is the device structure diagram provided by the embodiment of the present application. The device includes:
[0062] A determination unit, configured to determine, for each hard disk drive (HDD) to be managed in a distributed storage cluster, according to the disk capacity A of the HDD, a size Y of a metadata cache that matches the disk capacity A of the HDD;
[0063] A control unit, configured to control the HDD to use a metadata cache with a size of Y to cache metadata, and to count the hit rate of the metadata in the metadata cache, and perform performance detection on the HDD based on the hit rate to output an anomaly indication when an anomaly is detected.
[0064] Optionally, each hard disk drive (HDD) to be managed in the distributed storage cluster refers to: HDDs in the distributed storage cluster with a disk capacity greater than a first set capacity.
[0065] Optionally, the determining, according to the storage unit size P on the HDD specified by the local file system configured for the HDD and the disk capacity A of the HDD, a size Y of a metadata cache that matches the disk capacity A of the HDD includes:
[0066] Determine the upper limit X of the storage objects of the HDD based on the storage unit size P on the HDD specified by the local file system configured for the HDD and the disk capacity A of the HDD; the storage space of any storage object on the HDD is the P;
[0067] Based on the metadata size L specified by the local file system and the upper limit X of the storage objects, determine the size Y of the metadata cache that matches the disk capacity A of the HDD.
[0068] Optionally, the determining the upper limit X of the storage objects of the HDD based on the storage unit size P on the HDD specified by the local file system configured for the HDD and the disk capacity A of the HDD includes:
[0069] Perform a division operation on the A and the P;
[0070] Based on the operation result, determine the upper limit X of the storage objects of the HDD.
[0071] Optionally, the determining the size Y of the metadata cache that matches the disk capacity A of the HDD based on the metadata size L specified by the local file system and the upper limit X of the storage objects includes: determining the size Y of the metadata cache corresponding to the HDD based on the product of the X and the L.
[0072] Optionally, the performing performance detection on the HDD based on the hit rate to output an anomaly indication when an anomaly is detected includes: if the hit rate is lower than a set threshold, output a critical log, and the critical log indicates the hit rate and / or hidden danger information affecting the performance of the HDD storage; if the disk capacity A of the HDD is less than a second set disk capacity and the hit rate is lower than the hit rate threshold corresponding to the disk capacity A of the HDD, output an alarm of insufficient performance; if the disk capacity A of the HDD is greater than the second set disk capacity and the hit rate is lower than the hit rate threshold corresponding to the disk capacity A of the HDD, output an alarm of insufficient performance.
[0073] Optionally, among any two HDDs to be managed in the distributed storage cluster, if the disk capacity of the first HDD is greater than the disk capacity of the second HDD, and the disk capacity of the first HDD is greater than the second set disk capacity, and the disk capacity of the second HDD is less than the second set disk capacity, then the hit rate threshold corresponding to the disk capacity of the first HDD is less than the hit rate threshold corresponding to the disk capacity of the second HDD.
[0074] Optionally, in this embodiment, the size Y of the metadata cache corresponding to each HDD in the same distributed cluster with a disk capacity greater than or equal to the first set capacity is uniformly set to the first value;
[0075] For each HDD in the same distributed cluster whose disk capacity is less than the first set capacity, the size Y of the metadata cache corresponding thereto is less than the first value.
[0076] Thus far, the Figure 5 structural description of the illustrated device is completed.
[0077] Based on the same application concept as the above method, an embodiment of the present application further provides Figure 5 the hardware structure diagram of the illustrated device. As Figure 6 shown, the hardware structure may include: a processor and a readable storage medium.
[0078] Among them, a number of computer instructions are stored on the machine-readable storage medium, and the processor is used to execute the computer instructions to implement the method disclosed in the above examples of the present application.
[0079] Based on the same application concept as the above method, an embodiment of the present application further provides a machine-readable storage medium, on which a number of computer instructions are stored, and when the computer instructions are executed by a processor, the method disclosed in the above examples of the present application can be implemented.
[0080] Exemplarily, the above machine-readable storage medium may be any electronic, magnetic, optical or other physical storage device, which may contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as a hard disk drive), solid-state drive, any type of storage disk (such as an optical disk, DVD, etc.), or a similar storage medium, or a combination thereof.
[0081] The systems, devices, modules or units illustrated in the above embodiments may be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a game console, a tablet computer, a wearable device, or a combination of any several of these devices.
[0082] For the convenience of description, when describing the above devices, they are described separately as various units according to functions. Of course, when implementing the present application, the functions of each unit may be implemented in the same or multiple software and / or hardware.
[0083] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.
[0084] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. 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 realized 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, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for realizing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0085] Moreover, these computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means realizes the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0086] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, so that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable devices provide steps for realizing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0087] The above description is only for the embodiments of the present application and does not limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A disk management method applied in a distributed storage cluster, characterized in that: The method includes: For each mechanical hard disk HDD to be managed in the distributed storage cluster, according to the disk capacity A of the HDD, determine the size Y of the metadata cache that matches the disk capacity A of the HDD; Control the HDD to use a metadata cache of size Y to cache metadata, count the hit rate of metadata in the metadata cache, and perform performance detection on the HDD based on the hit rate; If an abnormality is detected in the performance test, an abnormality indication is output.
2. The method according to claim 1, characterized in that: The mechanical hard disks HDD to be managed in the distributed storage cluster include: HDDs in the distributed storage cluster whose disk capacity is greater than a first set disk capacity.
3. The method according to claim 1, characterized in that Determining the size Y of the metadata cache matching the disk capacity A of the HDD according to the disk capacity A of the HDD includes: According to the storage unit size P on the HDD and the disk capacity A of the HDD, determine the upper limit X of the storage objects of the HDD; the storage space of any storage object on the HDD is the P; Based on the metadata size L specified by the local file system and the storage object upper limit X, the size Y of the metadata cache matching the disk capacity A of the HDD is determined.
4. The method according to claim 3, characterized in that Determining the upper limit X of the storage objects of the HDD according to the storage unit size P on the HDD and the disk capacity A of the HDD includes: Divide the A by the P to obtain a calculation result; According to the calculation result, an upper limit X of storage objects of the HDD is determined.
5. The method according to claim 3, characterized in that: The determining, based on the metadata size L specified by the local file system and the storage object upper limit X, the size Y of the metadata cache matching the disk capacity A of the HDD comprises: Based on the product of X and L, a size Y of the metadata cache corresponding to the HDD is determined.
6. The method according to any one of claims 2 to 5, characterized in that: The performing performance detection on the HDD based on the hit rate to output an abnormality indication when an abnormality is detected comprises: If the hit rate is lower than a set threshold, a key log is output, wherein the key log indicates the hit rate and / or the hidden danger information of the HDD storage affecting performance; If the disk capacity A of the HDD is less than the second set disk capacity, and the hit rate is lower than the hit rate threshold corresponding to the disk capacity A of the HDD, an insufficient performance alarm is output; the second set disk capacity is greater than the first set disk capacity; If the disk capacity A of the HDD is greater than or equal to the second set disk capacity, and the hit rate is lower than the hit rate threshold corresponding to the disk capacity A of the HDD, then outputting an alarm of insufficient performance; The set threshold is greater than or equal to the hit rate threshold corresponding to the disk capacity A of the HDD.
7. The method according to claim 6, characterized in that For the first HDD and the second HDD to be managed in the distributed storage cluster, if the disk capacity of the first HDD is greater than or equal to the second set disk capacity, and the disk capacity of the second HDD is less than the second set disk capacity, then the hit rate threshold corresponding to the disk capacity of the first HDD is less than the hit rate threshold corresponding to the disk capacity of the second HDD; if the disk capacity of the first HDD is less than the second set disk capacity, and the disk capacity of the second HDD is greater than or equal to the second set disk capacity, then the hit rate threshold corresponding to the disk capacity of the first HDD is greater than the hit rate threshold corresponding to the disk capacity of the second HDD.
8. The method according to claim 1, characterized in that The step of determining, based on the disk capacity A of the HDD, a size Y of the metadata cache that matches the disk capacity A of the HDD comprises: Determine a size Y of the metadata cache corresponding to each HDD in the same distributed cluster whose disk capacity is greater than or equal to the first set capacity as a first value; It is determined that the size Y of the metadata cache corresponding to each HDD whose disk capacity is smaller than the first set capacity in the same distributed cluster is smaller than the first value.
9. A disk management device applied to a distributed storage cluster, characterized in that: The device includes: A determination unit, configured to determine, for each mechanical hard disk HDD to be managed in the distributed storage cluster, a size Y of a metadata cache matching the disk capacity A of the HDD according to the disk capacity A of the HDD; A control unit is used to control the HDD to use a metadata cache of size Y to cache metadata, and to count the hit rate of metadata in the metadata cache, and to perform performance detection on the HDD based on the hit rate; if an abnormality is detected in the performance detection, an abnormality indication is output.
10. An electronic device, characterized in that: The device includes: a processor and a readable storage medium. Wherein, the machine-readable storage medium is used to store computer instructions; The processor is configured to execute the computer instructions to implement the steps in any one of the methods of claims 1 to 8.