A method, apparatus and device for testing NVMe events
Patent Information
- Application Number
- CN202211337904.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2042-10-28
AI Technical Summary
[0003]现有的NVMe事件的测试方法通常是针对单一事件类型,通过下发指令确认事件功能是否正常,由于影响事件功能的因素、事件类型、盘体后台动作间的影响错综复杂,单一的测试方法,无法保证NVMe事件在NVMe硬盘极限压力场景下是否正常
在本申请实施例中,使NVMe硬盘在压力测试环境下运行,为每一种NVMe事件类型设计一种测试方法,并根据每个NVMe事件对应的测试方法,在压力测试环境对所有NVMe事件的功能进行测试;通过在压力测试环境下进行测试,克服了传统测试方案没有覆盖到场景的风险,进而保证了NVMe事件在NVMe硬盘极限压力场景下也能正常执行,且根据NVMe事件的类型来采用不同的方法进行测试,保证了每个NVMe事件测试的准确性;在测试完毕后根据Fio性能数据与NVMe事件测试结果,对NVMe硬盘的性能进行分析,重新识别出在压力测试环境下NVMe事件运行过程中对NVMe硬盘本身的相关影响。
Smart Images

Figure CN115579047B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of NVMe hard drive testing technology, and in particular to an NVMe event testing method, apparatus and device. Background Technology
[0002] NVMe (Non-Volatile Memory Express) is a specification for SSDs that use PCI-E interfaces. The main advantages of NVMe drives are lower latency, higher transfer performance, and lower power consumption. NVMe events are used to notify the host system of error status and operational status information (status, error, health information) when a corresponding event occurs. For the NVMe controller to accurately respond to asynchronous events, the host system needs to submit one or more event request commands to the NVMe controller. The controller then assigns an event to the host system by completing the event request commands.
[0003] Existing NVMe event testing methods typically target a single event type, issuing commands to confirm whether the event function is normal. However, due to the complex interplay between factors affecting event function, event types, and background disk actions, a single testing method cannot guarantee whether NVMe events function normally under extreme stress scenarios for NVMe hard drives. Summary of the Invention
[0004] In view of the above problems, embodiments of this application provide an NVMe event testing method, apparatus, and device to overcome or at least partially solve the above problems.
[0005] A first aspect of this application discloses an NVMe event testing method, the method comprising: Record Fio performance data during operation in an NVMe hard drive stress test environment; Determine the test method corresponding to each NVMe event type, and test all NVMe events according to the corresponding test method; The performance of the NVMe hard drive is analyzed based on the Fio performance data and the test results of all NVMe events.
[0006] Optionally, the method further includes: The test environment for the NVMe hard drive was deployed, and the NVMe hard drive was divided into a data verification partition and a Fio stress test partition; The operating parameters of the NVMe hard drive are sent out by Fio to enable the NVMe hard drive to run under stress testing conditions.
[0007] Optionally, the deployment of the test environment for the NVMe hard drive includes dividing the NVMe hard drive into a data verification partition and a Fio stress test partition, including: Adjust the capacity of the NVMe hard drive to the nominal capacity; Sector setting is performed on the NVMe hard drive with the nominal capacity, and the memory of the NVMe hard drive after sector setting is divided into a data verification partition and a Fio stress test partition. Data is written to the data verification partition and a verification code is generated for use in verifying the accuracy of the data after the test.
[0008] Optionally, the step of sending the operating parameters of the NVMe hard drive through Fio to enable the NVMe hard drive to operate under a stress test environment includes: Fio sends random mixed read / write parameters to the NVMe hard drive, wherein the proportion of read data bandwidth in the random mixed read / write parameters is less than the proportion of write data bandwidth.
[0009] Optionally, the test method for determining the test type corresponding to each NVMe event includes: To disable the NVMe event function, create a simulated disable event and validate the simulated disable event; The function of reporting NVMe events involves creating a simulated event and validating the simulated event. For the NVMe event clearing Request function, create a simulated clearing Request event and validate the simulated clearing Request event.
[0010] Optionally, testing all NVMe events according to the corresponding test method includes: Iterate through all NVMe events, create a corresponding simulated NVMe event for each NVMe event, execute the simulated NVMe event, and verify the functionality of the simulated NVMe event.
[0011] Optionally, the NVMe event testing process also includes: Monitor various system metrics, including at least: CQ monitoring, log monitoring, Reserved monitoring, and disk consistency monitoring.
[0012] Optionally, the performance of the NVMe hard drive is analyzed based on the performance data and the test results of all NVMe events, including: The data pre-written to the NVMe hard drive is verified to check whether the test process has damaged the pre-written data; Based on the NVMe hard drive's log files, the consistency of the drive is analyzed to assess the impact of the testing process on the NVMe hard drive itself. The Fio performance data is used to perform spec comparison analysis to determine the operating performance of the NVMe hard drive and whether the stress test environment is stable. The compatibility of the NVMe hard drive with the host system is analyzed using CQ monitoring, Reserved monitoring, and system logs.
[0013] A second aspect of this application discloses an NVMe event testing apparatus, the apparatus comprising: The performance logging module is used to record Fio performance data during operation in an NVMe hard drive stress test environment; The event testing module is used to determine the test method corresponding to each NVMe event type, and to test all NVMe events according to the corresponding test method; The performance analysis module is used to analyze the performance of the NVMe hard drive based on the Fio performance data and the test results of all NVMe events.
[0014] A third aspect of this application discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executed, implements the NVMe event testing method as described in the first aspect of this application.
[0015] The embodiments of this application have the following advantages: In this embodiment, the NVMe hard drive is run under a stress test environment. A test method is designed for each NVMe event type, and the functionality of all NVMe events is tested in the stress test environment according to the test method corresponding to each NVMe event. By conducting tests in a stress test environment, the risk of traditional test schemes not covering the scenario is overcome, thereby ensuring that NVMe events can be executed normally under extreme stress scenarios of NVMe hard drives. Furthermore, different methods are used for testing according to the type of NVMe event, ensuring the accuracy of each NVMe event test. After the test is completed, the performance of the NVMe hard drive is analyzed based on Fio performance data and NVMe event test results, and the relevant impacts on the NVMe hard drive itself during the operation of NVMe events in the stress test environment are re-identified. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart of the steps of an NVMe event testing method provided in an embodiment of this application; Figure 2 This is a flowchart illustrating the steps of setting up an NVMe event stress testing environment according to an embodiment of this application; Figure 3 This is a schematic diagram of the application process of an NVMe event testing method provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an NVMe event testing device provided in an embodiment of this application. Detailed Implementation
[0018] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] This application provides an NVMe event testing method, such as... Figure 1 As shown, Figure 1 A flowchart of an NVMe event testing method provided in this application embodiment includes the following steps: Step S101: Record Fio performance data during operation in the NVMe hard drive stress test environment.
[0020] In this embodiment, to accurately and completely cover the usage scenarios of NVMe drives, the NVMe drives need to be run in a stress testing environment. This stress testing environment involves performing high-pressure Fio data read / write operations on the NVMe drive, recording Fio performance data during this process. The Fio performance data reflects the operating characteristics of the NVMe drive. After the event test, the Fio performance data from the stress testing environment is compared with the NVMe drive's own spec value. It is observed whether the Fio performance data consistently exceeds the NVMe drive's spec value. If it does not exceed the spec value, it indicates that the NVMe drive's high-pressure Fio data read / write design is unreasonable, meaning the stress testing environment used to test NVMe events does not meet testing standards. Furthermore, the stability of the Fio performance data is analyzed to observe whether the NVMe drive's performance is stable during the stress testing environment. Fio (flexible I / O tester) is an auxiliary tool for testing hardware storage performance. It combines flexibility and reliability and can simulate multi-threaded / process I / O load according to the user-specified I / O type.
[0021] It should be noted that the NVMe event testing is based on the host system, which means that the host system sends commands or operating parameters to the NVMe hard drive to run the NVMe hard drive in a stress test environment, and the host system views various indicators during the test process. The host system refers to computers, servers, etc.
[0022] In an alternative embodiment, the following steps are further included before the NVMe hard drive is run under stress testing conditions: Step S201: Deploy the test environment for the NVMe hard drive, and divide the NVMe hard drive into a data verification partition and a Fio stress test partition.
[0023] In this embodiment, to ensure the NVMe SSD operates under stress testing conditions and accurately covers various application scenarios in actual NVMe SSD use, a large portion of the NVMe SSD's memory space needs to be used for data stress testing, specifically for Fio stress data read / write operations. This ensures a more accurate reflection of the NVMe SSD's actual usage. However, not all memory can be used for Fio stress data read / write operations. During testing, data verification is necessary to prevent damage to pre-stored data on the NVMe SSD during Fio stress data read / write operations. Therefore, a small portion of memory is used for data verification. Thus, the NVMe SSD's memory space is divided into two partitions: a data verification partition and a Fio stress testing partition. The data verification partition is used for data verification, while the Fio stress testing partition is used for data stress testing, specifically for Fio stress data read / write operations.
[0024] Specifically, 10% of the NVMe SSD's memory space can be allocated as a data verification partition for data verification. Before conducting NVMe event testing, data is written to this partition, and the size and format of the written data are recorded. After the test, verification is performed based on the data in the verification partition to analyze whether the data has been corrupted. 90% of the NVMe SSD's memory space is allocated as a Fio stress test partition. During NVMe event testing, the Fio stress test partition is used for reading and writing high-pressure data using Fio, ensuring the NVMe SSD operates under stress testing conditions. This ensures the test environment covers various real-world application scenarios for NVMe SSDs, making the test results more consistent with actual application scenarios and more accurate.
[0025] In this embodiment, the NVMe hard drive is partitioned, and most of the memory space is used for Fio high-pressure data read and write. Compared with the normal use of NVMe hard drives, where the memory space used for data read and write is no more than 50%, this creates a worse application environment. Therefore, the stress test environment in this embodiment can accurately cover various actual application scenarios of NVMe hard drives, thus ensuring the accuracy of the test results.
[0026] In one optional embodiment, a test environment for the NVMe hard drive is deployed, dividing the NVMe hard drive into a data verification partition and a Fio stress test partition, including: Adjust the capacity of the NVMe hard drive to the nominal capacity; Sector setting is performed on the NVMe hard drive with the nominal capacity, and the memory of the NVMe hard drive after sector setting is divided into a data verification partition and a Fio stress test partition. Data is written to the data verification partition and a verification code is generated for use in verifying the accuracy of the data after the test.
[0027] In this embodiment, the memory space of the NVMe hard drive can be adjusted, and the memory space of the NVMe hard drive is not its nominal capacity when it is first used. For example, the maximum memory of the NVMe hard drive is 8TB, but its actual nominal capacity is 7.68TB. Some space needs to be reserved for data storage and operation within the hard drive's internal mechanisms. Furthermore, the storage space of the NVMe hard drive needs to be the nominal space, that is, the storage space needs to be 4k aligned; otherwise, it will cause performance drops and degradation, and performance may be reduced for some data blocks. Therefore, before testing the NVMe event of the NVMe hard drive, the capacity of the NVMe hard drive needs to be adjusted to a nominal capacity. After the capacity adjustment is completed, the sector settings of the NVMe hard drive need to be performed. The sector settings can be either 512B sector settings or 4kB sector settings. Only after completing the sector settings can the storage location of each data in the NVMe hard drive be determined. Then, the memory of the NVMe hard drive with nominal memory capacity and sector settings is divided into two partitions: a data verification partition and a Fio stress test partition. The data verification partition is used for data verification to verify the impact of the test process on the data stored in the NVMe hard drive. The Fio stress test partition is used for reading and writing Fio high-pressure data to make the NVMe hard drive run in a stress test environment.
[0028] Further, writing data to the data verification partition and generating a checksum involves: converting the data verification partition to an EXT4 file system, writing data to the data verification partition using Fio, performing an MD5 checksum, and generating an MD5 checksum. After completing all NVMe event tests on the NVMe hard drive, the data in the data verification partition is checked again to generate a new MD5 checksum. If the generated new MD5 checksum matches the previous MD5 checksum, it indicates that the pre-written data was not tampered with during the NVMe event testing process, and the testing process will not damage the data inside the NVMe hard drive.
[0029] Step S202: Send the operating parameters of the NVMe hard drive through Fio to enable the NVMe hard drive to run under stress test conditions.
[0030] In this embodiment, before testing the NVMe events of the NVMe hard drive, the host system uses Fio to issue operating parameters for the NVMe hard drive. These operating parameters refer to the parameters that enable the NVMe hard drive to operate under stress testing conditions, specifically the parameters related to performing high-stress data read / write operations in the Fio stress test partition of the NVMe hard drive. Specifically, the operating parameters include at least: the type of data read / write, the data read / write bandwidth ratio, and the number of running threads. After the host system issues the operating parameters of the NVMe hard drive via Fio, the NVMe hard drive performs high-stress data read / write operations according to the parameters, thereby enabling the NVMe hard drive to operate under stress testing conditions.
[0031] In this embodiment, by deploying an environment for the NVMe hard drive and issuing working parameters to the NVMe hard drive after the environment deployment, the accuracy of the NVMe event testing in subsequent steps is ensured, thereby obtaining test results that are more consistent with actual application scenarios and more accurate NVMe hard drive performance analysis results.
[0032] In one optional embodiment, the step of sending the operating parameters of the NVMe hard drive via Fio to enable the NVMe hard drive to operate under a stress test environment includes: Fio sends random mixed read / write parameters to the NVMe hard drive, wherein the proportion of read data bandwidth in the random mixed read / write parameters is less than the proportion of write data bandwidth.
[0033] In this embodiment, the host system sends random mixed read / write parameters to the NVMe hard drive via Fio. These parameters mean the read / write order is random, resulting in higher stress compared to sequential data read / write, thus meeting the high-stress testing requirements of the NVMe hard drive. Specifically, the host system uses Fio to send 4k 8jobsQD64 random mixed read / write parameters. Here, 4k refers to the number of memory blocks, meaning 4k alignment is required during data read / write; 8jobs indicates 8 threads are running simultaneously; and QD64 represents a queue depth of 64. The NVMe hard drive performs random mixed read / write according to the 4k 8jobs QD64 parameters sent by Fio, thus enabling the NVMe hard drive to operate under stress testing conditions.
[0034] Furthermore, in real-world applications, NVMe SSDs typically perform more read operations than write operations. However, from a data reliability perspective, write operations are more crucial for NVMe SSDs. Therefore, when testing NVMe events, the focus is on demonstrating the NVMe SSD's write capability. Consequently, in random mixed read / write parameters, the proportion of read bandwidth is less than the proportion of write bandwidth. Specifically, 30% of the bandwidth can be allocated to data reading, and 70% to data writing. This ensures that the NVMe SSD stress testing environment can cover real-world usage scenarios to the greatest extent possible, guaranteeing the accuracy of NVMe event testing under stress conditions.
[0035] Step S102: Determine the test method corresponding to each NVMe event type, and test all NVMe events according to the corresponding test method.
[0036] NVMe events refer to events defined by NVMe, used during the use of NVMe hard drives to notify the host system of error status and operational information when corresponding events occur. NVMe defines several different types of events, such as Error Events, SMART / Health Events, Notice Events, I / O Command Set Specification (NVMe Command Set) Events, Reservation Log Page Available Events, and Vendor Specific Events. Each NVMe event has a different generation method and function, therefore, different testing methods exist for different event types. Existing NVMe event testing methods are designed for single NVMe event types and are not suitable for testing all NVMe event types. Due to the complex interplay of factors affecting NVMe event functionality, NVMe event types, and background disk actions, a single testing method cannot guarantee the normal operation of NVMe events under extreme disk stress scenarios.
[0037] In this embodiment, NVMe event types can be categorized into several types. A corresponding test method is designed for each type of NVMe event; that is, each event type corresponds to one test method. The NVMe hard drive is run in a stress test environment, and the appropriate test method is selected based on the actual NVMe event type. The NVMe event is then tested based on this test method. This ensures the accuracy of each NVMe event test.
[0038] Furthermore, during the NVMe event testing process, various system metrics are monitored, including at least: CQ monitoring, log monitoring, Reserved monitoring, and disk consistency monitoring.
[0039] In this embodiment, CQ monitoring refers to monitoring the host system and the commands issued by the host, i.e., interactive monitoring of the data transmission process. Log monitoring refers to monitoring the logs of the NVMe hard drive and the host system during the testing process. NVMe hard drive log monitoring mainly examines the Smart Log, Smart Log-add, and Every-Log files to monitor for anomalies in the registers of the NVMe hard drive. Host system log monitoring mainly examines Messages files to determine if there are any errors in the host system. Reserved monitoring monitors the information fed back from the NVMe hard drive to the host. Disk consistency monitoring monitors the NVMe hard drive's own parameters and analyzes whether high-stress testing affects these parameters. By monitoring various system metrics during the testing process and recording the monitoring data, the performance of the NVMe hard drive is analyzed after the test.
[0040] In one optional embodiment, the test method for determining the test corresponding to each NVMe event type includes: To disable NVMe events, create a simulated disable event and validate the simulated disable event. The function of reporting NVMe events involves creating a simulated event and validating the simulated event. For the NVMe event clearing request function, create a simulated clearing request event and validate the simulated clearing request event.
[0041] In this embodiment, when testing NVMe events, the testing functions for each NVMe event are divided into three types: disabling NVMe events, reporting NVMe events, and clearing NVMe event requests. A corresponding simulated event is created for each different testing function, and the simulated events are verified. Specifically, disabling NVMe events means that for an event, the NVMe hard drive can choose whether or not to report the event to the host system. For example, for event A, the NVMe hard drive can choose to report event A or not report event A. During testing, a corresponding simulated disabled event needs to be created first, and then the simulated disabled event is verified, that is, whether the disabled event works. For example, when choosing not to report event A, it is checked whether event A is truly not reported; when choosing to report event A, it is checked whether the event is accurately reported.
[0042] NVMe event reporting refers to the reporting of exception information when an anomaly occurs. However, under normal testing conditions, no anomalies are encountered. Therefore, an exception message needs to be created first, and then the NVMe hard drive reports the created exception message. During testing, a corresponding simulated event is created (an exception message is created), and then the simulated event is verified to check the reporting of the specific exception message and whether the reported exception information is correct. That is, it is checked whether the reported exception information is consistent with the created exception information. If they are consistent, it means that the NVMe hard drive can accurately report the event. For example, an event A is created (indicating an exception has occurred). At this time, the NVMe hard drive needs to report event A, and then it is verified whether the NVMe hard drive can report event A normally. That is, it is checked whether the created event A is consistent with the event A reported by the NVMe hard drive. If they are consistent, it means that the NVMe hard drive can accurately report event A.
[0043] The NVMe event clearing request function refers to the ability of an NVMe hard drive to clear abnormal information after it has been reported. During testing, a simulated clearing request event is created and verified. This verifies whether the reported log recording function is complete after the abnormal message is cleared, and whether reporting can continue. For example, for reported event A, the NVMe hard drive will clear event A after reporting to allow it to continue operating. Event A can then be viewed in the log records. If the NVMe hard drive continues to operate after event A is cleared and event A can still be viewed in the log records, then the NVMe event clearing request function is functioning correctly.
[0044] In addition, when verifying events, you can check the Reserved monitoring, CQ monitoring, and NVMe disk log files to determine whether the functions of each event are normal. Specifically, test whether the NVMe event disabling function can report NVMe events or not based on the selection of NVMe disks; whether the NVMe event reporting function can accurately report NVMe events; whether the NVMe event clearing request function can clear abnormal information; and whether the reporting log recording function is complete.
[0045] In one optional embodiment, all NVMe events are tested according to the corresponding test method, including: Iterate through all NVMe events, create a corresponding simulated NVMe event for each NVMe event, execute the simulated NVMe event, and verify the functionality of the simulated NVMe event.
[0046] In this embodiment, a simulated NVMe event refers to a simulated event with the same function as an actual NVMe event. During testing, a corresponding simulated NVMe event is created for each NVMe event, executed, and its functionality verified. For example, for event B, it is first checked whether event B can be reported or not, depending on the selection of the NVMe hard drive; then event B is reported, and the accuracy of the reported event B is checked; finally, after event B is reported, the NVMe hard drive will clear the reported event B so that the NVMe hard drive can continue to work. Based on the above method, each NVMe event is tested sequentially until all NVMe events have been tested.
[0047] S103: Analyze the performance of the NVMe hard drive based on the Fio performance data and the test results of all NVMe events.
[0048] In this embodiment, the performance of the NVMe hard drive is analyzed after the test. Fio performance data refers to the Fio performance data of the NVMe hard drive under high-stress testing conditions, and Fio performance data can reflect the operating characteristics of the NVMe hard drive. The test results for all NVMe events refer to the test status of all NVMe events, as well as the monitoring data of various indicators during the test process.
[0049] Specifically, the performance analysis of NVMe hard drives includes: data verification, disk consistency analysis, Reserved monitoring analysis, and CQ monitoring analysis, in order to determine whether the functions of various NVMe events of the NVMe hard drive are normal, whether the performance of the NVMe hard drive is stable, and to identify the relevant impacts of events on the disk itself during high-pressure operation.
[0050] In one optional embodiment, the performance of the NVMe hard drive is analyzed based on the Fio performance data and the test results of all NVMe events, including: The data pre-written to the NVMe hard drive is verified to check whether the test process has damaged the pre-written data; Based on the NVMe hard drive's log files, the consistency of the drive is analyzed to assess the impact of the testing process on the NVMe hard drive itself. The Fio performance data is used to perform spec comparison analysis to determine the operating performance of the NVMe hard drive and whether the stress test environment is stable. The compatibility of the NVMe hard drive with the host system is analyzed using CQ monitoring, Reserved monitoring, and system logs.
[0051] In this embodiment, verification is performed based on data pre-written into the data verification partition. Specifically, an MD5 checksum is generated from the data in the data verification partition, and this MD5 checksum is compared with a pre-stored MD5 checksum in the data verification partition. If they match, it indicates that the NVMe hard drive did not cause data corruption under high-stress testing conditions. This demonstrates the rationality of the test design and the good performance of the NVMe hard drive, showing that data is unaffected under high-stress operating conditions.
[0052] Analyzing disk consistency involves checking for anomalies in the NVMe hard drive itself, specifically verifying whether the normally distributed data blocks are the same size as the received data blocks, and whether there are any abnormalities in the various monitoring parameters of the NVMe hard drive. The NVMe hard drive's log files record the changes in its various parameters under high-stress testing conditions. By comparing the parameter changes in the log files before and after the test, if the parameters are consistent, it indicates that the test process does not affect the performance parameters of the NVMe hard drive itself, meaning the test is non-destructive. Therefore, further verification of the test plan's rationality is necessary.
[0053] Fio performance data reflects the operating characteristics of NVMe SSDs. The Fio performance data is compared with the NVMe SSD's own spec value. It's observed whether the Fio performance data consistently exceeds the NVMe SSD's spec value during high-stress testing. If it doesn't, it indicates an unreasonable design for the NVMe SSD's high-stress data read / write operation, meaning the stress testing environment used for NVMe event testing does not meet standards. The stability of the Fio performance data is also analyzed. Stable data indicates that the NVMe SSD's performance fluctuations during high-stress testing are within a preset range. If the fluctuation exceeds this range, the performance data is unstable. Specifically, the performance data is plotted as a curve to observe its changes over time. When the performance data changes within a preset range, it indicates stable NVMe SSD performance.
[0054] By comparing the values monitored by Reserve, CQ, and system logs, the information sent by the NVMe hard drive to the host system and the information received by the host system are compared. If the information sent by the NVMe hard drive to the host system and the information received by the host system are consistent, it indicates that the NVMe hard drive has good compatibility with the host system; otherwise, it indicates poor compatibility. For example, if the NVMe hard drive sends data A to the host system, but the host system receives data B, it means that the data sent by the NVMe hard drive and the data received by the host system are inconsistent, therefore the NVMe hard drive has poor compatibility with that host system.
[0055] Figure 3 This paper illustrates a schematic diagram of the application flow of the NVMe event testing method provided in an embodiment of this application, such as... Figure 3As shown, the test application system comprises five parts: NVMe environment deployment module, stress testing module, event testing module, analysis module, and monitoring module. In the actual testing process, the NVMe environment deployment module first deploys the NVMe hard drive test environment. Specifically, it performs standardized OP (over-provisioning) processing on the NVMe hard drive to be tested, adjusting the memory space of the NVMe hard drive to its nominal capacity and setting the sector size. The sector size setting uses either 512 sectors or 4kB sectors. Then, 10% of the NVMe hard drive's memory is allocated as a data verification partition, designated NVMe1N1. This data verification partition is then formatted as an ext4 file system. Data is written to the NVMe1N1 partition using the Fio tool, and an MD5 checksum is generated for data verification after the test. Finally, the remaining 90% of the memory is used as the Fio stress testing partition for high-pressure data read / write operations during the NVMe event testing process.
[0056] After the test environment deployment of the NVMe hard drive is completed, the stress testing module performs Fio stress test partitions on the NVMe hard drive to perform Fio high-pressure data read and write operations. That is, the host system issues 4k 8jobs QD64 random mixed read and write parameters through Fio, and uses 30% of the bandwidth for data reading and 70% of the bandwidth for data writing. The NVMe hard drive performs random mixed data read and write according to the issued 4k 8jobs QD64 working parameters, thereby realizing the operation of the NVMe hard drive in the stress test environment. During the operation of the stress test environment, Fio performance data is recorded. Fio performance data can reflect the operating characteristics of the NVMe hard drive.
[0057] When the NVMe hard drive is running under stress testing conditions, the event testing module begins testing NVMe events. Specifically, it iterates through all events defined by NVMe and performs tests according to the corresponding testing methods. For each NVMe event, the following steps are executed: simulate disabling the event, simulate creating the event, simulate clearing the request, verify the disabled event, verify the created event, and verify the cleared request.
[0058] During the event testing process, the monitoring module monitors various indicators such as CQ monitoring, log monitoring, Reserved monitoring, disk consistency monitoring, and Fio performance data. After all NVMe event tests are completed, the analysis module performs MD5 data verification, disk consistency analysis of the NVMe hard drive, Reserved monitoring analysis, and CQ monitoring analysis to determine whether the functions of various NVMe events of the NVMe hard drive are normal, whether the performance of the NVMe hard drive is stable, and to identify the relevant impacts of NVMe event operation under high pressure on the NVMe hard drive itself.
[0059] In this embodiment, the NVMe hard drive is run under a stress test environment. A test method is designed for each NVMe event type, and the functionality of all NVMe events is tested in the stress test environment according to the test method corresponding to each NVMe event. By conducting tests in a stress test environment, the risk of traditional test schemes not covering the scenario is overcome, and different methods are used for testing according to the type of NVMe event, ensuring the accuracy of each NVMe event test. After the test is completed, the performance of the NVMe hard drive is analyzed based on Fio performance data and NVMe event test results, and the relevant impacts on the disk itself during the operation of NVMe events in the stress test environment are re-identified.
[0060] This application also provides an NVMe event testing device, as described in the embodiments. Figure 4 , Figure 4 This is a schematic diagram of the structure of an NVMe event testing device proposed in an embodiment of this application, as shown below. Figure 4 As shown, the device includes: Performance recording module 41 is used to record Fio performance data during operation in an NVMe hard drive stress test environment; The event testing module 42 is used to determine the test method corresponding to each NVMe event type, and to test all NVMe events according to the corresponding test method; The performance analysis module 43 is used to analyze the performance of the NVMe hard drive based on the Fio performance data and the test results of all NVMe events.
[0061] In an optional embodiment, the device further includes: The environment deployment module is used to deploy the test environment for NVMe hard drives, dividing the NVMe hard drives into a data verification partition and a Fio stress test partition; The stress loading module is used to send the operating parameters of the NVMe hard drive through Fio so that the NVMe hard drive can run under stress testing conditions.
[0062] In one optional embodiment, the environment deployment module includes: A capacity adjustment module is used to adjust the capacity of the NVMe hard drive to the nominal capacity; The partition setting module is used to set the sectors of the NVMe hard drive with the nominal capacity, and divide the memory of the NVMe hard drive after sector setting into a data verification partition and a Fio stress test partition. The data writing module is used to write data into the data verification partition and generate a verification code for verifying the accuracy of the data after the test.
[0063] In one optional embodiment, the pressure loading module includes: The parameter distribution module is used to distribute random mixed read and write parameters to the NVMe hard drive via Fio, wherein the proportion of read data bandwidth in the random mixed read and write parameters is less than the proportion of write data bandwidth.
[0064] In one optional embodiment, the event testing module includes: The Disable Events module is used to disable NVMe events, create simulated disable events, and validate the simulated disable events. The event creation module is used for the reporting function of NVMe events, creating simulated events, and verifying the simulated events. The Clear Events module is used for the Clear Request function of NVMe events. It creates a simulated Clear Request event and verifies the simulated Clear Request event.
[0065] In an optional embodiment, the event testing module further includes: The event execution module is used to traverse all NVMe events, create a corresponding simulated NVMe event for each NVMe event, execute the simulated NVMe event, and verify the functionality of the simulated NVMe event.
[0066] In an optional embodiment, the event testing module further includes: The data monitoring module is used to monitor various indicators of the NVMe hard drive, including at least: CQ monitoring, log monitoring, Reserved monitoring, and disk consistency monitoring.
[0067] In one optional embodiment, the performance analysis module includes: The data verification module is used to verify the data pre-written to the NVMe hard drive to verify whether the test process has damaged the pre-written data. The disk analysis module is used to analyze the consistency of the disk based on the log files of the NVMe hard drive, so as to analyze the impact of the test process on the NVMe hard drive itself. The performance comparison module is used to perform spec comparison analysis based on the performance data of the NVMe hard drive to determine the operating performance of the NVMe hard drive and whether the stress test environment is stable. The compatibility analysis module is used to analyze the compatibility between the NVMe hard drive and the host system through CQ monitoring, Reserved monitoring, and system logs.
[0068] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the NVMe event testing method described in this application.
[0069] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0070] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0071] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0072] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0073] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0074] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0075] The above provides a detailed description of the NVMe event testing method, apparatus, and device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An NVMe event testing method, characterized in that, The method includes: Record Fio performance data during operation in an NVMe hard drive stress test environment; Determine the test method corresponding to each NVMe event type, and test all NVMe events according to the corresponding test method to determine whether at least one of the NVMe event's disable function, report function, and clear request function is normal; The performance of the NVMe hard drive is analyzed based on the Fio performance data and the test results of all NVMe events. The performance of the NVMe hard drive is analyzed based on the performance data and the test results of all NVMe events, including: The Fio performance data is used to perform spec comparison analysis to determine the operating performance of the NVMe hard drive and whether the stress test environment is stable. The method for determining the test method corresponding to each NVMe event type includes: To disable NVMe events, create a simulated disable event and validate the simulated disable event. The function of reporting NVMe events involves creating a simulated event and validating the simulated event. For the NVMe event clearing request function, create a simulated clearing request event and validate the simulated clearing request event.
2. The method according to claim 1, characterized in that, Also includes: The test environment for the NVMe hard drive was deployed, and the NVMe hard drive was divided into a data verification partition and a Fio stress test partition; The operating parameters of the NVMe hard drive are sent out by Fio to enable the NVMe hard drive to run under stress testing conditions.
3. The method according to claim 2, characterized in that, The deployment of the test environment for the NVMe hard drive involves dividing the NVMe hard drive into a data verification partition and a Fio stress test partition, including: Adjust the capacity of the NVMe hard drive to the nominal capacity; Sector setting is performed on the NVMe hard drive with the nominal capacity, and the memory of the NVMe hard drive after sector setting is divided into a data verification partition and a Fio stress test partition. Data is written to the data verification partition and a verification code is generated for use in verifying the accuracy of the data after the test.
4. The method according to claim 2, characterized in that, The step of sending NVMe hard drive operating parameters via Fio to enable the NVMe hard drive to operate under stress testing conditions includes: Fio sends random mixed read / write parameters to the NVMe hard drive, wherein the proportion of read data bandwidth in the random mixed read / write parameters is less than the proportion of write data bandwidth.
5. The method according to claim 1, characterized in that, The step of testing all NVMe events according to the corresponding test method includes: Iterate through all NVMe events, create a corresponding simulated NVMe event for each NVMe event, execute the simulated NVMe event, and verify the functionality of the simulated NVMe event.
6. The method according to claim 1, characterized in that, The NVMe event testing process also includes: Monitor various system metrics, including at least: CQ monitoring, log monitoring, Reserved monitoring, and disk consistency monitoring.
7. The method according to claim 1, characterized in that, Based on the performance data and test results of all NVMe events, the performance of the NVMe hard drive is analyzed, including: The data pre-written to the NVMe hard drive is verified to check whether the test process has damaged the pre-written data; Based on the NVMe hard drive's log files, the consistency of the drive is analyzed to assess the impact of the testing process on the NVMe hard drive itself. The compatibility of the NVMe hard drive with the host system is analyzed using CQ monitoring, Reserved monitoring, and system logs.
8. An NVMe event testing device, characterized in that, The device includes: The performance logging module is used to record Fio performance data during operation in an NVMe hard drive stress test environment; The event testing module is used to determine the test method corresponding to each NVMe event type, and to test all NVMe events according to the corresponding test method to determine whether at least one of the NVMe event's disable function, report function, and clear request function is normal. The performance analysis module is used to analyze the performance of the NVMe hard drive based on the Fio performance data and the test results of all NVMe events; The performance analysis module includes: The performance comparison module is used to perform spec comparison analysis based on the performance data of the NVMe hard drive to determine the operating performance of the NVMe hard drive and whether the stress test environment is stable. The event testing module includes: The Disable Events module is used to disable NVMe events, create simulated disable events, and validate the simulated disable events. The event creation module is used for the reporting function of NVMe events, creating simulated events, and verifying the simulated events. The Clear Events module is used for the Clear Request function of NVMe events. It creates a simulated Clear Request event and verifies the simulated Clear Request event.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes, it implements the NVMe event testing method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
NVME performance test method and system for simulating multiple applications
CN111309573A