Hard disk performance test method, system and equipment and storage medium

By initializing the storage performance development tool and calling the multi-stream read and write interface to conduct hard disk performance testing, the problem of hard disk performance testing in the SPDK driver + multi-stream SSD environment is solved, and accurate evaluation of hard disk performance and performance bottleneck analysis are achieved.

CN118571302APending Publication Date: 2024-08-30ZHENGZHOU INSPUR DATA TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410774603.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

When using SPDK driver + multi-stream SSD, there is a lack of effective hard drive performance testing solutions, making it difficult to analyze hard drive performance and affecting performance and service life.

Method used

Provides a hard disk performance testing method that initializes the storage performance development tool, binds the hard disk to be tested, receives performance test parameters, calls the multi-stream read and write interface to perform read and write operations, and determines the performance indicators of the hard disk through the execution results, including per second Number of read and write task executions, bandwidth and average latency.

Benefits of technology

It realizes the convenient and effective determination of hard disk performance in the SPDK driver + multi-stream SSD environment, provides the convenience of performance bottleneck analysis, and improves the accuracy and efficiency of hard disk performance testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118571302A
    Figure CN118571302A
Patent Text Reader

Abstract

The invention discloses a hard disk performance test method, system and device and a storage medium, and is applied to the technical field of storage. Comprising the following steps: initializing a storage performance development tool; binding the storage performance development tool with the to-be-tested hard disk; receiving hard disk performance test parameters; based on the hard disk performance test parameters, calling a multi-stream read interface of the storage performance development tool to perform read operation on the to-be-tested hard disk, and calling a multi-stream write interface of the storage performance development tool to perform write operation on the to-be-tested hard disk; and obtaining respective execution results of each read operation and each write operation through the storage performance development tool, and determining performance indexes of the to-be-tested hard disk based on all the obtained execution results. By applying the scheme of the invention, the hard disk performance can be effectively determined on the occasion of using the SPDK + multi-stream SSD, and great convenience is provided for performance bottleneck analysis of the hard disk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technology, and in particular to a hard disk performance testing method, system, equipment and storage medium. Background Art

[0002] SPDK (Storage Performance Development Kit) is a storage high-performance framework designed for high-performance storage and mainly used to improve storage performance. Figure 1 , which is a schematic diagram of the main structure of the SPDK framework, including SPDK's upper-layer applications, SPDK's block devices, and SPDK's drivers.

[0003] Multi-stream SSD (Solid State Disk) can store hot and cold data separately on the disk and achieve physical isolation between different data. Multi-stream SSD is divided into several streams, and the streams are physically isolated. When writing data, the upper-layer software specifies different stream IDs according to the hotness or coldness of the data. This can achieve isolation between hot and cold data, thereby reducing data relocation during the SSD garbage collection process and ensuring SSD performance. The garbage collection described here refers to the fact that due to the characteristics of the storage particles of the SSD, the data cannot be overwritten at the original location when it is updated. It is necessary to find a new empty location to write, mark the original location as invalid, and then erase the invalid data when the garbage collection limit is reached. The erasure unit is 1 block. If there is still some valid data on the block, it is necessary to relocate this part of the valid data to other places first, and then erase the entire block. The relocation of this part of the valid data will seriously affect the performance of the SSD. For traditional SSDs, cold and hot data are stored in a mixed manner on the SSD, that is, there is hot and cold data on each block. In this way, cold data needs to be moved back and forth continuously during garbage collection, which affects the external output performance of the SSD and the service life of the SSD.

[0004] SPDK driver + multi-stream SSD may be a development direction in the future storage field. However, for this usage mode, there is currently no solution that can test the performance of multi-stream SSD, which makes it inconvenient to analyze the hard disk performance of multi-stream SSD in this case.

[0005] In summary, how to conveniently and effectively determine the hard disk performance when using SPDK driver + multi-stream SSD is a technical problem that technicians in this field urgently need to solve. Summary of the invention

[0006] The purpose of the present invention is to provide a hard disk performance testing method, system, device and storage medium, so as to conveniently and effectively determine the hard disk performance when using SPDK driver + multi-stream SSD.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0008] In a first aspect, the present invention provides a hard disk performance testing method, comprising:

[0009] Initialize the storage performance development tool;

[0010] Binding the storage performance development tool to the hard disk to be tested;

[0011] Receive hard disk performance test parameters;

[0012] Based on the hard disk performance test parameters, calling the multi-stream read interface of the storage performance development tool to perform a read operation on the hard disk to be tested, and calling the multi-stream write interface of the storage performance development tool to perform a write operation on the hard disk to be tested;

[0013] The storage performance development tool is used to obtain the execution results of each read operation and each write operation, and based on all the execution results obtained, the performance index of the hard disk to be tested is determined.

