Storage device performance testing method and device, electronic device and storage medium
By using performance testing models in storage devices to automatically acquire and analyze multi-dimensional performance data, the problem of low efficiency in storage device performance testing is solved, and efficient and accurate performance testing is achieved.
Patent Information
- Application Number
- CN202511064253.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-07-31
AI Technical Summary
In the prior art, the performance test of storage devices is inefficient, and different parts need to be tested manually using discrete tools, which is inefficient.
The performance test model automatically obtains the performance data of the storage device's data link and storage controller, generates a performance test report, integrates multi-dimensional performance data for analysis, and locates performance bottlenecks.
It improves the performance testing efficiency of storage devices, accurately locates performance bottlenecks, reduces manual testing steps, and improves test automation and accuracy.
Smart Images

Figure CN120564815B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data storage technology, and in particular to a performance testing method and apparatus for a storage device, an electronic device, and a storage medium. Background Art
[0002] In related technologies, hard disk drives (HDDs) or solid-state drives (SSDs) are widely used as resident storage media in various systems. For data-intensive applications such as large language model training, big data analytics, and real-time databases, storage media performance bottlenecks can significantly impact system performance due to high data throughput.
[0003] To identify bottlenecks restricting storage device system performance, performance testing of storage devices is necessary. Current testing methods rely heavily on discrete tools, requiring testers to use different tools to test different isolated performance indicators in storage devices, resulting in low efficiency. Summary of the Invention
[0004] The present application provides a performance testing method and apparatus for a storage device, an electronic device, and a storage medium, to at least solve the problem of low efficiency in performance testing of storage devices in related technologies.
[0005] This application provides a performance testing method for a storage device, including:
[0006] In response to the test input, controlling the storage device to perform a data operation; wherein the data operation includes a read operation and / or a write operation;
[0007] When the storage device performs a data operation, performance data of the storage device is obtained; wherein the performance data includes performance data of a data link of the storage device and performance data of a storage controller, the storage controller is electrically connected to the storage device via a data link, the data link is used to transmit data between the storage controller and the storage device, and the performance test model includes at least one performance monitoring tool, and the at least one performance monitoring tool is used to monitor the performance of the data link and the storage controller;
[0008] Generate a performance test report for the storage device based on the performance data.
[0009] The present application also provides a performance testing device for a storage device, comprising:
[0010] A control module, configured to control the storage device to perform a data operation in response to a test input; wherein the data operation includes a read operation and / or a write operation;
[0011] an acquisition module, configured to acquire performance data of the storage device when the storage device performs data operations; wherein the performance data includes performance data of a data link of the storage device and performance data of a storage controller, the storage controller being electrically connected to the storage device via a data link, the data link being used to transmit data between the storage controller and the storage device, and the performance test model including at least one performance monitoring tool, the at least one performance monitoring tool being used to monitor the performance of the data link and the storage controller;
[0012] The generation module is used to generate a performance test report of the storage device based on the performance data.
[0013] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned storage device performance testing methods when executing the computer program.
[0014] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned performance testing methods for storage devices are implemented.
[0015] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned storage device performance testing methods when executed by a processor.
[0016] Through the present application, since during the process of the storage device executing data operations, the performance data of the data link of the storage device and the performance data of the storage controller are automatically and synchronously acquired through the performance test model, and the corresponding performance test report is automatically generated based on the detected performance data, there is no need for the tester to manually use discrete tools to separately test different parts of the storage device. Therefore, the technical problem of low efficiency of the performance test of the storage device can be solved, and the technical effect of improving the performance test efficiency of the storage device can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 One of the flow charts showing the performance testing method of a storage device according to some embodiments of the present application is shown;
[0019] Figure 2 A logical diagram illustrating a performance testing method for a storage device according to some embodiments of the present application is shown;
[0020] Figure 3 A second flowchart of a method for testing the performance of a storage device according to some embodiments of the present application is shown;
[0021] Figure 4 A structural block diagram showing a performance testing apparatus for a storage device according to some embodiments of the present application is shown;
[0022] Figure 5 A structural block diagram of an electronic device according to some embodiments of the present application is shown. DETAILED DESCRIPTION
[0023] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0024] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0025] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0026] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the performance testing method for the storage device depends, the specific application environment architecture or specific hardware architecture is described herein.
[0027] In order to solve the technical problem of low efficiency in performance testing of storage devices in the related art, an embodiment of the present application proposes a performance testing method for storage devices, which is further described in detail below with reference to the accompanying drawings.
[0028] In some embodiments of the present application, the storage device may exemplarily include one or more hard disks, such as one or more HDDs or SSDs. Exemplarily, multiple hard disks may form a hard disk array.
[0029] The performance test of storage devices involves efficient data collection, analysis, and integration of the hardware status of the storage devices, including but not limited to the high-speed serial computer expansion bus (Peripheral Component Interconnect Express, PCIe), storage controller (Central Processing Unit, CPU), memory, and input / output (I / O) port performance indicators, and outputs the data in the form of a performance test report.
[0030] Figure 1 One of the flow charts of the performance testing method of the storage device in some embodiments of the present application is shown. Figure 1 As shown, the method includes:
[0031] Step 102 : In response to a test input, control the storage device to perform a data operation; wherein the data operation includes a read operation and / or a write operation.
[0032] In the embodiment of the present application, the test input is input by a tester, and the test input is used to instruct to start a performance test on the storage device. Exemplarily, the test input can be input by the tester under a super administrator user (root user).
[0033] After receiving the test input, the storage device automatically begins executing the data read and write operations corresponding to the performance test according to the set performance test steps. Exemplarily, the data operations include write operations, which write preset data blocks to the storage medium of the storage device, such as an HDD or SSD.
[0034] For example, data operations may also include read operations, which involve reading data stored in a storage device and sending the read data to an external storage medium via an I / O port. The data read / write speed of a storage device when performing read and / or write operations is an important indicator of the storage device's performance. When a storage device experiences a performance bottleneck or performance degradation, the corresponding read / write speed will also decrease.
[0035] Step 104, when the storage device performs data operations, obtain performance data of the storage device; wherein the performance data includes performance data of the data link of the storage device and performance data of the storage controller, the storage controller is electrically connected to the storage device through the data link, the data link is used to transmit data between the storage controller and the storage device, and the performance test model includes at least one performance monitoring tool, and the at least one performance monitoring tool is used to monitor the performance of the data link and the storage controller.
[0036] In an embodiment of the present application, after the storage device starts executing data operations corresponding to the performance test, the performance data of the storage device is monitored in real time through the performance test model, wherein the performance data includes performance data of the data link and performance data of the storage controller.
[0037] The performance monitoring model includes one or more performance monitoring tools that monitor performance data in real time. The performance testing model enables automated monitoring of multi-dimensional performance data, eliminating the need for testers to manually test different parts of a storage device using discrete tools.
[0038] Exemplarily, data link performance data includes PCIe link performance data and I / O performance data. Exemplarily, to obtain PCIe link performance data, you can use the command "watch -n 1 "lspci -vvv | grep -i 'LnkSta\|Device'" as the super administrator user to refresh the PCIe device status every second. Simultaneously, run the command "nvme list" to view device namespace and controller information. And use the command "nvme smart-log / dev / nvme0" to obtain the hard drive health status.
[0039] For example, when obtaining I / O performance data, the iostat -xzmt 1 command can be used to display detailed I / O statistics of each block device in real time, excluding inactive devices, and displaying throughput in more readable MB / s units.
[0040] Step 106: Generate a performance test report of the storage device based on the performance data.
[0041] In an embodiment of the present application, during the performance test process, real performance data of the storage device when performing data operations is obtained in real time, the performance data is effectively analyzed and integrated, and finally a performance test report is output.
[0042] For example, the performance test report can visually display the causes and weights of storage device performance bottlenecks, such as the hardware layer contribution of 60% and the protocol layer contribution of 30%, and provide targeted optimization suggestions, such as adjusting the hard disk array strategy and upgrading the hard disk firmware.
[0043] For example, a report generation model can be used to align timeline performance data, hardware logs, and configuration snapshots to identify causal relationships between key events. For example, a performance test report can include performance degradation attribution, such as "PCIe Gen4x4 link downgraded to Gen3x4, resulting in a 48% loss in maximum bandwidth." For example, a performance test report can also include configuration optimization recommendations, such as "Adjusting the interrupt affinity of eth0 from CPU0-3 to CPU8-11 to avoid storage interrupt request load balancer conflicts."
[0044] Finally, the visualization output generates an interactive report containing trend curves, such as a trend curve showing bandwidth / latency changes over time, a heat map showing CPU interrupt distribution, and a topology map showing PCIe device connection relationships.
[0045] Since the performance testing process of this application integrates multi-dimensional performance data, such as performance data of data links and storage controllers, the integrated analysis of multi-dimensional performance data can more accurately locate the performance bottlenecks of storage devices.
[0046] At the same time, the corresponding performance test report is automatically generated based on the detected performance data. During the process, the tester does not need to manually use discrete tools to separately test different parts of the storage device. Therefore, the technical problem of low efficiency of performance testing of storage devices can be solved, and the technical effect of improving the performance testing efficiency of storage devices can be achieved.
[0047] In some embodiments of the present application, the step of controlling a storage device to perform a data operation includes:
[0048] The storage device is controlled to perform data operations so that the load of the storage device reaches a first load; and the load of the storage device is increased to a second load based on a preset growth rate.
[0049] In the embodiment of the present application, by designing a load gradient mechanism and making the load of the storage device increase linearly, it is possible to capture the transition characteristics of the system from idle to fully loaded, thereby achieving accurate detection of the actual performance of the storage device.
[0050] Exemplarily, when the storage device starts to perform a data operation, the load of the storage device is adjusted to reach a first load by adjusting the number of read / write data packets and the number of concurrent queues.
[0051] Thereafter, the current load of the storage device is gradually increased according to a preset growth rate until the load of the storage device increases to a second load.
[0052] For example, in a sequential write scenario, the number of threads can be gradually increased until the PCIe link bandwidth reaches 70% of the theoretical value (for example, the link bandwidth of PCIe Gen4x4 is 7.88 GB / s) or a sharp increase in the error count occurs.
[0053] Exemplarily, by setting the ramp_time parameter, the load of the storage device is linearly increased within 60 seconds until the load of the storage device reaches the second load.
[0054] Exemplarily, when the load of the storage device is a first load, the PCIe bandwidth of the storage device reaches 10% to 30% of the maximum bandwidth.
[0055] Exemplarily, when the load of the storage device is a first load, the PCIe bandwidth of the storage device reaches 70% to 95% of the maximum bandwidth.
[0056] In some embodiments of the present application, the step of obtaining performance data of a storage device includes:
[0057] When the load of the storage device reaches a second load, the link bandwidth of the data link is obtained; when the link bandwidth is less than the bandwidth threshold, the link rate of the data link and the temperature value of the storage device are obtained.
[0058] The steps of generating a performance test report for a storage device based on performance data include: generating a first performance test report when a link rate is less than a rate threshold and a temperature value is less than a temperature threshold; wherein the first performance test report is used to prompt that the hardware performance of the storage device has degraded; and generating a second performance test report when the link rate is less than the rate threshold and the temperature value is greater than or equal to the temperature threshold; wherein the second performance test report is used to prompt that the storage device is overheated.
[0059] In the embodiments of the present application, for example, if the hard disk in the storage device is a PCIe SSD, the link bandwidth of the data link is the PCIe link bandwidth. Similarly, if the hard disk in the storage device is a SATA (Serial Advanced Technology Attachment), SAS (Serial Attached SCSI), or NVMe (Non-Volatile Memory Express), the link bandwidth corresponds to the SATA link bandwidth, SAS link bandwidth, or NVMe link bandwidth.
[0060] For example, a mathematical model can be established based on the hardware specifications of the storage device to accurately identify the link bandwidth. For example, taking the PCIe link bandwidth as an example, PCIe available bandwidth = link generation base rate × number of channels × coding efficiency. For example, if the rate per channel of PCIe Gen4 is 1.969 GB / s, the PCIe Gen4 link bandwidth = 1.969 GB / s × 8 channels × 98.5%.
[0061] After the storage device load reaches a second load, a determination is made as to whether the link bandwidth of the data link is less than a bandwidth threshold. As the load increases, the link bandwidth occupied by data reads and writes also increases. Therefore, after the storage device load reaches the second load, the link bandwidth should theoretically reach or approach the theoretical bandwidth upper limit.
[0062] If the link bandwidth is greater than or equal to the bandwidth threshold when the load of the storage device reaches the second load, it means that the performance of the storage device has not declined. At this time, a performance test report can be output to inform the tester that there is no bottleneck in the current storage device performance and no further optimization operations are required.
[0063] If the link bandwidth is less than the bandwidth threshold when the storage device load reaches the second load, the link rate of the data link and the temperature of the storage device are further obtained. Link bandwidth refers to the actual data transmission capacity of the data link. Link bandwidth is affected by link rate, coding efficiency, and the number of channels. The temperature of the storage device also directly affects link bandwidth.
[0064] If the link bandwidth does not meet expectations, further determine whether it is affected by temperature.
[0065] If the link bandwidth is less than the bandwidth threshold, the link rate is less than the rate threshold, and the temperature of the storage device is greater than or equal to the temperature threshold, the link bandwidth reduction is determined to be due to overheating throttling. A second performance test report is then output, notifying the storage device of overheating.
[0066] If the link bandwidth is less than the bandwidth threshold, the link rate is less than the rate threshold, and the storage device temperature is less than the temperature threshold, it indicates that the storage device hardware rate has decreased. At this time, a first performance test report is output, notifying the tester of the current storage device hardware rate decrease and prompting the tester to update the hardware.
[0067] Exemplarily, the bandwidth threshold ranges from 65% to 95% of the theoretical bandwidth (maximum bandwidth) of the data link. Exemplarily, the bandwidth threshold is 70% of the theoretical bandwidth.
[0068] This application locates the key nodes that affect system performance based on the temperature value and link rate of the storage device when the link bandwidth does not meet the standard, and outputs the corresponding test report. This can prevent the performance degradation caused by temperature factors from being mistakenly identified as a hardware bottleneck, and realize automated and rapid performance testing.
[0069] In some embodiments of the present application, the step of obtaining performance data of the storage device further includes: obtaining a queue saturation of the storage controller when the link rate is greater than or equal to a rate threshold.
[0070] The step of generating a performance test report of the storage device according to the performance data includes: generating a third performance test report when the queue saturation is greater than the saturation threshold; wherein the third performance test report is used to prompt that the queue depth of the storage controller is insufficient.
[0071] In an embodiment of the present application, if the link bandwidth is less than a bandwidth threshold but the link rate is greater than or equal to a rate threshold, the queue saturation of the storage controller is obtained. For example, when performing data read and write operations, the disk controller forms a task queue for the read and write operations to be executed, where each item in the queue corresponds to a read or write operation.
[0072] Queue depth is the maximum number of tasks that the storage controller can process in parallel, also known as the queue capacity limit. Queue saturation is the ratio of the current number of queues to the maximum number of queues in the storage controller, or the ratio of the current number of queues to the queue depth.
[0073] The theoretical ISPS of SSD = queue depth × number of queue submissions per second / average instruction latency.
[0074] If the queue saturation is greater than the saturation threshold, it indicates that the queue depth of the current storage controller is insufficient. In this case, a third performance test report is output to prompt the tester to upgrade the queue depth of the storage controller.
[0075] For example, the input / output wait (I / O wait) duration and queue saturation can be combined to determine whether device performance is insufficient. I / O wait represents the percentage of time the storage controller spends waiting for I / O operations to complete. For example, in Linux systems, I / O operations include disk reads and network communications. When the CPU is unable to continue computing tasks and must wait for I / O operations to complete, this time is counted as I / O wait.
[0076] For example, when the I / O wait time is continuously greater than the duration threshold, if the storage controller utilization is >90% and the queue is full, it is determined to be a device performance bottleneck, and the tester is informed by outputting a performance test report that the current device performance is insufficient and the device needs to be upgraded.
[0077] This application determines whether the queue depth of the storage controller meets the requirements, so as to quickly identify performance bottlenecks caused by insufficient queue depth and improve performance testing efficiency.
[0078] In some embodiments of the present application, the step of obtaining performance data of the storage device further includes: when the queue saturation is less than or equal to the saturation threshold, obtaining the interrupt delay of the storage controller; wherein the interrupt delay includes soft interrupt delay and hard interrupt delay.
[0079] The steps of generating a performance test report for a storage device based on performance data include: generating a fourth performance test report when the interrupt delay is less than a delay threshold; wherein the fourth performance test report is used to prompt that the protocol stack configuration of the storage controller is abnormal; generating a fifth performance test report when the interrupt delay is greater than or equal to the delay threshold; wherein the fifth performance test report includes interrupt configuration optimization information.
[0080] In an embodiment of the present application, if the link bandwidth is less than the bandwidth threshold, and the link rate is greater than or equal to the rate threshold, and the queue saturation of the storage controller is less than or equal to the saturation threshold, then the interrupt latency of the storage controller is further obtained. The interrupt latency includes hard interrupt latency and soft interrupt latency.
[0081] If the interrupt latency is less than the latency threshold, it indicates that the interrupt efficiency is normal and the link bandwidth drop may be due to an abnormal storage controller protocol stack configuration. In this case, a fourth performance test report is output to remind the tester to check the protocol stack configuration.
[0082] For example, you can use the mpstat tool to monitor CPU load breakdown. The mpstat -P ALL1 command focuses on input / output port wait time (iowait) and soft interrupt latency (%soft). If iowait exceeds 30%, indicating slow storage response, and soft exceeds 20%, you need to check network or storage protocol stack performance. You can also use the perftop -e irq:irq_handler_entry command to dynamically track interrupt handlers and identify high-overhead driver modules (such as the interrupt handler in the NVMe driver). Read / proc / interrupts to count the number of interrupts per core and, based on the interrupt request load balancer service status, determine whether to manually bind interrupt requests to idle cores.
[0083] If the interrupt delay is greater than or equal to the delay threshold, it indicates that the interrupt efficiency is reduced and the interrupt configuration needs to be optimized. At this time, the fifth performance test report is output to remind the tester to optimize the interrupt configuration.
[0084] For example, the interrupt request (IRQ) affinity may be reallocated by calling the irqbalance service.
[0085] For example, the delay threshold is twice the nominal value of the storage device. For example, if the nominal delay of the storage device is 100 μs, the delay threshold is 200 μs.
[0086] For example, in a 4K random read scenario, the 99th percentile latency can be recorded, and an abnormality is determined when it exceeds twice the device's nominal value.
[0087] By focusing on and analyzing interrupt latency data, this application can identify performance bottlenecks caused by unreasonable interrupt configuration and provide targeted optimization suggestions, which is conducive to improving the performance of storage devices.
[0088] In some embodiments of the present application, after the step of controlling the storage device to perform data operations, the method further includes: obtaining the number of media error growths when the storage device performs data operations; and running a device diagnostic program when the number of media error growths is greater than a threshold number; wherein the device diagnostic program includes a bad block scanning program and a firmware health diagnostic program.
[0089] In this embodiment of the present application, a media error refers to a situation in which the hard drive encounters sector data during a read operation that cannot be corrected by its own error correction mechanism, resulting in the inability to return accurate data. Each time a media error occurs, the hard drive management system accumulates a count of media errors and stores the total number of media errors that have occurred to date.
[0090] Before the test begins, record the initial total number of media errors. After the test begins, keep an eye on the current total number of media errors and determine the media error growth count based on the difference between the current total number of media errors and the initial total number of media errors.
[0091] If the number of media errors increases beyond the threshold during a single test, it indicates possible issues such as program disturbance, read disturbance, or data retention failure. In this case, the system controls the storage device to run device diagnostics, including bad block scanning and firmware health diagnostics.
[0092] Among them, the bad block scanner is a tool used to detect physically damaged sectors or logically erroneous blocks on the hard disk. By running the bad block scanner, it can detect possible damaged sectors or logical errors on the hard disk and generate a hard disk health score and abnormal warning information.
[0093] The firmware health diagnostic program can perform intelligent diagnosis of the hard drive at the firmware level, such as reading key data such as firmware version, temperature, power-on time, and realizing functions such as performance degradation detection and fault prediction.
[0094] After executing the device diagnostic program, corresponding health risk warnings and optimization suggestions can be output based on the diagnostic results, such as the output: "SSD 0xab43 block has unstable reading, it is recommended to trigger early media refresh."
[0095] This application can realize automatic diagnosis of the hard disk of the storage device. When a large number of media errors occur on the hard disk, the automatic execution of the diagnostic program can help testers quickly locate the fault and make timely optimization.
[0096] In some embodiments of the present application, before the step of controlling the storage device to perform data operations, the method also includes: generating a performance test model; wherein the performance test model is used to control the storage device to perform data operations, and the performance test model includes multiple data blocks and multiple task queues; the data blocks are used to write to the storage device, and the data lengths of at least some of the multiple data blocks are different; the concurrent number of task queues is less than or equal to the number of physical queues of the storage controller.
[0097] In an embodiment of the present application, a performance testing model is used to perform performance testing on a storage device. After the tester deploys the performance testing model and executes the test input, the performance testing model automatically controls the storage device to perform data operations and collects performance data of the storage device during the data operations, thereby independently completing the performance test.
[0098] The performance testing model features multi-dimensional testing capabilities, preventing distortion of test results caused by a single load type. For example, the performance testing model includes multiple data blocks of varying lengths, which are dynamically assigned. For example, the length of a data block is randomly selected between 4KB and 128KB with a 25% probability, simulating the mixed I / O granularity found in real-world applications.
[0099] The performance test model also includes multiple task queues. The nvme id-ctrl command can be used to query the storage controller, such as the number of physical queues on the NVMe controller, and dynamically adjust the number of task queues based on the number of physical queues to ensure that the number of task queues does not exceed the hardware concurrency limit of the storage controller.
[0100] For example, the performance test model can be used in conjunction with various monitoring tools. These monitoring tools include a PCIe link status monitoring tool. Under the super administrator user, the PCIe link status monitoring tool uses the command "watch -n 1 "lspci-vvv | grep -i 'LnkSta\|Device'" to refresh the PCIe device status every second. The nvmelist command is also used to view device namespace and controller information. The command "nvme smart-log / dev / nvme0" is also used to obtain hard drive health status, such as media error information.
[0101] Monitoring tools also include CPU and terminal efficiency analysis tools. The CPU and terminal efficiency analysis tool uses the mpstat tool to monitor CPU load breakdown. The mpstat -P ALL 1 command focuses on iowait and soft. When iowait is above 30%, it indicates slow storage response. When soft is above 20%, network or storage protocol stack performance needs to be checked. The perf top -e irq:irq_handler_entry command can be used to dynamically track interrupt handlers and identify high-overhead driver modules, such as the interrupt handler in the NVMe driver. The / proc / interrupts directory is read to count the number of interrupts per core and, based on the interrupt request load balancer service status, determine whether interrupt requests need to be manually bound to idle cores.
[0102] Monitoring tools also include memory bandwidth and NUMA (Non-Uniform Memory Access) monitoring. These tools use the vmstat and numastat tools to monitor memory pressure. The "si" and "so" values in the vmstat 1 output reflect swap activity. The numastat -m output displays NUMA node memory allocation. If cross-node access exceeds 20%, process memory needs to be bound. For example, use the numactl --cpunodebind=0 --membind=0 command to restrict the process to NUMA node 0 for binding optimization.
[0103] The monitoring tools also include a real-time I / O performance monitoring tool. The I / O performance real-time monitoring tool uses the iostat -xzmt1 command to display detailed I / O statistics for each block device in real time, excluding inactive devices and displaying throughput in more readable units of MB / s.
[0104] This application designs a multi-dimensional performance testing model, which automatically completes the real-time collection of simulated load and multi-dimensional performance data through the performance testing model, thereby improving the testing efficiency of performance testing of storage devices.
[0105] In some embodiments of the present application, illustratively, Figure 2 A logical diagram showing a performance test method for a storage device according to some embodiments of the present application is shown. Figure 2 As shown, performance testing includes real-time hardware monitoring, standardized stress test design, automated diagnosis rule engine, and multi-dimensional bottleneck analysis model.
[0106] Figure 3 The second flowchart of the performance testing method of the storage device of some embodiments of the present application is shown as follows: Figure 3 As shown, the method includes:
[0107] Step 302: Start performance monitoring;
[0108] Step 304: determine whether the bandwidth is less than 70% of the theoretical value; if so, proceed to step 306; otherwise, end;
[0109] Step 306, perform PCIe link check;
[0110] Step 308, determine whether the link rate is normal; if yes, proceed to step 312, otherwise proceed to step 310;
[0111] Step 310: Generate a hardware speed reduction alarm;
[0112] Step 312, determine whether the queue saturation is greater than 90%; if so, proceed to step 314, otherwise proceed to step 316;
[0113] Step 314, recommending upgrading the queue configuration;
[0114] Step 316, determine whether the soft interrupt delay and the hard interrupt delay are normal; if yes, proceed to step 320, otherwise proceed to step 318;
[0115] Step 318: Generate interruption optimization suggestions;
[0116] Step 320: Prompt to check the protocol stack configuration.
[0117] When monitoring hardware data in real time, the Flexible I / O Tester (FIO), an open-source, cross-platform storage performance testing tool, builds a multi-dimensional I / O model to avoid distortion caused by a single load. Block sizes are dynamically distributed, randomly selected between 4KB and 128KB with a 25% probability, simulating the mixed I / O granularity found in real-world applications. Queue depth is dynamically adjusted based on the number of physical queues on the NVMe controller (queried using nvme id-ctrl), ensuring that the hardware concurrency limit is not exceeded. The load ramping mechanism uses the ramp_time parameter to linearly increase the load over 60 seconds, capturing the system's transition from idle to fully loaded states.
[0118] The performance limit detection mechanism enables bandwidth stress testing, latency sensitivity testing, and stability verification. The bandwidth stress test gradually increases the number of threads in a sequential write scenario until the PCIe link bandwidth reaches 95% of the theoretical value (7.88GB / s for Gen4x4) or a sharp increase in error counts occurs. The latency sensitivity test records the 99th percentile latency in a 4K random read scenario. An abnormality is detected when the latency exceeds twice the device's nominal value (e.g., 100μs). The stability verification runs a continuous stress test for 300 seconds, monitoring the standard deviation of performance metrics. A stability alarm is triggered when the standard deviation exceeds the baseline by 20%.
[0119] Theoretical benchmark calculations are based on a mathematical model created based on hardware specifications. For example, PCIe available bandwidth = link generation base rate × number of lanes × encoding efficiency (e.g., Gen4 1.969 GB / s per lane × 8 lanes × 98.5%). SSD theoretical IOPS = queue depth × queue submissions per second / average command latency.
[0120] Anomaly detection rules and bandwidth attenuation: When the measured bandwidth is continuously lower than 70% of the theoretical value, PCIe link status checks and SSD temperature scans are triggered.
[0121] Latency degradation: When the 99th percentile latency exceeds twice the device's nominal value, check iowait, interrupt request load balancer latency, and NVMe controller logs.
[0122] Error accumulation. If media errors exceed 100 in a single test, initiate a bad block scan and firmware health diagnostics. When analyzing performance bottlenecks from multiple dimensions, for example, if bandwidth falls short of expectations, link speed drops, and the temperature exceeds 85°C, attribute this to thermal throttling. If iowait is persistently high, utilization exceeds 90%, and the queue is full, consider it a device performance bottleneck. If soft interrupts are overloaded, a single core handles more than 50% of interrupts, and the driver is outdated, a driver upgrade is recommended.
[0123] This application can also achieve automated diagnosis and optimization closed loop:
[0124] 1. Intelligent report generation process: Time-series performance data, hardware logs, and configuration snapshots are aligned to identify causal relationships between key events. For example, a performance degradation attribution can be output as follows: "The PCIe Gen4x4 link was downgraded to Gen3x4, resulting in a 48% loss in maximum bandwidth." A health risk warning can be output as follows: "Unstable reads of SSD block 0xab43 are occurring; it is recommended to trigger an early media refresh." A configuration optimization suggestion can be output as follows: "Adjust the interrupt affinity of eth0 from CPU0-3 to CPU8-11 to avoid conflicts with the storage interrupt request load balancer." Finally, the visualization output generates an interactive report that includes trend curves (bandwidth / latency changes over time), heat maps (CPU interrupt distribution), and topology maps (PCIe device connection relationships).
[0125] 2. Self-healing and verification mechanism: After diagnosis is confirmed, predefined repair actions are executed for automatic tuning. For example, a PCIe link can be reset and the link physical layer can be retrained using setpci. For example, NUMA binding can be performed and process memory can be locked to the local node using numactl. For example, interrupt balancing optimization can be performed by calling the irqbalance service to reallocate IRQ affinity. Finally, closed-loop verification is performed, and verification tests are automatically initiated after the repair operation to compare whether key indicators (such as latency standard deviation and bandwidth stability) have returned to the normal range. Successful diagnostic cases are converted into rule templates to continuously optimize the accuracy of the judgment logic.
[0126] This application enables fully automated and precise location detection. Using a multi-dimensional data correlation analysis engine (PCIe link layer status + NVMe queue depth + interrupt distribution + NUMA affinity), it cross-locates complex bottlenecks (such as PCIe slowdown combined with NVMe queue congestion), improving location efficiency by 80%. An intelligent root cause analysis algorithm quantifies the contribution of mixed issues (such as SSD overheating leading to firmware throttling and interrupt load imbalance) down to the component level, e.g., "PCIe bandwidth reduction contributes 62%, NVMe controller latency contributes 38%." A dynamic baseline comparison system automatically generates reference thresholds based on theoretical hardware values (e.g., Gen4x4 bandwidth of 7.88GB / s) and historical health status, reducing the false positive rate to below 5%.
[0127] This application can also achieve a closed-loop repair. Preset repair solutions are provided for typical bottleneck combinations. Scenario 1: PCIe speed reduction + temperature > 85°C, automatically triggering PCIe link retraining + adjusting fan strategy. Scenario 2: NVMe queue depth is insufficient + iowait > 40%, dynamically expanding the I / O scheduler queue + binding interrupts to idle cores. Repair effect verification mechanism: Automatically rerun the stress test after executing the repair, comparing the performance matrix before and after the repair (such as bandwidth recovery, latency standard deviation), and the verification success rate is > 90%.
[0128] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0129] The embodiment of the present application also provides a performance testing device for a storage device, Figure 4 FIG. 1 shows a structural block diagram of a performance test apparatus for a storage device according to some embodiments of the present application. Figure 4 As shown, the performance testing device 400 includes: a control module 402, which is used to control the storage device to perform data operations in response to test inputs; wherein the data operations include read operations and / or write operations; an acquisition module 404, which is used to obtain performance data of the storage device when the storage device performs data operations; wherein the performance data includes performance data of the data link of the storage device and performance data of the storage controller, the storage controller is electrically connected to the storage device through the data link, the data link is used to transmit data between the storage controller and the storage device, the performance test model includes at least one performance monitoring tool, and the at least one performance monitoring tool is used to perform performance monitoring on the data link and the storage controller; a generation module 406, which is used to generate a performance test report for the storage device based on the performance data.
[0130] Since the performance testing process of this application integrates multi-dimensional performance data, such as performance data of data links and storage controllers, the integrated analysis of multi-dimensional performance data can more accurately locate the performance bottlenecks of storage devices.
[0131] At the same time, the corresponding performance test report is automatically generated based on the detected performance data. During the process, the tester does not need to manually use discrete tools to separately test different parts of the storage device. Therefore, the technical problem of low efficiency of performance testing of storage devices can be solved, and the technical effect of improving the performance testing efficiency of storage devices can be achieved.
[0132] For the description of the features in the embodiment corresponding to the performance testing apparatus for storage devices, reference can be made to the relevant description of the embodiment corresponding to the performance testing method for storage devices, which will not be repeated here.
[0133] An embodiment of the present application further provides an electronic device, Figure 5 The structural block diagram of the electronic device of some embodiments of the present application is shown as follows: Figure 5 As shown, the electronic device 500 includes a memory 502 and a processor 504. The memory 502 stores a computer program, and the processor 504 is configured to run the computer program to execute the steps in any of the above-mentioned storage device performance testing method embodiments.
[0134] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps of any of the above-mentioned storage device performance testing method embodiments when running.
[0135] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0136] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned storage device performance testing method embodiments are implemented.
[0137] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in any of the above-mentioned storage device performance testing method embodiments.
[0138] Professionals may further appreciate 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 above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0139] The above is a detailed introduction to the performance testing method and apparatus for a storage device, an electronic device, and a storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A performance testing method for a storage device, characterized in that: The method comprises: In response to a test input, controlling the storage device to perform a data operation; wherein the data operation includes a read operation and / or a write operation; During the process of the storage device executing the data operation, performance data of the storage device is obtained through a performance testing model; wherein the performance data includes performance data of a data link of the storage device and performance data of a storage controller, the storage controller is electrically connected to the storage device through the data link, the data link is used to transmit data between the storage controller and the storage device, and the performance testing model includes at least one performance monitoring tool, and the at least one performance monitoring tool is used to monitor the performance of the data link and the storage controller; generating a performance test report of the storage device according to the performance data; The controlling the storage device to perform data operations includes: controlling the storage device to perform the data operation so that the load of the storage device reaches a first load; increasing the load of the storage device to a second load based on a preset growth rate; The obtaining of the performance data of the storage device includes: When the load of the storage device reaches the second load, obtaining the link bandwidth of the data link; When the link bandwidth is less than a bandwidth threshold, obtaining a link rate of the data link and a temperature value of the storage device; The step of generating a performance test report of the storage device according to the performance data includes: When the link rate is less than the rate threshold and the temperature value is less than the temperature threshold, generating a first performance test report; wherein the first performance test report is used to prompt that the hardware performance of the storage device is degraded; When the link rate is less than the rate threshold and the temperature value is greater than or equal to the temperature threshold, a second performance test report is generated: wherein the second performance test report is used to prompt that the storage device is overheated.
2. The performance testing method according to claim 1, wherein: The obtaining of the performance data of the storage device further includes: When the link rate is greater than or equal to the rate threshold, obtaining a queue saturation of the storage controller; The step of generating a performance test report of the storage device according to the performance data includes: In a case where the queue saturation is greater than a saturation threshold, a third performance test report is generated; wherein the third performance test report is used to prompt that the queue depth of the storage controller is insufficient.
3. The performance testing method according to claim 2, characterized in that: The obtaining of the performance data of the storage device further includes: When the queue saturation is less than or equal to the saturation threshold, obtaining the interrupt delay of the storage controller; wherein the interrupt delay includes soft interrupt delay and hard interrupt delay; The step of generating a performance test report of the storage device according to the performance data includes: When the interrupt delay is less than the delay threshold, generating a fourth performance test report; wherein the fourth performance test report is used to prompt that the protocol stack configuration of the storage controller is abnormal; In a case where the interrupt delay is greater than or equal to the delay threshold, a fifth performance test report is generated; wherein the fifth performance test report includes interrupt configuration optimization information.
4. The performance testing method according to any one of claims 1 to 3, characterized in that: After controlling the storage device to perform the data operation, the method further includes: When the storage device executes the data operation, obtaining a media error increase count; When the number of media errors increases is greater than a threshold, a device diagnostic program is run; wherein the device diagnostic program includes a bad block scanning program and a firmware health diagnostic program.
5. The performance testing method according to any one of claims 1 to 3, characterized in that: Before controlling the storage device to perform data operations, the method further includes: Generate the performance test model; wherein, the performance test model is also used to control the storage device to perform the data operation, and the performance test model includes multiple data blocks and multiple task queues; the data blocks are used to write to the storage device, and the data lengths of at least some of the multiple data blocks are different; the concurrent number of the task queues is less than or equal to the number of physical queues of the storage controller.
6. A performance testing device for a storage device, characterized in that: The performance testing device comprises: A control module, configured to control the storage device to perform a data operation in response to a test input; wherein the data operation includes a read operation and / or a write operation; an acquisition module, configured to acquire performance data of the storage device during the process of the storage device executing the data operation; wherein the performance data includes performance data of a data link of the storage device and performance data of a storage controller, the storage controller being electrically connected to the storage device via the data link, the data link being used to transmit data between the storage controller and the storage device, and the performance test model including at least one performance monitoring tool, the at least one performance monitoring tool being used to monitor the performance of the data link and the storage controller; A generating module, configured to generate a performance test report of the storage device based on the performance data; Wherein, the control module includes: a control submodule, configured to control the storage device to perform the data operation so that the load of the storage device reaches a first load; an increasing submodule, configured to increase the load of the storage device to a second load based on a preset growth rate; The acquisition module includes: A first acquisition submodule, configured to acquire the link bandwidth of the data link when the load of the storage device reaches the second load; A second acquisition submodule is configured to acquire a link rate of the data link and a temperature value of the storage device when the link bandwidth is less than a bandwidth threshold; The generation module includes: A first generating submodule is configured to generate a first performance test report when the link rate is less than a rate threshold and the temperature value is less than a temperature threshold; wherein the first performance test report is used to indicate that the hardware performance of the storage device is degraded; The second generation submodule is used to generate a second performance test report when the link rate is less than the rate threshold and the temperature value is greater than or equal to the temperature threshold: wherein the second performance test report is used to prompt that the storage device is overheated.
7. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the performance testing method according to any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the performance testing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Device storage performance test method and system, and related device
CN112269697A
Storage configuration adjustment method, storage medium, electronic equipment and program product
CN119902722A