NVME disk performance testing method, device, equipment and storage medium
By using preset steady-state judgment rules and core binding instructions on the domestic CPU platform, the problem of inaccurate NVME disk performance test data was solved, and stable performance testing and efficient data acquisition were achieved.
Patent Information
- Application Number
- CN202310265469.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-17
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2043-03-17
AI Technical Summary
Existing technologies make it difficult to effectively perform NVME disk performance testing on domestic CPU platforms, resulting in inaccurate test data.
The preset steady-state judgment rules are used to determine whether the NVME disk has reached a steady state, and the preset core binding instructions are used to determine the connection relationship between the target die and the CPU core, and the core binding operation is performed for testing.
It has achieved stable measurement of NVME disk performance on domestic CPU platforms, obtained better data that conforms to theoretical values, and improved testing efficiency.
Smart Images

Figure CN116343899B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing technology, and in particular to an NVME disk performance testing method, device, equipment and storage medium. Background Art
[0002] NVME (Non-Volatile Memory Express) is a specification for SSDs (Solid State Drives) that use PCI-E (Peripheral Component Interconnect Express) channels. Currently, many NVME SSDs (NVME drives) are available on the market. Their main advantages include lower latency, higher transfer performance, and lower power consumption. Because NVME drives undergo three phases—out-of-the-box, transition, and steady-state—performance testing often results in significant performance fluctuations and inaccurate performance data. The current mainstream testing method in the industry involves pre-warming the NVME drive before testing. This involves continuously writing data to the drive using sequential writes until the drive reaches steady-state, during which performance testing is performed. Some tests also require core binding, but the methods vary depending on the CPU (central processing unit) platform. Because the architecture of the domestic Haiguang CPU platform differs from that of Intel CPUs, using the previous core binding testing method will not yield good data.
[0003] In summary, how to perform NVME disk performance testing on domestic CPU platforms and obtain better data is a problem that needs to be solved. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide an NVME disk performance testing method, device, equipment, and storage medium that can perform NVME disk performance testing on domestic CPU platforms and obtain better data. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a method for testing NVME disk performance, which is applied to a CPU platform, wherein the CPU platform includes one or more CPUs, including:
[0006] Obtain an NVME disk to be tested, and preprocess the NVME disk to be tested;
[0007] Use the preset steady-state judgment rule to determine whether the NVME disk to be tested has reached a steady state after preprocessing;
[0008] When the pre-processed NVME disk to be tested reaches a steady state, determining a target die in a die set of one or more CPUs connected to the pre-processed NVME disk to be tested, so as to determine a CPU core occupied by the target die; wherein the die set includes at least one die, and each die includes multiple CPU cores;
[0009] The drive letters of all NVME disks to be tested under the target die are counted and written into the test script, and then the test script is bound to the CPU core using the preset core binding instruction to test the NVME disk to be tested.
[0010] Optionally, before obtaining the NVME disk to be tested and preprocessing the NVME disk to be tested, the method further includes:
[0011] The state of the IOMMU is set to be closed in the basic input and output system, and the NVME disk to be tested is formatted.
[0012] Optionally, obtaining an NVME disk to be tested and preprocessing the NVME disk to be tested includes:
[0013] Obtain an NVME disk to be tested, and perform a sequential write operation on the NVME disk to be tested using a fixed block size.
[0014] Optionally, the method of using a preset steady-state judgment rule to judge whether the pre-processed NVME disk to be tested reaches a steady state includes:
[0015] Obtaining several performance test results generated by the NVME disk to be tested during preprocessing;
[0016] If the difference between the maximum and minimum values in the performance test results is not greater than a first preset percentage of the data average value of all performance test results, and the difference between the maximum and minimum values on the linear regression line obtained according to the performance test results is not greater than a second preset percentage of the data average value, it is determined that the preprocessed NVME disk to be tested has reached a steady state.
[0017] Optionally, determining a target die in a die set of one or more CPUs connected to the preprocessed NVME disk to be tested to determine a CPU core occupied by the target die includes:
[0018] Read the BDF number corresponding to the NVME disk to be tested;
[0019] Comparing the BDF number with a preset BDF list to determine a target die in a die set of one or more CPUs connected to the pre-processed NVME disk to be tested;
[0020] The CPU core occupied by the target die is determined according to the target die.
[0021] Optionally, determining a target die in a die set of one or more CPUs connected to the preprocessed NVME disk to be tested to determine a CPU core occupied by the target die includes:
[0022] Determine a target die in a die set of one or more CPUs connected to the preprocessed NVME disk to be tested, determine the corresponding target CPU through the target die, and then read the NUMA architecture of the target CPU to determine the CPU core occupied by the target die.
[0023] Optionally, the method of binding the test script to the CPU core by using a preset core binding instruction to test the NVME disk to be tested includes:
[0024] The test script is bound to the CPU core using the numactl command or the taskset command to test the NVME disk to be tested.
[0025] In a second aspect, the present application discloses an NVME disk performance testing device, which is applied to a CPU platform, wherein the CPU platform includes one or more CPUs, including:
[0026] A preprocessing module is used to obtain the NVME disk to be tested and preprocess the NVME disk to be tested;
[0027] A steady-state judgment module is used to judge whether the pre-processed NVME disk to be tested has reached a steady state using a preset steady-state judgment rule;
[0028] a target die determination module, configured to determine, after the pre-processed NVME disk to be tested reaches a steady state, a target die in a die set of one or more CPUs connected to the pre-processed NVME disk to be tested, so as to determine the CPU core occupied by the target die; wherein the die set includes at least one die, and each die includes multiple CPU cores;
[0029] The NVME disk test module is used to count the drive letters of all NVME disks to be tested under the target die and write them into the test script, and then use the preset core binding instruction to bind the test script to the CPU core to test the NVME disk to be tested.
[0030] In a third aspect, the present application discloses an electronic device comprising a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the NVME disk performance testing method as described above.
[0031] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the NVME disk performance testing method as described above.
[0032] The present application provides an NVME disk performance testing method, applied to a CPU platform, wherein the CPU platform includes one or more CPUs, comprising: obtaining an NVME disk to be tested and preprocessing the NVME disk to be tested; determining whether the preprocessed NVME disk to be tested has reached a steady state using a preset steady-state judgment rule; when the preprocessed NVME disk to be tested has reached a steady state, determining a target die in a die set of one or more CPUs connected to the preprocessed NVME disk to be tested, to determine the CPU core occupied by the target die; wherein the die set includes at least one die, each die containing multiple CPU cores; counting the drive letters of all NVME disks to be tested under the target die and writing them into a test script; then, using a preset core binding instruction, binding the test script to the CPU core to test the NVME disk to be tested. It can be seen that since the architecture of domestic CPU platforms is different from the current mainstream Intel CPU architecture, they are not suitable for mainstream NVME disk performance testing. Therefore, the present invention proposes an NVME disk performance testing method for domestic CPUs, which first performs a preliminary judgment on whether the NVME disk has reached a steady state using a preset steady-state judgment rule. Secondly, a core binding operation method for domestic CPU architecture was proposed. In this way, not only can the NVME disk performance of the entire machine be stably measured based on the domestic CPU, but also better data that conforms to the theoretical value can be obtained. The process is simple, the benefits are good, and the work efficiency of the testing team is effectively improved.
[0033] In addition, the NVME disk performance testing device, equipment and storage medium provided in this application correspond to the above-mentioned NVME disk performance testing method and have the same effect as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0035] Figure 1 This is a flow chart of a NVME disk performance testing method disclosed in this application;
[0036] Figure 2 This is a schematic diagram of an NVME topology disclosed in this application;
[0037] Figure 3 This is a flow chart of a specific NVME disk performance testing method disclosed in this application;
[0038] Figure 4 This is a schematic diagram of an NVME disk performance test process disclosed in this application;
[0039] Figure 5 This is a schematic diagram of the structure of an NVME disk performance testing device disclosed in this application;
[0040] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0042] Currently, the mainstream testing method in the industry primarily involves preheating the NVME drive before testing. This involves continuously writing data to the drive using a sequential write method until the drive reaches a steady state, during which performance testing is performed. Some tests also require core binding, but the methods vary for different CPU (central processing unit) platforms. Because the architecture of the domestic Haiguang CPU platform differs from that of Intel CPUs, using the previous core binding testing method would not yield good data.
[0043] To this end, this application provides an NVME disk performance testing solution that can perform NVME disk performance testing on domestic CPU platforms and obtain better data.
[0044] The embodiment of the present invention discloses a method for testing the performance of an NVME disk. Figure 1 As shown, the method is applied to a CPU platform, wherein the CPU platform includes one or more CPUs, and includes:
[0045] Step S11: obtaining an NVME disk to be tested, and preprocessing the NVME disk to be tested.
[0046] In the embodiments of this application, the main focus is on domestic CPU platforms. It is understandable that there are one or more CPUs in the CPU platform, and different CPUs correspond to different NVME topologies. In the NVME connection topology, one or more NVME disks to be tested are obtained, and performance tests are performed on the multiple NVME disks to be tested.
[0047] It should be noted that the IOMMU should first be set to off in the Basic Input Output System (BIOS). It is understandable that the IOMMU is helpful for running virtualization. In the embodiment of the present application, when performing performance testing on the NVME disk, the actual physical address is directly accessed, and there is no need to indirectly access the physical address through the virtual address. Therefore, the IOMMU is changed to disable in the BIOS. Secondly, the NVME disk to be tested needs to be formatted before testing to avoid various problems such as system recognition failure or malfunction due to residual data or partitions when using NVME.
[0048] In the embodiment of the present application, the NVME disk to be tested is formatted and then pre-processed. That is, a fixed block size is used to perform sequential write operations on the NVME disk to be tested, and the same block size is written to the NVME disk to be tested each time to implement the process of pre-processing the NVME disk.
[0049] Step S12: using a preset steady-state judgment rule to determine whether the pre-processed NVME disk to be tested has reached a steady state.
[0050] In an embodiment of the present application, a fixed block size is used to write to a hard disk so that the NVME disk reaches a steady state. Furthermore, a method for determining whether the NVME disk has reached a steady state is proposed. Specifically, a predetermined steady-state determination rule is used to determine whether the NVME disk has reached a steady state. Specifically, several performance test results generated during the preprocessing of the NVME disk to be tested are obtained. If the difference between the maximum and minimum values in the performance test results is no greater than a first predetermined percentage of the data average of all performance test results, and the difference between the maximum and minimum values on a linear regression line derived from the performance test results is no greater than a second predetermined percentage of the data average, then the preprocessed NVME disk to be tested is determined to have reached a steady state.
[0051] It is understood that during the preprocessing process, the NVME disk under test will generate several performance test results, such as the bandwidth of the NVME disk under test and the number of read and write operations per second (IOPS), which can represent the test results of the NVME disk performance. These performance test results are then used to determine whether the NVME disk has reached a steady state using different conditions. For example, the first judgment condition is that the difference between the maximum and minimum values of the test result cannot be greater than 20% of the data average; the second judgment condition is that the difference between the maximum and minimum values of the linear regression line of the test result cannot be greater than 10% of the data average.
[0052] Step S13: When the pre-processed NVME disk to be tested reaches a steady state, a target die is determined in a die set of one or more CPUs connected to the pre-processed NVME disk to be tested to determine the CPU core occupied by the target die; wherein the die set includes at least one die, and each die includes multiple CPU cores.
[0053] In the embodiment of the present application, when the pre-processed NVME disk to be tested reaches a steady state, the test script is used to perform the core binding operation. Figure 2 The figure shows a schematic diagram of the NVME topology, illustrating the connection relationship of an NVME disk under test. When performing performance testing, it is necessary to clearly define the connection relationship between the NVME disk under test and the CPU die. In other words, the target die in the set of one or more CPU dies connected to the pre-processed NVME disk under test must be determined.
[0054] Specifically, the BDF number corresponding to the NVME disk to be tested is read; the BDF number is compared with the preset BDF list to determine the target die in the die set of one or more CPUs connected to the pre-processed NVME disk to be tested. It can be understood that for PCIE devices, each device has a unique BDF number (bus number, device number, function number). Since the NVME disk is connected to the PCIE SWITCH, it corresponds to the PCIE BDF number. The PCIE BDF number of the NVME disk is read and compared with the preset BDF number list of all devices to determine the connection topology of all NVME disks, that is, to determine which die of the CPU the NVME disk to be tested is connected to.
[0055] Furthermore, a corresponding target CPU is determined based on the target die, and the CPU cores occupied by the CPU die are determined by reading the NUMA architecture of the target CPU, that is, the CPU cores occupied by the target die are determined.
[0056] Step S14: Count the drive letters of all NVME disks to be tested under the target die and write them into the test script, and then use the preset core binding instruction to bind the test script to the CPU core to test the NVME disk to be tested.
[0057] In the embodiment of the present application, taking the domestic Haiguang CPU as an example, the Haiguang CPU is composed of 4 dies, and each die has 8 CPU cores. After determining which die the current NVME disk to be tested is connected to, the die is used as the target die, and then the drive letters of all the NVME disks to be tested under the target die are counted and written into the test script. It can be understood that when performing the performance test of all NVME disks, the above-mentioned core binding operation process should be executed at the same time, that is, if different dies appear, then different NVME drive letters correspond to different dies, so the drive letters of the NVME disks under different dies are counted and written into different test scripts respectively.
[0058] In an embodiment of the present application, the test script is bound to the CPU core using the numactl command or the taskset command to test the NVME disk to be tested. Both the numactl command and the taskset command can bind the test script to the CPU core of the corresponding die for execution.
[0059] The present application provides an NVME disk performance testing method, applied to a CPU platform, wherein the CPU platform includes one or more CPUs, comprising: obtaining an NVME disk to be tested and preprocessing the NVME disk to be tested; determining whether the preprocessed NVME disk to be tested has reached a steady state using a preset steady-state judgment rule; when the preprocessed NVME disk to be tested has reached a steady state, determining a target die in a die set of one or more CPUs connected to the preprocessed NVME disk to be tested, to determine the CPU core occupied by the target die; wherein the die set includes at least one die, each die containing multiple CPU cores; counting the drive letters of all NVME disks to be tested under the target die and writing them into a test script; then, using a preset core binding instruction, binding the test script to the CPU core to test the NVME disk to be tested. It can be seen that since the architecture of domestic CPU platforms is different from the current mainstream Intel CPU architecture, they are not suitable for mainstream NVME disk performance testing. Therefore, the present invention proposes an NVME disk performance testing method for domestic CPUs, which first performs a preliminary judgment on whether the NVME disk has reached a steady state using a preset steady-state judgment rule. Secondly, a core binding operation method for domestic CPU architecture was proposed. In this way, not only can the NVME disk performance of the entire machine be stably measured based on the domestic CPU, but also better data that conforms to the theoretical value can be obtained. The process is simple, the benefits are good, and the work efficiency of the testing team is effectively improved.
[0060] The present application discloses a specific NVME disk performance test method, see Figure 3 As shown, the method is applied to a CPU platform, wherein the CPU platform includes one or more CPUs, and includes:
[0061] Step S21: setting the state of the IOMMU to a closed state in the basic input / output system, and formatting the NVME disk to be tested.
[0062] In the embodiment of the present application, the IOMMU is changed to disable in the BIOS, and the NVME disk to be tested is formatted before the performance test is performed on the NVME disk to be tested.
[0063] Step S22: obtaining an NVME disk to be tested, and performing a sequential write operation on the NVME disk to be tested using a fixed block size.
[0064] In an embodiment of the present application, after determining the NVME disk to be tested that needs to be performance tested, the NVME disk is preprocessed, that is, a sequential write operation is performed on the NVME disk to be tested with a fixed block size, so as to further determine whether the NVME disk to be tested has reached a steady state through the preprocessing operation.
[0065] Step S23: obtaining several performance test results generated by the NVME disk to be tested during the preprocessing process.
[0066] In the embodiment of the present application, during the pre-processing process of the NVME disk to be tested, the NVME disk to be tested is made to reach a steady state, and it needs to be judged. Therefore, first, several performance test results generated by the NVME disk to be tested during the test process are obtained.
[0067] Step S24: If the difference between the maximum value and the minimum value in the performance test result is not greater than a first preset percentage of the data average value of all performance test results, and the difference between the maximum value and the minimum value on the linear regression line obtained according to the performance test result is not greater than a second preset percentage of the data average value, it is determined that the preprocessed NVME disk to be tested has reached a steady state.
[0068] In an embodiment of the present application, the method for determining whether the NVME disk to be tested has reached a steady state requires two judgment conditions. The first judgment condition is that the difference between the maximum and minimum values of the test result cannot be greater than a first preset percentage of the data average, such as the difference between the maximum and minimum values of the test result cannot be greater than 20% of the data average; the second judgment condition is that the difference between the maximum and minimum values of the linear regression line of the test result cannot be greater than a second preset percentage of the data average, such as the difference between the maximum and minimum values of the linear regression line of the test result cannot be greater than 10% of the data average.
[0069] Step S25: Read the BDF number corresponding to the NVME disk to be tested; compare the BDF number with the preset BDF list to determine the target die in the die set of one or more CPUs connected to the preprocessed NVME disk to be tested, so as to determine the corresponding target CPU through the target die, and then read the NUMA architecture of the target CPU to determine the CPU core occupied by the target die.
[0070] In the embodiments of this application, the connection relationship between the NVME disk to be tested and the CPU die must be clearly defined during performance testing. For PCIE devices, each device has a unique BDF number. By reading the BDF number of each NVME disk to be tested and comparing it with a preset list of BDF numbers for all devices, the connection relationship between the NVME disk to be tested and the CPU die can be determined. The CPU core corresponding to each die can then be determined by reading the CPU's NUMA architecture.
[0071] Step S26: Count the drive letters of all NVME disks to be tested under the target die and write them into the test script, and then use the preset core binding instruction to bind the test script to the CPU core to test the NVME disk to be tested.
[0072] In this embodiment, the drive letters of the NVME drives to be tested on the same die are collected, and different test scripts are written for the drive letters of the NVME drives to be tested on different dies. These test scripts are bound to their corresponding CPU cores through corresponding instructions and executed simultaneously. Furthermore, when testing all drives simultaneously, the above operations must be performed simultaneously on different dies.
[0073] like Figure 4 The figure shows a specific NVME disk performance test flow chart. First, modify the basic input and output system BIOS settings to turn off the IOMMU; then format the NVME disk and pre-process the NVME disk. During the pre-processing process, it is necessary to monitor and judge whether the NVME disk has reached a steady state. If the difference between the maximum and minimum values of several test results generated by the NVME disk during the pre-processing process is not greater than 20% of the data average, and the difference between the maximum and minimum values of the linear regression line of several test results generated by the NVME disk during the pre-processing process is not greater than 10% of the data average, then the current NVME disk is in a steady state. Furthermore, for domestic CPUs, the core binding operation is performed. First, confirm the connection relationship between the NVME disk and the CPU die, write the drive letters of the NVME disks under different dies into different test scripts, and then bind the test scripts to the CPU cores corresponding to the NVME disks. In this process, all core binding operations are performed simultaneously to implement performance testing of the NVME disk.
[0074] As can be seen, since the domestic CPU platform architecture is different from the current mainstream Intel CPU architecture, it is not suitable for mainstream NVME disk performance testing. Therefore, this paper proposes an NVME disk performance testing method for domestic CPUs. First, a preliminary judgment is made on whether the NVME disk has reached a steady state by using preset steady-state judgment rules. Secondly, a core binding operation method for domestic CPU architecture is proposed. In this way, not only can the NVME disk performance of the entire machine be stably measured based on the domestic CPU, but also good data that conforms to the theoretical value can be obtained. The process is simple, the benefits are good, and the work efficiency of the testing team is effectively improved.
[0075] Accordingly, the embodiment of the present application also discloses an NVME disk performance test device, which is applied to a CPU platform, wherein the CPU platform includes one or more CPUs, see Figure 5 As shown, the device includes:
[0076] The preprocessing module 11 is used to obtain the NVME disk to be tested and preprocess the NVME disk to be tested;
[0077] A steady-state judgment module 12 is configured to judge whether the pre-processed NVME disk to be tested has reached a steady state using a preset steady-state judgment rule;
[0078] A target die determination module 13 is configured to, after the pre-processed NVME disk to be tested reaches a steady state, determine a target die in a die set of one or more CPUs connected to the pre-processed NVME disk to be tested, so as to determine the CPU core occupied by the target die; wherein the die set includes at least one die, and each die includes multiple CPU cores;
[0079] The NVME disk test module 14 is used to count the drive letters of all NVME disks to be tested under the target die and write them into the test script, and then use the preset core binding instruction to bind the test script to the CPU core to test the NVME disk to be tested.
[0080] Among them, for more specific working processes of the above modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0081] Thus, the above-mentioned scheme of this embodiment is applied to a CPU platform including one or more CPUs, and includes: obtaining an NVME disk to be tested and preprocessing the NVME disk to be tested; using a preset steady-state judgment rule to determine whether the preprocessed NVME disk to be tested has reached a steady state; when the preprocessed NVME disk to be tested has reached a steady state, determining a target die in a die set of one or more CPUs connected to the preprocessed NVME disk to be tested, so as to determine the CPU core occupied by the target die; wherein the die set includes at least one die, each die containing multiple CPU cores; counting the drive letters of all NVME disks to be tested under the target die and writing them into a test script, and then using a preset core binding instruction to bind the test script to the CPU core to test the NVME disk to be tested. It can be seen that since the domestic CPU platform architecture is different from the current mainstream Intel CPU architecture and is not suitable for mainstream NVME disk performance testing, the present invention proposes an NVME disk performance testing method for domestic CPUs, which first performs a preliminary judgment on whether the NVME disk has reached a steady state using a preset steady-state judgment rule. Secondly, a core binding operation method for domestic CPU architecture was proposed. In this way, not only can the NVME disk performance of the entire machine be stably measured based on the domestic CPU, but also better data that conforms to the theoretical value can be obtained. The process is simple, the benefits are good, and the work efficiency of the testing team is effectively improved.
[0082] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the diagram cannot be considered as any limitation to the scope of use of the present application.
[0083] Figure 6 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the NVME disk performance testing method disclosed in any of the aforementioned embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be a server.
[0084] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0085] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, a magnetic disk, or an optical disk. The resources stored thereon may include an operating system 221, a computer program 222, and data 223. The data 223 may include various data. The storage method can be temporary storage or permanent storage.
[0086] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to implement the NVME disk performance testing method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to perform other specific tasks.
[0087] Furthermore, the embodiments of the present application also disclose a computer-readable storage medium, where the computer-readable storage medium includes a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a magnetic disk or an optical disk, or any other form of storage medium known in the technical field. When the computer program is executed by the processor, the aforementioned NVME disk performance test method is implemented. For the specific steps of the method, reference can be made to the corresponding content disclosed in the aforementioned embodiments, and no further details will be given here.
[0088] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0089] The steps of the NVME disk performance test or algorithm described in conjunction with the embodiments disclosed herein can be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0090] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0091] The above is a detailed introduction to the NVME disk performance testing method, device, equipment and storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for testing NVME disk performance, characterized in that: Applied to a CPU platform, the CPU platform includes one or more CPUs, including: Obtain an NVME disk to be tested, and preprocess the NVME disk to be tested; Use the preset steady-state judgment rule to determine whether the NVME disk to be tested has reached a steady state after preprocessing; When the pre-processed NVME disk to be tested reaches a steady state, determining a target die in a die set of one or more CPUs connected to the pre-processed NVME disk to be tested, so as to determine a CPU core occupied by the target die; wherein the die set includes at least one die, and each die includes multiple CPU cores; Count the drive letters of all NVME disks to be tested under the target die and write them into the test script, then use the preset core binding instruction to bind the test script to the CPU core to test the NVME disk to be tested; The method of using a preset steady-state judgment rule to judge whether the pre-processed NVME disk to be tested has reached a steady state includes: Obtaining several performance test results generated by the NVME disk to be tested during preprocessing; If the difference between the maximum and minimum values in the performance test results is not greater than a first preset percentage of the data average value of all performance test results, and the difference between the maximum and minimum values on the linear regression line obtained according to the performance test results is not greater than a second preset percentage of the data average value, it is determined that the preprocessed NVME disk to be tested has reached a steady state.
2. The NVME disk performance testing method according to claim 1, wherein Before obtaining the NVME disk to be tested and preprocessing the NVME disk to be tested, the method further includes: The state of the IOMMU is set to be closed in the basic input and output system, and the NVME disk to be tested is formatted.
3. The NVME disk performance testing method according to claim 1, wherein The step of obtaining the NVME disk to be tested and preprocessing the NVME disk to be tested includes: Obtain an NVME disk to be tested, and perform a sequential write operation on the NVME disk to be tested using a fixed block size.
4. The NVME disk performance testing method according to claim 1, wherein The step of determining a target die from a die set of one or more CPUs connected to the preprocessed NVME disk to be tested, to determine a CPU core occupied by the target die, includes: Read the BDF number corresponding to the NVME disk to be tested; Comparing the BDF number with a preset BDF list to determine a target die in a die set of one or more CPUs connected to the pre-processed NVME disk to be tested; The CPU core occupied by the target die is determined according to the target die.
5. The NVME disk performance testing method according to claim 1, wherein The step of determining a target die from a die set of one or more CPUs connected to the preprocessed NVME disk to be tested, to determine a CPU core occupied by the target die, includes: Determine a target die in a die set of one or more CPUs connected to the preprocessed NVME disk to be tested, determine the corresponding target CPU through the target die, and then read the NUMA architecture of the target CPU to determine the CPU core occupied by the target die.
6. The NVME disk performance testing method according to any one of claims 1 to 5, characterized in that: The method of binding the test script to the CPU core by using a preset core binding instruction to test the NVME disk to be tested includes: The test script is bound to the CPU core using the numactl command or the taskset command to test the NVME disk to be tested.
7. An NVME disk performance testing device, characterized in that: Applied to a CPU platform, the CPU platform includes one or more CPUs, including: A preprocessing module is used to obtain the NVME disk to be tested and preprocess the NVME disk to be tested; A steady-state judgment module is used to judge whether the pre-processed NVME disk to be tested has reached a steady state using a preset steady-state judgment rule; a target die determination module, configured to determine, after the pre-processed NVME disk to be tested reaches a steady state, a target die in a die set of one or more CPUs connected to the pre-processed NVME disk to be tested, so as to determine the CPU core occupied by the target die; wherein the die set includes at least one die, and each die includes multiple CPU cores; An NVME disk test module is used to count the drive letters of all NVME disks to be tested under the target die and write them into a test script, and then use a preset core binding instruction to bind the test script to the CPU core to test the NVME disk to be tested; The steady-state judgment module is specifically used to: Obtaining several performance test results generated by the NVME disk to be tested during preprocessing; If the difference between the maximum and minimum values in the performance test results is not greater than a first preset percentage of the data average value of all performance test results, and the difference between the maximum and minimum values on the linear regression line obtained according to the performance test results is not greater than a second preset percentage of the data average value, it is determined that the preprocessed NVME disk to be tested has reached a steady state.
8. An electronic device, characterized in that: The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the NVME disk performance testing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that Used to store computer programs; wherein when the computer program is executed by the processor, the NVME disk performance testing method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method, device and equipment for testing nvme ssd hard disk delay
CN109215721A
Hard disk performance test method, central control machine and test machine
CN115527603A