[0014] On the other hand, based on the hard disk performance test parameters, calling the multi-stream read interface of the storage performance development tool to perform a read operation on the hard disk to be tested, and calling the multi-stream write interface of the storage performance development tool to perform a write operation on the hard disk to be tested, including:

[0015] Applying for a first space from a memory, and setting a submission queue for placing read commands and write commands in the first space;

[0016] Applying for a second space from the memory, and setting a completion queue for placing the execution results in the second space;

[0017] Applying for a third space from the memory, and writing data in a specified format into the third space according to a preset writing rule;

[0018] Obtaining configuration information of the hard disk to be tested;

[0019] Wherein, the configuration information includes the size of each sector of the hard disk to be tested;

[0020] Based on the configuration information, randomly generate an access address;

[0021] Based on the hard disk performance test parameter and the access address, placing a read command and a write command into the submission queue;

[0022] For any read command in the submission queue, the read command is sent to the storage performance development tool, and based on the hard disk performance test parameters, a multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested;

[0023] For any write command in the submission queue, the write command is sent to the storage performance development tool, and based on the hard disk performance test parameters, the multi-stream write interface of the storage performance development tool is called to perform a write operation on the hard disk to be tested; wherein the write content of any write operation is derived from the data in the third space.

[0024] On the other hand, sending the read command to the storage performance development tool, and based on the hard disk performance test parameters, calling the multi-stream read interface of the storage performance development tool to perform a read operation on the hard disk to be tested, including:

[0025] The read command is sent to the storage performance development tool, and based on the access address, as well as the number of threads information, block size information, and address information of the hard disk to be tested in the hard disk performance test parameters, the multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested.

[0026] On the other hand, sending the write command to the storage performance development tool, and based on the hard disk performance test parameters, calling the multi-stream write interface of the storage performance development tool to perform a write operation on the hard disk to be tested, including:

[0027] The read command is sent to the storage performance development tool, and based on the access address, the number of threads of different streams in the hard disk performance test parameters, the block size information, the address information of the hard disk to be tested, the stream number information, and the total amount of write data of different streams, the multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested.

[0028] On the other hand, the execution results of each read operation and each write operation are obtained through the storage performance development tool, and the performance index of the hard disk to be tested is determined based on all the obtained execution results, including:

[0029] The storage performance development tool is used to obtain the execution results of each read operation and each write operation in a real-time polling manner, and the performance index of the hard disk to be tested is determined based on all the obtained execution results.

[0030] On the other hand, based on all the obtained execution results, the performance indicators of the hard disk to be tested are determined, including:

[0031] Based on all the obtained execution results, the number of read and write tasks executed per second, the bandwidth, and the average latency of the hard disk to be tested are determined.

[0032] On the other hand, it also includes:

[0033] For each read operation and write operation, when the read operation or write operation is completed, the correctness of the execution of the read operation or write operation is verified;

[0034] When the read operation or write operation fails to pass the verification, it is deemed that the read operation or write operation has failed.

[0035] When the read operation or write operation passes the verification, it is determined that the read operation or write operation is normally completed and the execution result of the read operation or write operation is obtained.

[0036] On the other hand, for each read operation and write operation, when the read operation or write operation is completed, the correctness of the execution of the read operation or write operation is verified, including:

[0037] For each read operation, when the read operation is completed, the storage performance development tool is used to obtain the read content of the read operation and compare the consistency with the pre-stored correct content to verify the correctness of the execution of the read operation;

[0038] For each write operation, when the write operation is completed, the storage performance development tool obtains the write content of the write operation and compares it with the pre-stored correct content for consistency, so as to verify the correctness of the execution of the write operation.

[0039] In a second aspect, the present invention provides a hard disk performance testing system, comprising:

[0040] An initialization module, used to initialize the storage performance development tool;

[0041] A binding module, used to bind the storage performance development tool to the hard disk to be tested;

[0042] A hard disk performance test parameter receiving module, used for receiving hard disk performance test parameters;

[0043] A read-write execution module, configured to call the multi-stream read interface of the storage performance development tool to perform a read operation on the hard disk to be tested, and to call the multi-stream write interface of the storage performance development tool to perform a write operation on the hard disk to be tested, based on the hard disk performance test parameters;

[0044] The performance indicator analysis and determination module is used to obtain the execution results of each read operation and each write operation through the storage performance development tool, and determine the performance indicator of the hard disk to be tested based on all the obtained execution results.

[0045] In a third aspect, the present invention provides a hard disk performance testing device, comprising:

[0046] Memory for storing computer programs;

[0047] The processor is used to execute the computer program to implement the steps of the hard disk performance testing method as described above.

[0048] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the hard disk performance testing method as described above are implemented.

