A hard disk testing method, device, equipment and readable storage medium
By obtaining the mapping information between hard drives and access nodes, adjusting the number of hard drives and allocating the same number of processors, the problem of poor performance of individual hard drives in hard drive testing was solved, thus achieving both accuracy and efficiency in hard drive testing.
Patent Information
- Application Number
- CN202411998438.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-12-30
AI Technical Summary
When testing hard drives on servers, some hard drives may perform poorly, which may not reflect the actual situation. Current technology makes it difficult to guarantee the accuracy of the tests.
By obtaining the mapping information between hard disks and access nodes, adjusting the number of hard disks allocated to access nodes, and allocating the same number of processors to the hard disks in access nodes, hard disk testing is performed based on a non-consistent memory access architecture.
This ensures that each hard drive is allocated the same number of processors, achieving resource balance, improving read and write efficiency, avoiding discrepancies between individual hard drive detections and actual performance, and guaranteeing test accuracy.
Smart Images

Figure CN119724304B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of storage, in particular to a hard disk testing method, device and equipment and readable storage medium. BACKGROUND
[0002] The speed of accessing the whole DRAM (Dynamic Random Access Memory, system memory) of a traditional computer is the same for all processors (CPU, Central Processing Unit), and the operating system performs memory allocation in the same way for all processors, that is, the memory management module only needs to find a free space for the applicant, and this memory architecture is called UMA (Unified Memory Architeture).
[0003] Modern computers, especially servers, have many processors and a large amount of memory, and these memories may be distributed in multiple different nodes, and the processors have different access speeds to different nodes. Accordingly, the memory management module needs to make each processor access the nearest memory node as much as possible to improve system performance, and this architecture is called NUMA (Non Uniform Memory Access Architecture).
[0004] However, when multiple SSDs (Solid State Disk, solid state disk) on the server are tested for performance, it is found that the performance of some individual disks is very poor, which does not match the actual situation.
[0005] In summary, how to effectively guarantee the accuracy of hard disk testing and other problems are technical problems that need to be solved by technical personnel in the field at present. SUMMARY
[0006] The purpose of the present application is to provide a hard disk testing method, device, equipment and readable storage medium, which improves the efficiency of read and write operations in the hard disk testing process, thereby guaranteeing the accuracy of hard disk testing.
[0007] To solve the above technical problems, the present application provides the following technical solutions:
[0008] A hard disk testing method comprises:
[0009] Obtaining mapping information of the hard disk and the access node; wherein the access node is a node in the NUMA architecture;
[0010] Using the mapping information, determining whether the number of hard disks allocated by the access node is balanced;
[0011] If no, the number of hard disks allocated to the access node is adjusted, and the mapping information of the hard disk and the access node is returned;
[0012] If yes, after the same number of processors is allocated to the hard disk in the access node, the hard disk is tested based on the non-coherent memory access architecture.
[0013] Preferably, the mapping information of the hard disk and the access node is obtained, comprising:
[0014] Obtaining the corresponding disk symbol of the hard disk to be tested;
[0015] Using the disk symbol, querying the hardware configuration information of the hard disk;
[0016] Determining the physical slot position of the hard disk from the hard disk configuration information;
[0017] Using the physical slot position to determine the access node to which the hard disk belongs to obtain the mapping information.
[0018] Preferably, using the disk symbol, using the physical slot position to determine the access node to which the hard disk belongs to obtain the mapping information, comprising:
[0019] Using the physical slot position to determine the access node to which the hard disk belongs to construct a mapping table;
[0020] Obtaining the mapping information from the mapping table.
[0021] Preferably, adjusting the number of hard disks allocated to the access node, comprising:
[0022] Obtaining the relationship information among the access node, the hard disk and the physical slot position of the hard disk;
[0023] Using the relationship information to adjust the number of hard disks allocated to the access node to balance the number of hard disks allocated to the access node.
[0024] Preferably, allocating the same number of processors to the hard disk in the access node, comprising:
[0025] Obtaining the number of processors corresponding to the access node and the number of hard disks;
[0026] Using the number of processors and the number of hard disks to allocate the same number of processors to the hard disk in the access node.
[0027] Preferably, using the number of processors and the number of hard disks to allocate the same number of processors to the hard disk in the access node, comprising:
[0028] Obtaining the specified number of processors allocated to the hard disk;
[0029] Calculating the ratio of the number of processors to the number of hard disks;
[0030] determining whether the hard disks can be assigned to the specified number of processors according to the ratio;
[0031] If yes, a list of available processors is obtained, and the specified number of processors is determined from the interval region;
[0032] The determined processors are assigned to the hard disks;
[0033] The assigned processors are deleted from the list of available processors;
[0034] If no, it is determined whether the number of processors is less than the number of hard disks;
[0035] If the number of processors is less than the number of hard disks, an exception troubleshooting process is triggered;
[0036] After the exception troubleshooting is completed, the mapping information of the hard disks and the access nodes is re-obtained;
[0037] If the number of processors is greater than or equal to the number of hard disks, a target number is determined according to the ratio;
[0038] A list of available processors is obtained, and the target number of processors is determined from the interval region;
[0039] The determined processors are assigned to the hard disks;
[0040] The assigned processors are deleted from the list of available processors.
[0041] Preferably, the hard disk testing based on the non-uniform memory access architecture comprises:
[0042] Binding read-write threads of an input-output testing tool to processors;
[0043] Performing performance testing on target hard disks in the non-uniform memory access architecture by using the input-output testing tool.
[0044] A hard disk testing apparatus comprises:
[0045] A mapping information obtaining module is configured to obtain mapping information of hard disks and access nodes; the access nodes are nodes in a non-uniform memory access architecture;
[0046] A node hardware balance determining module is configured to determine, by using the mapping information, whether the number of hard disks assigned to the access nodes is balanced;
[0047] A node hardware balance processing module is configured to, if the number of hard disks assigned to the access nodes is not balanced, adjust the number of hard disks assigned to the access nodes, and return to re-obtain the mapping information of the hard disks and the access nodes.
[0048] a hard disk test module, configured to perform hard disk test based on the non-uniform memory access architecture after assigning the same number of processors to the hard disks in the access nodes if the number of hard disks assigned to the access nodes is balanced.
[0049] An electronic device comprises:
[0050] a memory configured to store a computer program;
[0051] a processor configured to implement the steps of the hard disk test method when executing the computer program.
[0052] A readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of the hard disk test method.
[0053] A computer program product comprising a computer program / instruction, the computer program / instruction being executed by a processor to implement the steps of the hard disk test method.
[0054] The method provided by the embodiments of the present application is used to obtain mapping information of hard disks and access nodes; the access nodes are nodes in a non-uniform memory access architecture; the mapping information is used to determine whether the number of hard disks assigned to the access nodes is balanced; if not, the number of hard disks assigned to the access nodes is adjusted, and the mapping information of the hard disks and the access nodes is reobtained; if yes, the same number of processors is assigned to the hard disks in the access nodes, and then hard disk test is performed based on the non-uniform memory access architecture.
[0055] The non-uniform memory access architecture involves different access speeds of processors to hard disks. In the present application, the mapping relationship between the hard disks and the access nodes is obtained before hard disk test is performed. Then, it is determined based on the mapping relationship whether the number of hard disks assigned to the access nodes is balanced. If not, the number of hard disks assigned to the access nodes is adjusted to balance the number of hard disks assigned to the access nodes, and then the mapping information of the hard disks and the access nodes is reobtained. If yes, the same number of processors can be further assigned to the hard disks in the access nodes. In this way, it can be ensured that each hard disk can be assigned the same number of processors, so as to realize resource balancing. After the resource balancing is satisfied, hard disk test is performed in the non-uniform memory access architecture, which can ensure efficient processing of read and write operations at the processor level, thereby avoiding the situation that the detection of individual disks does not match the actual situation, and the accuracy of hard disk test can be ensured.
[0056] Correspondingly, the embodiments of the present application further provide a hard disk test device, an electronic device, a readable storage medium and a computer program product corresponding to the hard disk test method, which have the above technical effects, and details are not described herein. BRIEF DESCRIPTION OF DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description only represent some of the embodiments of the present application, and all other drawings obtained by those of ordinary skill in the art without creative effort based on these drawings are within the scope of the present application.
[0058] Figure 1 An implementation flowchart of a hard disk testing method in the embodiments of the present application;
[0059] Figure 2 A schematic diagram of a coherent memory access;
[0060] Figure 3 A schematic diagram of a non-coherent memory access;
[0061] Figure 4 A specific implementation schematic diagram of a hard disk testing method in the embodiments of the present application;
[0062] Figure 5 A comparison schematic diagram before and after resource equalization allocation in the embodiments of the present application;
[0063] Figure 6 A structural schematic diagram of a hard disk testing device in the embodiments of the present application;
[0064] Figure 7 A structural schematic diagram of an electronic device in the embodiments of the present application;
[0065] Figure 8 A specific structural schematic diagram of an electronic device in the embodiments of the present application. DETAILED DESCRIPTION
[0066] In order to make the person skilled in the art better understand the present application, the present application will be further described in detail below in combination with the drawings and specific embodiments. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of the present application.
[0067] When multiple SSDs on the server are tested for performance, it is found that the performance of individual disks will be poor, and it is verified that this is related to the uneven allocation of resources, but since the number of disks tested each time is not fixed, a fixed configuration cannot be used to perform core binding operations. Therefore, in the hard disk testing method provided in the present application, a dynamic core binding method is proposed, which automatically associates SSD devices with NUMA nodes, dynamically adjusts the binding of NUMA node CPU cores and SSDs, and evenly distributes and dynamically adjusts the CPU core list to ensure efficient processing of IO operations at the CPU level, thereby avoiding discrepancies between individual disk detection and reality, and ensuring the accuracy of hard disk testing. For details, please refer to Figure 1 , Figure 1 The flowchart of a hard disk testing method in an embodiment of the present application includes the following steps:
[0068] S101, obtain mapping information of hard disks and access nodes.
[0069] The access node is a node in a non-uniform memory access architecture.
[0070] First, briefly describe UMA and NUMA.
[0071] Please refer to Figure 2 , all processors (CPU, Central Processing Unit) access the entire DRAM (Dynamic Random Access Memory, dynamic random access memory, system memory) at the same speed, and the operating system performs memory allocation uniformly to all processors, and only needs to find a free space for the applicant by the memory management module. This memory architecture is a unified memory access (UMA, Unified Memory Architeture).
[0072] Please refer to Figure 3 , numerous processors and massive memory, which may be distributed on multiple different nodes, and processors have different access speeds to different nodes. Accordingly, the memory management module needs to try to make each processor access the nearest memory node to improve system performance. This architecture is called non-uniform memory access (NUMA, NonUniform Memory Access Architecture).
[0073] NUMA architecture essentially divides M CPUs into N groups, each group is connected by IMC BUS bus, each group is called a Node (i.e. node, referred to as access node in this paper), which is similar to a small UMA, and each Node has an integrated memory controller IMC (Intergrated Memory Controller). The CPUs in the group are connected by IMCBUS bus, and the Nodes are connected by QPI (direct link) bus, and the QPI delay is significantly higher than the IMCBUS.
[0074] From Figure 3 It can be seen that the Node in the NUMA architecture has a mapping relationship with the SSD, therefore, in order to realize the balanced allocation of resources, the mapping relationship between the hard disk and the access node can be obtained first.
[0075] In one specific embodiment of the present application, the mapping information between the hard disk and the access node is obtained, comprising:
[0076] Obtaining the corresponding disk symbol of the hard disk to be tested;
[0077] Using the disk symbol to query the hardware configuration information of the hard disk;
[0078] Determining the physical slot position of the hard disk from the hard disk configuration information;
[0079] Using the physical slot position to determine the access node to which the hard disk belongs to obtain the mapping information.
[0080] Among them, using the disk symbol, using the physical slot position to determine the access node to which the hard disk belongs to obtain the mapping information, comprising:
[0081] Using the physical slot position to determine the access node to which the hard disk belongs to construct a mapping table;
[0082] Obtaining the mapping information from the mapping table.
[0083] For the convenience of description, the above steps will be combined for description.
[0084] First, the test engineer records the identifiers (i.e. disk symbols) of the multiple SSD devices to be tested in detail.
[0085] Next, by traversing the SSD devices through the recorded disk symbols, and by querying the system's hardware configuration information, the physical slot positions (i.e., physical slot positions) connected to each SSD device are identified, and these SSDs are classified according to the NUMA nodes (i.e., access nodes) to which they belong. In this way, a detailed mapping table of NUMA nodes and SSD device identifiers can be constructed based on the classification. In this mapping table, multiple SSD device identifiers may be listed under each NUMA node, reflecting the distribution of SSD devices on different NUMA nodes. That is, based on the mapping table, the mapping relationship between the hard disks and the access nodes can be determined, i.e., which access node the hard disk is in, and which hard disks are in the access node.
[0086] S102, determine whether the number of hard disks allocated to the access node is balanced based on the mapping information.
[0087] Since the mapping information can indicate which hard disks are under the access node, the number of hard disks allocated to the access node can be determined based on the mapping information. For example, if there are 2 access nodes, access node 1 has N hard disks, and access node 2 has M hard disks, when N and M are not equal, it can be considered that the number of hard disks allocated to the access node is unbalanced.
[0088] After determining whether the number of hard disks allocated to the access node is balanced, subsequent processing operations can be performed according to the specific judgment result. Specifically, if the judgment result is no, step S103 can be performed, and if the judgment result is yes, step S104 can be performed.
[0089] S103, adjust the number of hard disks allocated to the access node, and return to reacquire the mapping information of the hard disks and the access nodes.
[0090] For example, before adjustment, access node 1 is allocated 3 hard disks, and access node 2 is allocated 5 hard disks. After adjustment, access node 1 is allocated 4 hard disks, and access node 2 is allocated 4 hard disks, or access node 1 is allocated 6 hard disks, and access node 2 is allocated 2 hard disks.
[0091] In order to ensure the efficiency of IO operation, in this embodiment, when it is found that the number of hard disks allocated to the access node is unbalanced, the number of hard disks allocated to the access node can be adjusted to balance the number of hard disks allocated to the access node. After adjusting the number of hard disks allocated to the access node, step S101 is returned to, so that in the case where the number of hard disks allocated to the access node is balanced, step S104 is continued to be executed.
[0092] Of course, in actual application, if the number of hard disks allocated to the access node is adjusted, the number of hard disks allocated to the access node is balanced after adjustment, and then step S101 can not be returned, but step S104 can be directly executed. For example, before adjustment, access node 1 is allocated with 3 hard disks, and access node 2 is allocated with 5 hard disks. When adjustment is performed, the ratio of the total number of hard disks to the number of access nodes is calculated, and the hard disks are allocated according to the ratio, that is, (3+5) / 2=4, 4 hard disks are allocated to access node 1, and 4 hard disks are allocated to access node 2. After re-allocation, the number of hard disks allocated to the two access nodes is balanced, and the operation of step S104 can be directly executed.
[0093] In one specific embodiment of the present application, the number of hard disks allocated to the access node is adjusted, comprising:
[0094] Obtaining the relationship information among the access node, the hard disk and the physical slot position of the hard disk;
[0095] Adjusting the number of hard disks allocated to the access node by using the relationship information, so as to balance the number of hard disks allocated to the access node.
[0096] For the convenience of description, the above steps will be described in combination.
[0097] In order to ensure the optimization of system performance, it is necessary to ensure that the number of SSDs allocated to each NUMA Node is equal. If it is found that the allocation is not uniform, the exact physical slot information of each SSD can be obtained by using the commands provided by the Linux system, such as lspci or lsblk, and a detailed relationship table of the NUMA Node, the SSD disk symbol and the physical slot can be generated according to the information. According to the relationship table, the engineer can adjust the physical connection of the SSD to ensure that the number of SSDs on each NUMA Node reaches balance.
[0098] S104, after the same number of processors are allocated to the hard disks in the access node, the hard disks are tested based on the non-uniform memory access architecture.
[0099] After it is determined that the number of SSDs on each NUMA Node reaches balance, the same number of processors can be allocated to the hard disks in the access node, so that the number of processors allocated to the hard disks is also balanced. In this way, it can be ensured that each hard disk can be allocated with the same number of processors, so as to realize resource balance. After the resource balance allocation is met, the hard disks are tested in the non-uniform memory access architecture, so as to ensure the efficient processing of read and write operations at the processor level, thereby avoiding the situation that the detection of individual disks does not match the actual situation, and the accuracy of the hard disk test can be ensured.
[0100] In one specific embodiment of the present application, the same number of processors is allocated to the hard disks in the access node, comprising:
[0101] Obtaining the number of processors and the number of hard disks corresponding to the access node;
[0102] Allocating the same number of processors to the hard disks in the access node by using the number of processors and the number of hard disks.
[0103] In one specific embodiment of the present application, the same number of processors is allocated to the hard disks in the access node, comprising:
[0104] Obtaining the specified number of processors allocated to the hard disks;
[0105] Calculating the ratio of the number of processors to the number of hard disks;
[0106] Determining whether the hard disks can be allocated to the specified number of processors by using the ratio;
[0107] If yes, obtaining the list of available processors and determining the specified number of processors from the interval area;
[0108] Allocating the determined processors to the hard disks;
[0109] Deleting the allocated processors from the list of available processors;
[0110] If no, determining whether the number of processors is less than the number of hard disks;
[0111] If the number of processors is less than the number of hard disks, triggering an exception troubleshooting process;
[0112] After completing the exception troubleshooting, re-obtaining the mapping information of the hard disks and the access node;
[0113] If the number of processors is greater than or equal to the number of hard disks, determining the target number by using the ratio;
[0114] Obtaining the list of available processors and determining the target number of processors from the interval area;
[0115] Allocating the determined processors to the hard disks;
[0116] Deleting the allocated processors from the list of available processors.
[0117] For ease of description, the above steps will be described in combination.
[0118] Please refer to Figure 4After completing the physical allocation balance of SSDs, the system can traverse each NUMA Node and compare the number of CPU cores on the NUMA Node with the number of SSDs allocated to it (B). Through this comparison, based on the resulting ratio, it can be determined whether each SSD can be allocated to the preset number of CPU cores. If a certain SSD cannot be allocated to sufficient CPU cores, the number of cores that each SSD can be allocated will be reset according to the actual number of CPU cores. When it is found that A is less than B, i.e., it is not possible to guarantee that each SSD is allocated at least one CPU core, an exception handling process will be triggered, which may prompt the replacement of CPUs or the detection of socket connections, etc.
[0119] Considering that the CPU cores on each NUMA Node are distributed in a continuous manner, for example, in two regions of 0-7 and 16-23, the actual number of CPU cores N allocated to each SSD is evenly distributed in these two regions. The specific operation is to select N / 2 CPU cores from each region, and after each selection, the allocated CPU cores are removed from the list of available CPU cores to prevent them from being allocated to other SSDs.
[0120] In this way, it is ultimately possible to ensure that each SSD is allocated the same number of CPU cores. Such a configuration provides a solid foundation for performance testing using fio or other IO testing tools. During testing, by binding specific SSDs to specific CPU cores, the consistency of resource allocation can be ensured, resulting in more accurate and reliable test results. This not only improves the efficiency of testing, but also provides an important reference for the performance optimization of the system.
[0121] In one specific embodiment of the present application, hard disk testing based on a non-uniform memory access architecture includes:
[0122] Binding read and write threads of an input and output testing tool to a processor;
[0123] Using an input and output testing tool to perform performance testing on a target hard disk in a non-uniform memory access architecture.
[0124] For ease of description, the above steps will be combined for description.
[0125] When performing SSD performance testing on a single disk on a NUMA architecture, the read and write threads of fio (an input and output testing tool) are bound to the CPU cores, so that the speed of the SSD will be closer to the theoretical data.
[0126] Wherein, the core binding process is as follows:
[0127] 1. Confirm which NUMA Node the hard disk physically belongs to;
[0128] 2. NUMA Node corresponds to which CPU core (i.e. CPU core, corresponding to processor), from which CPU core is selected;
[0129] 3. The selected CPU core is bound to the hard disk.
[0130] In a specific embodiment of the present application, the core binding process includes:
[0131] Determine the target hard disk from the to-be-tested hard disk record;
[0132] Determine the target access node to which the target hard disk physically belongs by using the mapping table;
[0133] Determine the processors corresponding to the target access node by using the relationship table, and select the target processor from the processors;
[0134] Bind the target processor to the target hard disk;
[0135] Correspondingly, after the binding is completed, the target hard disk is tested based on fio, and after the target hard disk test is completed, the target hard disk is deleted from the to-be-tested hard disk record;
[0136] Determine whether the to-be-tested hard disk record is empty;
[0137] If it is empty, the test is ended; if it is not empty, return to execute the step of determining the target hard disk from the to-be-tested hard disk record.
[0138] The method provided by the embodiment of the present application obtains the mapping information of the hard disk and the access node; wherein the access node is a node in the non-uniform memory access architecture; the mapping information is used to determine whether the number of hard disks allocated by the access node is balanced; if not, the number of hard disks allocated by the access node is adjusted, and the mapping information of the hard disk and the access node is reacquired; if yes, the same number of processors is allocated to the hard disk in the access node, and the hard disk is tested based on the non-uniform memory access architecture.
[0139] The non-uniform memory access architecture involves different access speeds of a processor to a hard disk. In the present application, before performing hard disk testing, a mapping relationship between the hard disk and an access node is first obtained. Then, based on the mapping relationship, it is determined whether the number of hard disks allocated to the access node is balanced. If not, the number of hard disks allocated to the access node is adjusted, and the mapping information between the hard disk and the access node is reobtained. If balanced, the same number of processors can be further allocated to the hard disks in the access node. In this way, it can be ensured that each hard disk can be allocated to the same number of processors, thereby achieving resource balancing. After satisfying the resource balanced allocation, the hard disk testing in the non-uniform memory access architecture can ensure efficient processing of read and write operations at the processor level, thereby avoiding the situation that the detection of individual disks does not match the actual situation, and the accuracy of the hard disk testing can be ensured.
[0140] For ease of understanding, the hard disk testing method will be described in detail below in combination with a specific application example.
[0141] Please refer to Figure 5 , assuming that the server NUMA node 1 (access node 1) and NUMA node 2 (access node 2) are two NUMA nodes (of course, in actual applications, there can be more, and in this example, for ease of description, two nodes are described), 8 SSDs, according to the physical slot position, it can be found that there are 5 SSDs in the NUMA node 1, and the other 3 SSDs in the NUMA node 2. After performing the resource adjustment in the disk testing method provided in the above embodiment, each NUMA node can have 4 SSDs. The CPU core allocated to each SSD is shown in the following table.
[0142]
[0143] It can be seen that the hard disk testing method provided by the present application has the following technical effects:
[0144] 1. Improve system performance: by ensuring that each NUMA Node is allocated to the same number of SSDs, the load of data processing is balanced, the data access across NUMA Nodes is reduced, the access delay is reduced, and the efficiency of data processing is improved.
[0145] 2. Optimize resource utilization: by balancing the number of SSDs on each NUMA Node, the CPU resources and storage resources are reasonably allocated, so that each resource can be fully utilized, and the waste of resources is avoided.
[0146] 3. Enhance the consistency of data processing: By ensuring that each SSD can be allocated the same number of CPU cores, it guarantees that each SSD has enough processing power when performing IO operations, thereby improving the consistency and stability of data processing.
[0147] 4. Simplify system management: The automated mapping and adjustment process simplifies the work of system administrators, reduces the need for manual configuration, and reduces the complexity and likelihood of management errors.
[0148] 5. Improve system stability: By reasonably allocating SSDs and CPU cores, it reduces the risk of performance bottlenecks and system crashes caused by uneven resource allocation, improving the overall stability of the system.
[0149] 6. Improve test accuracy: When performing IO performance tests, by binding specific CPU cores and SSDs, it can more accurately measure storage performance and avoid test result deviations caused by resource competition.
[0150] 7. Facilitate troubleshooting: By generating a NUMA Node and SSD drive letter and physical slot relationship table, administrators can quickly locate misconfigured or hardware failure locations, facilitating troubleshooting and repair.
[0151] That is, in this application, an innovative automated NUMA-Aware SSD allocation mechanism is introduced, which automatically associates SSD devices with NUMA nodes and ensures that each node allocates the same number of SSDs, reducing manual intervention and improving configuration efficiency and accuracy. At the same time, the SSD classification method based on physical slot as a hardware resource management strategy ensures data access locality, further optimizing performance.
[0152] Specifically, by creating a NUMA Node and SSD device identifier list mapping table, it provides engineers with a clear resource allocation view, facilitating quick identification and resolution of resource configuration issues.
[0153] In addition, the technical solution provided in this application also ensures the consistency of resource allocation and maintains the balance of system performance. Among them, the dynamic adjustment strategy of CPU core and SSD binding, by evenly distributing and dynamically adjusting the CPU core list, ensures efficient processing of IO operations at the CPU level.
[0154] Finally, the scheme contains a troubleshooting and exception handling mechanism, which investigates and handles abnormal situations where not every SSD can be allocated at least one CPU core, enhancing the robustness and reliability of the system.
[0155] Corresponding to the above method embodiments, the embodiments of the present application also provide a hard disk testing device. The hard disk testing device described below can be correspondingly referred to the hard disk testing method described above.
[0156] Referring to Figure 6 As shown in the figure, the device comprises the following modules:
[0157] The mapping information acquisition module 101 is configured to acquire mapping information of the hard disks and the access nodes; wherein the access nodes are nodes in the non-uniform memory access architecture.
[0158] The node hardware balance judgment module 102 is configured to determine, by using the mapping information, whether the number of hard disks allocated to the access nodes is balanced.
[0159] The node hardware balance processing module 103 is configured to, if the number of hard disks allocated to the access nodes is not balanced, adjust the number of hard disks allocated to the access nodes, and return to acquire the mapping information of the hard disks and the access nodes.
[0160] The hard disk testing module 104 is configured to, if the number of hard disks allocated to the access nodes is balanced, assign the same number of processors to the hard disks in the access nodes, and then perform hard disk testing based on the non-uniform memory access architecture.
[0161] The device provided by the embodiments of the present application is configured to acquire the mapping information of the hard disks and the access nodes; wherein the access nodes are nodes in the non-uniform memory access architecture; determine, by using the mapping information, whether the number of hard disks allocated to the access nodes is balanced; if not, adjust the number of hard disks allocated to the access nodes, and return to acquire the mapping information of the hard disks and the access nodes; and if yes, assign the same number of processors to the hard disks in the access nodes, and then perform hard disk testing based on the non-uniform memory access architecture.
[0162] The non-uniform memory access architecture involves different access speeds of the processors to the hard disks. In the present application, the mapping relationship between the hard disks and the access nodes is acquired before hard disk testing. Then, it is determined whether the number of hard disks allocated to the access nodes is balanced based on the mapping relationship. If not balanced, the number of hard disks allocated to the access nodes is adjusted, and the mapping information of the hard disks and the access nodes is re-acquired. If balanced, the same number of processors can be further assigned to the hard disks in the access nodes. In this way, it can be ensured that each hard disk can be assigned the same number of processors, so as to realize resource balance. After satisfying the resource balance allocation, the hard disk testing is performed in the non-uniform memory access architecture, which can ensure efficient processing of read and write operations at the processor level, thereby avoiding the situation that the detection of individual disks does not match the actual situation, and ensuring the accuracy of hard disk testing.
[0163] In an embodiment of the present application, the mapping information acquisition module is specifically configured to acquire a disk symbol corresponding to the hard disk to be tested.
[0164] The disk symbol is used to query the hardware configuration information of the hard disk.
[0165] The physical slot position of the hard disk is determined from the hardware configuration information of the hard disk.
[0166] The access node to which the hard disk belongs is determined by using the physical slot position, so as to obtain the mapping information.
[0167] In an embodiment of the present application, the mapping information acquisition module is specifically configured to determine the access node to which the hard disk belongs by using the physical slot position, and construct a mapping table.
[0168] The mapping information is acquired from the mapping table.
[0169] In an embodiment of the present application, the node hardware balancing processing module is specifically configured to acquire relationship information among the access node, the hard disk and the physical slot position of the hard disk.
[0170] The number of hard disks allocated to the access node is adjusted by using the relationship information, so as to balance the number of hard disks allocated to the access node.
[0171] In an embodiment of the present application, the processor allocation module is configured to acquire the number of processors corresponding to the access node and the number of hard disks.
[0172] The same number of processors is allocated to the hard disk in the access node by using the number of processors and the number of hard disks.
[0173] In an embodiment of the present application, the hard disk testing module is specifically configured to acquire a specified number of processors allocated to the hard disk.
[0174] The ratio of the number of processors to the number of hard disks is calculated.
[0175] Whether the hard disk can be allocated to the specified number of processors is determined by using the ratio.
[0176] If yes, a list of available processors is acquired, and the specified number of processors is determined from the interval area.
[0177] The determined processors are allocated to the hard disk.
[0178] The allocated processors are deleted from the list of available processors.
[0179] If no, whether the number of processors is less than the number of hard disks is determined.
[0180] If the number of processors is less than the number of hard disks, an abnormality troubleshooting process is triggered.
[0181] After the exception is checked, the mapping information of the hard disk and the access node is reacquired;
[0182] If the number of processors is greater than or equal to the number of hard disks, the target number is determined by the ratio;
[0183] The available processor list is acquired, and the target number of processors is determined from the interval area;
[0184] The determined processors are assigned to the hard disks;
[0185] The assigned processors are deleted from the available processor list.
[0186] In a specific embodiment of the present application, the hard disk test module is specifically used for binding the read-write threads of the input-output test tool to the processors;
[0187] The input-output test tool is used to perform performance testing on the target hard disk in the non-uniform memory access architecture.
[0188] Corresponding to the above method embodiments, the present application also provides an electronic device, and the electronic device described below can be mutually corresponding and referred to the hard disk test method described above.
[0189] Referring to Figure 7 As shown in the figure, the electronic device includes:
[0190] The memory 332 is used to store the computer program;
[0191] The processor 322 is used to execute the computer program to realize the steps of the hard disk test method of the above method embodiments.
[0192] Specifically, please refer to Figure 8 , Figure 8 A specific structural diagram of an electronic device provided by the present embodiment, which can have great differences due to different configurations or performances, can include one or more processors (central processing units, CPU) (for example, one or more processors) and a memory 332, and the memory 332 stores one or more computer programs 342 or data 344. Among them, the memory 332 can be temporary storage or persistent storage. The program stored in the memory 332 can include one or more modules (not shown in the figure), and each module can include a series of instruction operations in the data processing device. Further, the processor 322 can be configured to communicate with the memory 332 and execute a series of instruction operations in the memory 332 on the electronic device 301.
[0193] The electronic device 301 can also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341.
[0194] The steps in the hard disk testing method described above can be implemented by the structure of the electronic device.
[0195] That is, the following steps, including but not limited to, can be implemented in the electronic device:
[0196] Obtaining mapping information of hard disks and access nodes; wherein, the access nodes are nodes in a non-uniform memory access architecture;
[0197] Using the mapping information, determining whether the number of hard disks allocated to the access nodes is balanced;
[0198] If not, adjusting the number of hard disks allocated to the access nodes, and returning to obtain the mapping information of the hard disks and the access nodes;
[0199] If yes, after assigning the same number of processors to the hard disks in the access nodes, performing hard disk testing based on the non-uniform memory access architecture.
[0200] Obtaining mapping information of hard disks and access nodes; wherein, the access nodes are nodes in a non-uniform memory access architecture;
[0201] Obtaining the corresponding drive letter of the hard disk to be tested;
[0202] Using the drive letter to query the hardware configuration information of the hard disk;
[0203] Determining the physical slot position of the hard disk from the hard disk configuration information;
[0204] Using the physical slot position to determine the access node to which the hard disk belongs to obtain the mapping information.
[0205] Using the physical slot position to determine the access node to which the hard disk belongs to obtain the mapping information, includes:
[0206] Using the physical slot position to determine the access node to which the hard disk belongs to construct a mapping table;
[0207] Obtaining the mapping information from the mapping table.
[0208] Adjusting the number of hard disks allocated to the access nodes, includes:
[0209] Obtaining the relationship information among the access nodes, the hard disks, and the physical slot positions of the hard disks;
[0210] Adjust the number of hard disks allocated to the access node based on the relationship information, so as to balance the number of hard disks allocated to the access node.
[0211] wherein the same number of processors is allocated to the hard disks in the access node, comprising:
[0212] Obtain the number of processors and the number of hard disks corresponding to the access node;
[0213] Allocate the same number of processors to the hard disks in the access node based on the number of processors and the number of hard disks.
[0214] wherein the same number of processors is allocated to the hard disks in the access node based on the number of processors and the number of hard disks, comprising:
[0215] Obtain a specified number of processors allocated to the hard disks;
[0216] Calculate the ratio of the number of processors to the number of hard disks;
[0217] Determine whether the hard disks can be allocated to the specified number of processors based on the ratio;
[0218] If yes, obtain a list of available processors and determine the specified number of processors from the interval area;
[0219] Allocate the determined processors to the hard disks;
[0220] Delete the allocated processors from the list of available processors;
[0221] If no, determine whether the number of processors is less than the number of hard disks;
[0222] If the number of processors is less than the number of hard disks, trigger an exception troubleshooting process;
[0223] After completing the exception troubleshooting, re-obtain the mapping information of the hard disks and the access node;
[0224] If the number of processors is greater than or equal to the number of hard disks, determine a target number based on the ratio;
[0225] Obtain a list of available processors and determine the target number of processors from the interval area;
[0226] Allocate the determined processors to the hard disks;
[0227] Delete the allocated processors from the list of available processors.
[0228] wherein the hard disk testing based on the non-uniform memory access architecture comprises:
[0229] Binding read-write threads of an input-output test tool to a processor;
[0230] Performing performance test on a target hard disk in the non-uniform memory access architecture by using the input-output test tool.
[0231] Corresponding to the above method embodiment, the embodiment of the application further provides a readable storage medium, and the readable storage medium described below can be correspondingly referred to the hard disk test method described above.
[0232] A readable storage medium, the readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the hard disk test method of the above method embodiment.
[0233] The readable storage medium can be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various readable storage media that can store program codes.
[0234] The hard disk test method comprises:
[0235] Obtaining mapping information of the hard disk and the access node; wherein the access node is a node in the non-uniform memory access architecture;
[0236] Determining whether the number of hard disks allocated to the access node is balanced by using the mapping information;
[0237] If not, adjusting the number of hard disks allocated to the access node, and returning to obtain the mapping information of the hard disk and the access node again;
[0238] If yes, after allocating the same number of processors to the hard disks in the access node, performing hard disk test based on the non-uniform memory access architecture.
[0239] The obtaining of the mapping information of the hard disk and the access node comprises:
[0240] Obtaining a corresponding disk symbol of the hard disk to be tested;
[0241] Obtaining hardware configuration information of the hard disk by using the disk symbol;
[0242] Determining the physical slot position of the hard disk from the hardware configuration information of the hard disk;
[0243] Determining the access node to which the hard disk belongs by using the physical slot position to obtain the mapping information.
[0244] The determining of the access node to which the hard disk belongs by using the physical slot position to obtain the mapping information comprises:
[0245] determining the access node to which the hard disk belongs by using the physical slot position, and constructing a mapping table;
[0246] obtaining the mapping information from the mapping table.
[0247] wherein the number of hard disks allocated to the access node is adjusted, comprising:
[0248] obtaining relationship information among the access node, the hard disk and the physical slot position of the hard disk;
[0249] adjusting the number of hard disks allocated to the access node by using the relationship information, so as to balance the number of hard disks allocated to the access node.
[0250] wherein the same number of processors is allocated to the hard disk in the access node, comprising:
[0251] obtaining the number of processors and the number of hard disks corresponding to the access node;
[0252] allocating the same number of processors to the hard disk in the access node by using the number of processors and the number of hard disks.
[0253] wherein the same number of processors is allocated to the hard disk in the access node by using the number of processors and the number of hard disks, comprising:
[0254] obtaining a specified number of processors allocated to the hard disk;
[0255] calculating the ratio of the number of processors to the number of hard disks;
[0256] judging whether the hard disk can be allocated to the specified number of processors by using the ratio;
[0257] if yes, obtaining a list of available processors and determining the specified number of processors from the interval area;
[0258] allocating the determined processors to the hard disk;
[0259] deleting the allocated processors from the list of available processors;
[0260] if no, judging whether the number of processors is less than the number of hard disks;
[0261] if the number of processors is less than the number of hard disks, triggering an exception troubleshooting process;
[0262] after completing the exception troubleshooting, re-obtaining the mapping information of the hard disk and the access node;
[0263] if the number of processors is greater than or equal to the number of hard disks, determining a target number by using the ratio;
[0264] obtaining a list of available processors and determining the target number of processors from the interval region;
[0265] allocating the determined processors to the hard disks;
[0266] deleting the allocated processors from the list of available processors.
[0267] The hard disk testing based on the non-uniform memory access architecture comprises:
[0268] binding read-write threads of an input-output testing tool to the processors;
[0269] performing performance testing on the target hard disks in the non-uniform memory access architecture by using the input-output testing tool.
[0270] Corresponding to the method embodiments above, the embodiments of the present application further provide a computer program product, and the computer program product described below can be mutually referred to with the hard disk testing method described above.
[0271] A computer program product comprises computer programs / instructions, which, when executed by a processor, implement the steps of the hard disk testing method described above.
[0272] That is, the computer programs / instructions included in the computer program product, after execution, can implement the following steps:
[0273] obtaining mapping information of the hard disks and access nodes; wherein the access nodes are nodes in the non-uniform memory access architecture;
[0274] determining, by using the mapping information, whether the number of hard disks allocated to the access nodes is balanced;
[0275] if not, adjusting the number of hard disks allocated to the access nodes, and returning to obtain the mapping information of the hard disks and the access nodes again;
[0276] if yes, after allocating the same number of processors to the hard disks in the access nodes, performing hard disk testing based on the non-uniform memory access architecture.
[0277] The obtaining of the mapping information of the hard disks and the access nodes comprises:
[0278] obtaining a corresponding disk symbol of a hard disk to be tested;
[0279] querying hardware configuration information of the hard disk by using the disk symbol;
[0280] determining a physical slot position of the hard disk from the hardware configuration information of the hard disk;
[0281] determining the access node to which the hard disk belongs by using the physical slot position to obtain the mapping information.
[0282] wherein the mapping information is obtained by determining the access node to which the hard disk belongs by using the physical slot position and the disk symbol.
[0283] determining the access node to which the hard disk belongs by using the physical slot position, and constructing a mapping table.
[0284] obtaining the mapping information from the mapping table.
[0285] wherein the number of hard disks allocated to the access node is adjusted, comprising:
[0286] obtaining relationship information among the access node, the hard disk and the physical slot position of the hard disk;
[0287] adjusting the number of hard disks allocated to the access node by using the relationship information, so as to balance the number of hard disks allocated to the access node.
[0288] wherein the same number of processors is allocated to the hard disks in the access node, comprising:
[0289] obtaining the number of processors and the number of hard disks corresponding to the access node;
[0290] allocating the same number of processors to the hard disks in the access node by using the number of processors and the number of hard disks.
[0291] wherein the same number of processors is allocated to the hard disks in the access node by using the number of processors and the number of hard disks, comprising:
[0292] obtaining a specified number of processors allocated to the hard disk;
[0293] calculating the ratio of the number of processors to the number of hard disks;
[0294] judging whether the hard disk can be allocated to the specified number of processors by using the ratio;
[0295] if yes, obtaining a list of available processors and determining the specified number of processors from the interval area;
[0296] allocating the determined processors to the hard disk;
[0297] deleting the allocated processors from the list of available processors;
[0298] if no, judging whether the number of processors is less than the number of hard disks;
[0299] if the number of processors is less than the number of hard disks, triggering an exception troubleshooting process.
[0300] After the exception is checked, the mapping information between the hard disk and the access node is reacquired;
[0301] If the number of processors is greater than or equal to the number of hard disks, the target number is determined by using the ratio;
[0302] A list of available processors is acquired, and the target number of processors is determined from the interval area;
[0303] The determined processors are assigned to the hard disks;
[0304] The assigned processors are deleted from the list of available processors.
[0305] The hard disk testing based on the non-coherent memory access architecture comprises:
[0306] The read-write threads of the input-output testing tool are bound to the processors;
[0307] The target hard disk in the non-coherent memory access architecture is tested for performance by using the input-output testing tool.
[0308] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part.
[0309] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of each example are described in general in the above description. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0310] The steps of the method or algorithm described in combination with the embodiments disclosed herein can be directly implemented by hardware, software module executed by a processor, or combination of both. The software module can be placed in random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0311] Finally, it needs to be mentioned that, in this document, relationships such as first and second, and the like, are intended to distinguish one entity or action from another, and do not necessarily require or imply any actual such relationship or order between entities or actions. Also, the term including, or other variations thereof, is intended to cover the non-exclusive inclusion such that a process, method, article, or apparatus that comprises elements not expressly listed is still within the scope of such including process, method, article, or apparatus.
[0312] The principles and implementation manners of the present application are described herein by using specific examples, and the above example descriptions are only used to help understand the method and core idea of the present application; meanwhile, according to the idea of the present application, a person skilled in the art can make changes in specific implementation manners and application ranges; in conclusion, the content of the present description should not be understood as a limitation on the present application.
Claims
1. A hard disk testing method, characterized in that, include: Obtain the mapping information between the hard disk and the access node; where the access node is a node in the non-consistent memory access architecture; Using the mapping information, determine whether the number of hard disks allocated to each access node is equal; If not, adjust the number of hard drives allocated to the access node and return to obtain the mapping information between the hard drives and the access node again; If so, then after allocating the same number of processors to the hard disks in the access nodes, perform hard disk testing based on the non-consistent memory access architecture; This includes allocating the same number of processors to the hard drives in the access nodes, including: Get the number of processors and hard disks corresponding to the access node; Using the number of processors and the number of hard disks, allocate the same number of processors to the hard disks in the access node; The method of allocating the same number of processors to the hard drives in the access node, using the number of processors and the number of hard drives, includes: Get the specified number of processors to allocate to the hard drive; Calculate the ratio of the number of processors to the number of hard disks; The ratio is used to determine whether the hard disk can be allocated to the specified number of processors; If so, obtain the list of available processors and determine the specified number of processors from the interval region; Assign the determined processor to the hard drive; Remove the assigned processor from the list of available processors; If not, determine whether the number of processors is less than the number of hard disks; If the number of processors is less than the number of hard disks, an anomaly investigation process is triggered; After completing the anomaly investigation, re-obtain the mapping information between the hard drive and the access node; If the number of processors is greater than or equal to the number of hard disks, then the target number is determined using the ratio. Obtain a list of available processors and determine the target number of processors from the interval region; Assign the determined processor to the hard drive; Remove the assigned processor from the list of available processors.
2. The method according to claim 1, characterized in that, Obtain the mapping information between the hard disk and the access node, including: Obtain the drive letter of the hard drive to be tested; Use the drive letter to query the hard drive's hardware configuration information; The physical slot location of the hard drive is determined from the hard drive configuration information; The mapping information is obtained by determining the access node to which the hard drive belongs using the physical slot location.
3. The method according to claim 2, characterized in that, Using the drive letter and the physical slot location, the access node to which the hard drive belongs is determined to obtain the mapping information, including: The access node to which the hard drive belongs is determined by the physical slot location, and a mapping table is constructed; The mapping information is obtained from the mapping table.
4. The method according to claim 1, characterized in that, Adjustments were made to the number of hard drives allocated to the access nodes, including: Obtain the relationship information between the access node, the hard drive, and the physical slot location of the hard drive; The number of hard drives allocated to access nodes is adjusted using the aforementioned relationship information to ensure that each access node is allocated an equal number of hard drives.
5. The method according to any one of claims 1 to 4, characterized in that, Hard disk testing based on the aforementioned non-consistent memory access architecture includes: Bind the read and write threads of the input / output testing tool to the processor; The input / output testing tool is used to perform performance testing on the target hard disk in the non-consistent memory access architecture.
6. A hard disk testing device, characterized in that, include: The mapping information acquisition module is used to acquire the mapping information between the hard disk and the access node; where the access node is a node in the non-consistent memory access architecture. The node hardware balance judgment module is used to determine whether the number of hard disks allocated to each access node is equal using the mapping information; The node hardware balancing module is used to adjust the number of hard drives allocated to the access nodes if the number of hard drives allocated to the access nodes is not equal, and then return the mapping information between the hard drives and the access nodes to be obtained again. The hard disk testing module is used to perform hard disk testing based on the non-consistent memory access architecture after allocating the same number of processors to the hard disks in the access nodes if the number of hard disks allocated to the access nodes is equal. Allocating the same number of processors to the hard disks in the access nodes includes: obtaining the number of processors and the number of hard disks corresponding to the access nodes; and allocating the same number of processors to the hard disks in the access nodes using the number of processors and the number of hard disks. Allocating the same number of processors to the hard disks in the access nodes using the number of processors and the number of hard disks includes: obtaining a specified number of processors to allocate to the hard disks; calculating the ratio of the number of processors to the number of hard disks; and using the ratio to determine whether the hard disks can be allocated the specified number of processors. If the number of processors is less than the number of hard drives, then the anomaly investigation process is triggered. After the anomaly investigation is completed, the mapping information between the hard drives and the access nodes is re-acquired. If the number of processors is greater than or equal to the number of hard drives, then the target number is determined using the ratio. The available processor list is obtained, and the target number of processors is determined from the interval area. The determined processors are allocated to the hard drives. The allocated processors are deleted from the available processor list.
7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the hard disk testing method as described in any one of claims 1 to 5 when executing the computer program.
8. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the hard disk testing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Hard disk performance test method and device, equipment and storage medium
CN115202944A
Hard disk lighting method and device, computer equipment and storage medium
CN118708447A