[0049] By applying the technical solution provided by the embodiment of the present invention, it is possible to conveniently and effectively determine the hard disk performance when supporting the use of SPDK driver + multi-stream SSD. Specifically, after the storage performance development tool is initialized through the hard disk performance testing method provided by the present application, the storage performance development tool can be bound to the hard disk to be tested, and the hard disk to be tested is a multi-stream hard disk. Afterwards, based on the hard disk performance test parameters, the multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested, and the multi-stream write interface of the storage performance development tool is called to perform a write operation on the hard disk to be tested, thereby realizing the automatic execution of each read and write operation. Finally, through the storage performance development tool, the execution results of each read operation and each write operation can be obtained, so that the performance indicators of the hard disk to be tested can be determined based on all the execution results obtained.

[0050] It can be seen that when using SPDK driver + multi-stream SSD, the solution of the present application can effectively determine the hard disk performance, which greatly facilitates the performance bottleneck analysis of the hard disk. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 This is a schematic diagram of the main structure of the SPDK framework;

[0053] Figure 2A flowchart of a hard disk performance testing method provided by a specific embodiment of the present invention;

[0054] Figure 3 A functional schematic diagram of a stress testing tool in a specific implementation mode;

[0055] Figure 4 A structural schematic diagram of a hard disk performance testing system provided by a specific implementation mode of the present invention;

[0056] Figure 5 A structural schematic diagram of a hard disk performance testing device provided by a specific implementation mode of the present invention;

[0057] Figure 6 The present invention is a schematic diagram of the structure of a computer-readable storage medium. DETAILED DESCRIPTION

[0058] The core of the present invention is to provide a hard disk performance testing method, system, device and storage medium. When using SPDK driver + multi-stream SSD, the solution of the present application can effectively determine the hard disk performance, which provides great convenience for the performance bottleneck analysis of the hard disk.

[0059] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than 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 work are within the scope of protection of the present invention.

[0060] Please refer to Figure 2 , Figure 2 The following is a flowchart of a hard disk performance testing method provided in a specific embodiment of the present invention. The hard disk performance testing method may include the following steps:

[0061] Step S201: Initialize the storage performance development tool.

[0062] Specifically, a stress testing tool can be set up to implement each step of the solution of this application, for example Figure 3It is a functional diagram of a stress testing tool in a specific implementation method, which has initialization function, multi-stream read and write function, parameter parsing function and performance statistics function. The initialization function is mainly to initialize SPDK, and the parameter parsing function is mainly to parse the incoming hard disk performance test parameters, such as parsing out parameters such as the number of threads, block size, time, read and write IO type, PCIe address, stream id, and the total amount of data that each stream needs to write. The multi-stream read and write function is mainly used to generate write data and call the multi-stream read and write interface of SPDK for read and write operations. The performance statistics output function is mainly to output performance statistics based on indicators such as block size, time, and IO quantity.

[0063] When initializing the storage performance development tool, you can usually initialize the SPDK environment and the DPDK (Data Plane Development Kit) environment. The initialization of the SPDK environment depends on the DPDK, that is, when initializing the SPDK environment, the initialization of the DPDK environment is ultimately called.

[0064] Step S202: Bind the storage performance development tool to the hard disk to be tested.

[0065] By scanning the devices in the SPDK environment, the SPDK can be bound to the hard disk to be tested, specifically, the SPDK driver can be bound to the hard disk to be tested. The hard disk to be tested described in this application is a multi-stream hard disk, usually a multi-stream SSD. In addition, it can be understood that in actual applications, performance tests can be performed on multiple hard disks at the same time. This application takes any one of the hard disks as an example for explanation, that is, the hard disk to be tested described in this application can be any multi-stream SSD for performance testing.

[0066] Step S203: receiving hard disk performance test parameters.

[0067] The specific parameter items of the hard disk performance test parameters can be set and adjusted according to actual needs, but it is understandable that it is subsequently necessary to be able to implement read and write operations on the hard disk to be tested based on the hard disk performance test parameters.

[0068] Step S204: Based on the hard disk performance test parameters, the multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested, and the multi-stream write interface of the storage performance development tool is called to perform a write operation on the hard disk to be tested.

[0069] After obtaining the hard disk performance test parameters, it is necessary to perform read and write operations on the hard disk to be tested. Since the present application scheme is applied in the case of SPDK+multi-stream SSD, it is necessary to call the multi-stream read interface of SPDK to perform read operations on the hard disk to be tested, specifically, to call the multi-stream read interface driven by SPDK to perform read operations on the hard disk to be tested. Correspondingly, it is necessary to call the multi-stream write interface of the storage performance development tool to perform write operations on the hard disk to be tested, specifically, to call the multi-stream write interface driven by SPDK to perform read operations on the hard disk to be tested.

[0070] In a specific implementation of the present invention, step S204 may include:

[0071] Applying for a first space from a memory, and setting a submission queue for placing read commands and write commands in the first space;

[0072] Applying for a second space from the memory, and setting a completion queue for placing the execution results in the second space;

[0073] Applying for a third space from the memory, and writing data in a specified format into the third space according to a preset writing rule;

[0074] Get the configuration information of the hard disk to be tested;

[0075] The configuration information includes the size of each sector of the hard disk to be tested;

[0076] Based on the configuration information, the access address is randomly generated;

[0077] Based on the hard disk performance test parameters and the access address, read commands and write commands are placed in the submission queue;

[0078] For any read command in the submission queue, the read command is sent to the storage performance development tool, and based on the hard disk performance test parameters, the multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested;

[0079] For any write command in the submission queue, the write command is sent to the storage performance development tool, and based on the hard disk performance test parameters, the multi-stream write interface of the storage performance development tool is called to perform a write operation on the hard disk to be tested; wherein the write content of any write operation is derived from the data in the third space.

[0080] This implementation method takes into account that when calling the multi-stream read interface and write interface of the storage performance development tool to perform read and write operations on the hard disk to be tested, you can first apply to the memory for a submission queue for placing read commands and write commands, that is, when you need to send a command to the hard disk to be tested, the command will be placed in the submission queue. In addition, you can apply to the memory for a completion queue for placing the execution result, so that after the command is executed by the hard disk to be tested, the execution result of the command will be placed in the completion queue, and the stress testing tool can process the execution result in the completion queue based on SPDK, so as to finally determine the performance indicators of the hard disk to be tested. In actual applications, the submission queue and the completion queue can usually be circular queues. In this implementation method, the submission queue is specifically set in the first space of the memory, and the completion queue is specifically set in the second space of the memory.

[0081] Since data needs to be written to the hard disk to be tested, it is necessary to apply for a preset size of memory and write the data, that is, it is necessary to apply for a third space from the memory and write data of a specified format into the third space according to a preset writing rule. The specific content of the preset writing rule and the specified format can be set and adjusted according to actual needs. For example, in one case, a randomly generated string will be written into the applied memory and aligned in 4KB format to facilitate subsequent write operations.

[0082] The configuration information of the hard disk to be tested obtained must at least include the size of each sector of the hard disk to be tested, so that no error will be made when randomly generating an access address. Of course, in other specific implementations, the configuration information of the hard disk to be tested obtained may also include configuration information such as the namespace size of the hard disk to be tested, which can be set according to actual needs. In addition, in addition to generating an access address based on the configuration information, the configuration information of the hard disk to be tested will also be used in subsequent read and write operations.

[0083] This application uses a random method to generate the access address of the hard disk to be tested, that is, to randomly generate an offset to prepare for the subsequent reading and writing of data on the disk. According to the hard disk performance test parameters and the access address, read commands and write commands can be placed in the submission queue. After that, using the SPDK driver, the read commands and write commands in the submission queue can be sent to the hard disk to be tested for execution.

[0084] For any read command in the submission queue, after sending the read command to SPDK, it is necessary to call SPDK's multi-stream read interface based on the hard disk performance test parameters to perform a read operation on the hard disk to be tested. Correspondingly, for any write command in the submission queue, after sending the write command to SPDK, it is necessary to call SPDK's multi-stream write interface based on the hard disk performance test parameters to perform a read operation on the hard disk to be tested.

[0085] Further, in a specific implementation of the present invention, sending a read command to a storage performance development tool, and based on the hard disk performance test parameters, calling a multi-stream read interface of the storage performance development tool to perform a read operation on the hard disk to be tested may specifically include:

[0086] A read command is sent to the storage performance development tool, and based on the access address, as well as the number of threads, block size, and address information of the hard disk to be tested in the hard disk performance test parameters, the multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested.

[0087] This implementation method takes into account that when performing a read operation on the hard disk to be tested, the hard disk performance test parameters to be used include thread number information, block size information, and address information of the hard disk to be tested.

[0088] The address information of the hard disk to be tested is also the PCIe address information of the hard disk to be tested. This is because the SPDK driver is different from the kernel driver and is a user-mode driver, so the drive letter cannot be seen. Therefore, when the solution of this application is based on the SPDK driver to perform a read operation on the hard disk to be tested, the hard disk performance test parameters need to have the address information of the hard disk to be tested to implement the designation of the drive letter. The number of threads information refers to the number of threads set when performing a read operation on the hard disk to be tested. The block size information represents the total length of the data to be read. It can be understood that according to the access address and block size information, it can be determined which data content needs to be read from the hard disk to be tested. In addition, it can be understood that in actual applications, when performing a read operation on the hard disk to be tested, it may be necessary to read continuously until the test is completed. Therefore, during the test process, when a block is read, the access address can be randomly regenerated to read the next block.

[0089] In a specific implementation of the present invention, sending a write command to a storage performance development tool, and based on hard disk performance test parameters, calling a multi-stream write interface of the storage performance development tool to perform a write operation on the hard disk to be tested may specifically include:

[0090] A read command is sent to the storage performance development tool, and based on the access address, the number of threads of different streams in the hard disk performance test parameters, the block size information, the address information of the hard disk to be tested, the stream number information, and the total amount of write data of different streams, the multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested.

[0091] This implementation method takes into account that when performing a write operation on the hard disk to be tested, the hard disk performance test parameters to be used include thread number information, block size information, address information of the hard disk to be tested, stream number information, and total amount of write data for different streams.

[0092] The address information of the hard disk to be tested is also the PCIe address information of the hard disk to be tested. Similar to the above, the SPDK driver is different from the kernel driver and is a user-mode driver. Therefore, the drive letter cannot be seen. Therefore, when the solution of this application is based on the SPDK driver to write to the hard disk to be tested, the hard disk performance test parameters need to have the address information of the hard disk to be tested to specify the drive letter.

[0093] And when writing to the hard disk to be tested, the stream number information, i.e., stream id, is required. The read operation does not require the stream id because the multi-stream SSD can automatically find the corresponding data based on the access address, that is, for the read operation, the multi-stream SSD is just an ordinary SSD and can read data in the same way as an ordinary SSD. However, if it is a write operation, the stream id is required, and the multi-stream SSD will write data with different stream ids to different physical locations on the disk.

[0094] And during the write operation, since it is necessary to control the update frequency of the data written into different streams to simulate the different hot and cold degrees of different data in the real scene, the hard disk performance test parameters need to have the thread number information of different streams and the total amount of data written by different streams. For example, if the thread number of stream 1 is set to 1, and the thread number of stream 2 is set to 10, then the update frequency of stream 2 is 10 times that of stream 1, which means that the heat of the data corresponding to stream 2 is 10 times that of stream 1. For example, in a specific implementation, for the N streams of the hard disk to be tested, the number of threads set gradually increases in the order from stream 1 to stream N, and a set fixed value can be added each time to more effectively simulate the different hot and cold degrees of different data in the real scene. And for example, based on the relevant parameters of the hard disk to be tested, the number of threads of stream 1 can be set to the minimum number of threads of a single stream supported by the hard disk to be tested, and the number of threads of stream N can be set to the maximum number of threads of a single stream supported by the hard disk to be tested, which is conducive to realizing a more comprehensive test for the hard disk to be tested.

[0095] The block size information indicates the total length of data to be written starting from the access address, so it can be understood that the location where data needs to be written to the hard disk to be tested can be determined according to the randomly generated access address and block size information. It can also be understood that in actual applications, when writing to the hard disk to be tested, it may be necessary to write continuously until the entire test process is completed, so during the test process, when a block is written, for example, the access address can be randomly generated again to write the next block.

[0096] Step S205: Obtain the execution results of each read operation and each write operation through the storage performance development tool, and determine the performance index of the hard disk to be tested based on all the obtained execution results.

[0097] Based on the hard disk performance test parameters, after calling the multi-stream read and write interface of the storage performance development tool to perform read and write operations on the hard disk to be tested, the SPDK driver can be used to obtain the execution results of each read operation and each write operation. Then, all the execution results can be used for statistical analysis to obtain the performance indicators of the hard disk to be tested.

[0098] It is understandable that the specific content of the performance indicators of the hard disk to be tested can be diverse. For example, in one scenario, in order to ensure the comprehensiveness of the test results, the performance indicators of the hard disk to be tested are determined based on all the execution results obtained, which can specifically include: based on all the execution results obtained, determining the number of read and write tasks executed per second, bandwidth, and average latency of the hard disk to be tested, thereby comprehensively reflecting the performance of the hard disk to be tested.

[0099] In a specific implementation of the present invention, step S205 may specifically include:

[0100] The storage performance development tool is used to obtain the execution results of each read operation and each write operation in a real-time polling manner, and the performance indicators of the hard disk to be tested are determined based on all the obtained execution results.

[0101] The SPDK driver is different from the kernel driver. The SPDK driver needs to determine whether the command is completed by polling, while the kernel driver notifies the command completion by sending an interrupt message. Sending interrupts consumes more resources, so polling is also an advantage of the SPDK driver over the kernel driver.

[0102] Therefore, in the solution of the present application, the execution results of each read operation and each write operation are obtained through SPDK, specifically in a real-time polling manner.

[0103] Furthermore, in actual applications, after the hard disk performance test is completed, resources may be released, for example, the submission queue and completion queue applied for in the above implementation manner may be released back to the resource pool.

[0104] In a specific implementation of the present invention, before obtaining the execution results of each read operation and each write operation through the storage performance development tool, the method further includes:

[0105] For each read operation and write operation, when the read operation or write operation is completed, the correctness of the execution of the read operation or write operation is verified;

[0106] When the read operation or write operation fails to pass the verification, it is deemed that the read operation or write operation has failed.

[0107] When the read operation or write operation passes the verification, it is determined that the read operation or write operation is normally completed and the execution result of the read operation or write operation is obtained.

[0108] This implementation method takes into account that, when a hard disk performance test is usually performed, only the relevant read and write IOs are sent to the hard disk to be tested for execution, and the correctness of the execution result will not be verified. In order to further ensure the reliability of the test results, for each read operation and write operation, when the read operation or write operation is completed, it is necessary to verify the correctness of the execution of the read operation or write operation. When the read operation or write operation fails to pass the verification, it is deemed that the read operation or write operation has failed to execute. Accordingly, when the read operation or write operation passes the verification, it is determined that the read operation or write operation has been executed normally and the execution result of the read operation or write operation is obtained.

[0109] It can be seen that in this implementation mode, for each read operation and write operation, only when it passes the verification, will it be determined that the read operation or write operation has been executed normally and the execution result of the read operation or write operation is obtained. In other words, if a read operation or write operation is completed but fails to pass the verification, it is deemed that the read operation or write operation has failed.

[0110] In this implementation, since the correctness of the execution of the read operation and the write operation is also checked, it is beneficial to further ensure the accuracy of the performance test results. In practical applications, if there are too many failed read operations or write operations, an alarm can be issued so that staff can intervene to analyze and handle the problem.

[0111] There are many specific ways to verify the execution correctness. For example, in a specific embodiment of the present invention, for each read operation, when the read operation is completed, the read content of the read operation is obtained by a storage performance development tool and compared with the pre-stored correct content for consistency, so as to verify the execution correctness of the read operation;

[0112] For each write operation, when the write operation is completed, the storage performance development tool is used to obtain the write content of the write operation and compare it with the pre-stored correct content for consistency, so as to verify the correctness of the execution of the write operation.

[0113] In this implementation, when a write operation is completed, the stress testing tool can obtain the specific written content through the SPDK driver, and then compare it with the pre-stored correct content. If they are consistent, it means that the write operation is executed correctly, that is, the write operation has passed the verification. Similarly, for read operations, the stress testing tool can also perform correctness verification on the read content, that is, when a read operation is completed, the read content of the read operation can be obtained through the SPDK driver and compared with the pre-stored correct content for consistency, so as to verify the execution correctness of the read operation.

[0114] By applying the technical solution provided by the embodiment of the present invention, it is possible to conveniently and effectively determine the hard disk performance when supporting the use of SPDK driver + multi-stream SSD. Specifically, after the storage performance development tool is initialized through the hard disk performance testing method provided by the present application, the storage performance development tool can be bound to the hard disk to be tested, and the hard disk to be tested is a multi-stream hard disk. Afterwards, based on the hard disk performance test parameters, the multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested, and the multi-stream write interface of the storage performance development tool is called to perform a write operation on the hard disk to be tested, thereby realizing the automatic execution of each read and write operation. Finally, through the storage performance development tool, the execution results of each read operation and each write operation can be obtained, so that the performance indicators of the hard disk to be tested can be determined based on all the execution results obtained.

[0115] It can be seen that when using SPDK driver + multi-stream SSD, the solution of the present application can effectively determine the hard disk performance, which greatly facilitates the performance bottleneck analysis of the hard disk.

[0116] Corresponding to the above method embodiment, the embodiment of the present invention further provides a hard disk performance testing system, which can be referred to in correspondence with the above.

[0117] See also Figure 4 , is a structural diagram of a hard disk performance testing system of the present invention, comprising:

[0118] Initialization module 401, used to initialize the storage performance development tool;

[0119] A binding module 402 is used to bind the storage performance development tool to the hard disk to be tested;

[0120] The hard disk performance test parameter receiving module 403 is used to receive hard disk performance test parameters;

[0121] The read / write execution module 404 is used to call the multi-stream read interface of the storage performance development tool to perform a read operation on the hard disk to be tested based on the hard disk performance test parameters, and call the multi-stream write interface of the storage performance development tool to perform a write operation on the hard disk to be tested;

[0122] The performance index analysis and determination module 405 is used to obtain the execution results of each read operation and each write operation through the storage performance development tool, and determine the performance index of the hard disk to be tested based on all the obtained execution results.

[0123] In a specific implementation of the present invention, the read-write execution module 404 includes:

[0124] A queue application unit is used to apply for a first space from the memory and set a submission queue for placing read commands and write commands in the first space; apply for a second space from the memory and set a completion queue for placing execution results in the second space;

[0125] A memory application unit, used to apply for a third space from the memory, and write data in a specified format into the third space according to a preset writing rule;

[0126] A configuration information acquisition unit, used to acquire configuration information of the hard disk to be tested; wherein the configuration information includes the size of each sector of the hard disk to be tested;

[0127] An access address generation unit, used for randomly generating an access address based on configuration information;

[0128] A read and write command submission unit, used to place read commands and write commands into a submission queue based on hard disk performance test parameters and access addresses;

[0129] A read operation execution unit, for sending a read command in a submission queue to a storage performance development tool, and based on hard disk performance test parameters, calling a multi-stream read interface of the storage performance development tool to perform a read operation on the hard disk to be tested;

[0130] A write operation execution unit is used to send a write command to a storage performance development tool for any write command in a submission queue, and based on hard disk performance test parameters, call the multi-stream write interface of the storage performance development tool to perform a write operation on the hard disk to be tested; wherein the write content of any write operation is derived from the data in the third space.

[0131] In a specific implementation of the present invention, the read operation execution unit is specifically used to:

[0132] A read command is sent to the storage performance development tool, and based on the access address, as well as the number of threads, block size, and address information of the hard disk to be tested in the hard disk performance test parameters, the multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested.

[0133] In a specific implementation of the present invention, the write operation execution unit is specifically used to:

[0134] A read command is sent to the storage performance development tool, and based on the access address, the number of threads of different streams in the hard disk performance test parameters, the block size information, the address information of the hard disk to be tested, the stream number information, and the total amount of write data of different streams, the multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested.

[0135] In a specific implementation of the present invention, the performance indicator analysis and determination module 405 is specifically used to:

[0136] The storage performance development tool is used to obtain the execution results of each read operation and each write operation in a real-time polling manner, and the performance indicators of the hard disk to be tested are determined based on all the obtained execution results.

[0137] In a specific implementation of the present invention, the performance indicator analysis and determination module 405 determines the performance indicators of the hard disk to be tested based on all the obtained execution results, including:

[0138] Based on all the execution results obtained, the number of read and write tasks executed per second, the bandwidth, and the average latency of the hard disk to be tested are determined.

[0139] In a specific embodiment of the present invention, a verification module is also included, which is used to:

[0140] For each read operation and write operation, when the read operation or write operation is completed, the correctness of the execution of the read operation or write operation is verified;

[0141] When the read operation or write operation fails to pass the verification, it is deemed that the read operation or write operation has failed.

[0142] When the read operation or write operation passes the verification, it is determined that the read operation or write operation is normally completed and the execution result of the read operation or write operation is obtained.

[0143] In a specific implementation of the present invention, for each read operation and write operation, when the read operation or write operation is completed, the correctness of the execution of the read operation or write operation is verified, including:

[0144] For each read operation, when the read operation is completed, the read content of the read operation is obtained through the storage performance development tool and compared with the pre-stored correct content for consistency, so as to verify the correctness of the execution of the read operation;

[0145] For each write operation, when the write operation is completed, the storage performance development tool is used to obtain the write content of the write operation and compare it with the pre-stored correct content for consistency, so as to verify the correctness of the execution of the write operation.

[0146] Corresponding to the above method and system embodiments, the embodiments of the present invention further provide a hard disk performance testing device, a computer-readable storage medium, and a computer program product, which can be referred to in correspondence with the above.

[0147] See also Figure 5 As shown, the device may include:

[0148] Memory 501, used for storing computer programs;

[0149] The processor 502 is used to execute a computer program to implement the steps of the hard disk performance testing method in any of the above embodiments.

[0150] The computer program product includes a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the hard disk performance testing method in any of the above embodiments are implemented.

[0151] See also Figure 6 The computer readable storage medium 60 stores a computer program 61, and when the computer program 61 is executed by the processor, the steps of the hard disk performance test method in any of the above embodiments are implemented. The computer readable storage medium 60 mentioned here includes RAM (Random Access Memory), memory, ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), register, hard disk, removable disk, or any other form of storage medium known in the technical field.

[0152] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0153] Professionals may further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention, and the description of the above embodiments is only used to help understand the technical solution and its core idea of ​​the present invention. It should be pointed out that for ordinary technicians in the technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A hard disk performance testing method, characterized in that: include: Initialize the storage performance development tool; Binding the storage performance development tool to the hard disk to be tested; Receive hard disk performance test parameters; Based on the hard disk performance test parameters, calling the multi-stream read interface of the storage performance development tool to perform a read operation on the hard disk to be tested, and calling the multi-stream write interface of the storage performance development tool to perform a write operation on the hard disk to be tested; The storage performance development tool is used to obtain the execution results of each read operation and each write operation, and based on all the obtained execution results, the performance index of the hard disk to be tested is determined.

2. The hard disk performance testing method according to claim 1, characterized in that: Based on the hard disk performance test parameters, calling the multi-stream read interface of the storage performance development tool to perform a read operation on the hard disk to be tested, and calling the multi-stream write interface of the storage performance development tool to perform a write operation on the hard disk to be tested, including: Applying for a first space from a memory, and setting a submission queue for placing read commands and write commands in the first space; Applying for a second space from the memory, and setting a completion queue for placing the execution results in the second space; Applying for a third space from the memory, and writing data in a specified format into the third space according to a preset writing rule; Obtaining configuration information of the hard disk to be tested; Wherein, the configuration information includes the size of each sector of the hard disk to be tested; Based on the configuration information, randomly generate an access address; Based on the hard disk performance test parameter and the access address, placing a read command and a write command into the submission queue; For any read command in the submission queue, the read command is sent to the storage performance development tool, and based on the hard disk performance test parameters, a multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested; For any write command in the submission queue, the write command is sent to the storage performance development tool, and based on the hard disk performance test parameters, the multi-stream write interface of the storage performance development tool is called to perform a write operation on the hard disk to be tested; wherein the write content of any write operation is derived from the data in the third space.

3. The hard disk performance testing method according to claim 2, characterized in that: The read command is sent to the storage performance development tool, and based on the hard disk performance test parameter, a multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested, including: The read command is sent to the storage performance development tool, and based on the access address, the number of threads information, the block size information, and the address information of the hard disk to be tested in the hard disk performance test parameters, the multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested; Sending the write command to the storage performance development tool, and based on the hard disk performance test parameters, calling the multi-stream write interface of the storage performance development tool to perform a write operation on the hard disk to be tested, including: The read command is sent to the storage performance development tool, and based on the access address, the number of threads of different streams in the hard disk performance test parameters, the block size information, the address information of the hard disk to be tested, the stream number information, and the total amount of write data of different streams, the multi-stream read interface of the storage performance development tool is called to perform a read operation on the hard disk to be tested.

4. The hard disk performance testing method according to claim 1, characterized in that: The storage performance development tool is used to obtain the execution results of each read operation and each write operation, and based on all the obtained execution results, the performance index of the hard disk to be tested is determined, including: The storage performance development tool is used to obtain the execution results of each read operation and each write operation in a real-time polling manner, and the performance index of the hard disk to be tested is determined based on all the obtained execution results.

5. The hard disk performance testing method according to claim 1, characterized in that: Based on all the execution results obtained, the performance indicators of the hard disk to be tested are determined, including: Based on all the obtained execution results, the number of read and write tasks executed per second, the bandwidth, and the average latency of the hard disk to be tested are determined.

6. The hard disk performance testing method according to any one of claims 1 to 5, characterized in that: Before obtaining the execution results of each read operation and each write operation through the storage performance development tool, the method further includes: For each read operation and write operation, when the read operation or write operation is completed, the correctness of the execution of the read operation or write operation is verified; When the read operation or write operation fails to pass the verification, it is deemed that the read operation or write operation has failed. When the read operation or write operation passes the verification, it is determined that the read operation or write operation is normally completed and the execution result of the read operation or write operation is obtained.

7. The hard disk performance testing method according to claim 6, characterized in that: For each read operation and write operation, when the read operation or write operation is completed, the correctness of the execution of the read operation or write operation is verified, including: For each read operation, when the read operation is completed, the storage performance development tool is used to obtain the read content of the read operation and compare the consistency with the pre-stored correct content to verify the correctness of the execution of the read operation; For each write operation, when the write operation is completed, the storage performance development tool obtains the write content of the write operation and compares it with the pre-stored correct content for consistency, so as to verify the correctness of the execution of the write operation.

8. A hard disk performance testing system, characterized in that: include: An initialization module, used to initialize the storage performance development tool; A binding module, used to bind the storage performance development tool to the hard disk to be tested; A hard disk performance test parameter receiving module, used for receiving hard disk performance test parameters; A read-write execution module, configured to call the multi-stream read interface of the storage performance development tool to perform a read operation on the hard disk to be tested, and to call the multi-stream write interface of the storage performance development tool to perform a write operation on the hard disk to be tested, based on the hard disk performance test parameters; The performance indicator analysis and determination module is used to obtain the execution results of each read operation and each write operation through the storage performance development tool, and determine the performance indicator of the hard disk to be tested based on all the obtained execution results.

9. A hard disk performance testing device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the hard disk performance testing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the hard disk performance testing method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Test method and device of storage equipment, computer equipment, readable storage medium and program product

    CN119645746A

  • Test method, device, computer device, readable storage medium and program product of storage device

    CN119645746B