Method and apparatus for write zeroes performance testing based on solid state drives

By reading MDTS and configuring the FIO block size, combined with the Libblkio library and io_uring driver, the inefficiency of the NVME-cli tool in Write Zeroes performance testing was solved, enabling fast and efficient performance testing of solid-state drives at different queue depths and LBA ranges.

CN117476091BActive Publication Date: 2026-07-31SUZHOU UNIONMEMORY INFORMATION SYST LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU UNIONMEMORY INFORMATION SYST LTD
Filing Date
2023-11-09
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In existing technologies, the NVME-cli tool is limited by the fact that a single command can only access a maximum LBA range of 32MB when testing the Write Zeroes performance of solid-state drives. This results in low efficiency in full-disk Write Zeroes performance testing and makes it impossible to achieve flexible full-disk performance evaluation.

Method used

By reading and recording the maximum data transfer size of MDTS, configuring the FIO block size, performing FIO disk filling, and testing Write Zeroes performance at high and low queue depths, a rapid test was conducted using the Libblkio library and the io_uring driver.

Benefits of technology

It enables rapid and efficient testing of solid-state drive performance anomalies under different queue depths and LBA ranges, providing objective performance evaluations and improving the efficiency and scope of Write Zeroes performance testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117476091B_ABST
    Figure CN117476091B_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer device, and storage medium for testing Write Zeroes performance on a solid-state drive (SSD). The method includes: reading and recording the Maximum Data Transfer Scale (MDTS) via command and determining whether the MDTS is within the expected range, where MDTS is the maximum data transfer size; if the MDTS is not within the expected range, reading the MDTS parameters fails; if the MDTS is within the expected range, configuring the block size in the File IO (FIO) and performing FIO disk filling, followed by a certain period of idle time; testing the full-disk Write Zeroes performance at high queue depths and determining whether the test completion time is within the expected time; if it is within the expected time, the Write Zeroes performance meets expectations, and the bandwidth and time of the full-disk Write Zeroes are recorded; performing FIO disk filling again, followed by a certain period of idle time. This invention can quickly and efficiently test the performance anomalies and Write Zeroes processing capabilities of SSDs at different queue depths and LBA ranges using Shell scripts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of solid-state drive (SSD) testing technology, and in particular to a method, apparatus, computer device, and storage medium for testing WriteZeroes performance based on SSDs. Background Technology

[0002] SSD technology is rapidly evolving, with prices decreasing while speed and capacity continue to increase. Slower, smaller-capacity SSDs, those nearing the end of their warranty period, are inevitably discarded, resold, or phased out. These discarded, resold, phased-out, or still-in-use SSDs often store important and sensitive data. Simply deleting files or formatting the drive cannot guarantee the complete erasure of all data from the SSD, and data recovery software can restore the data. To completely erase all data and prevent software recovery, thus avoiding data theft or unauthorized use, more and more SSDs support the Write Zeroes command for logical destruction (without damaging the physical chip). This command sets a logical block range to zero. After successfully completing this command, subsequent reads of logical blocks within this range return values ​​of 0 until a write operation is performed on the LBA (Logical Block Address). The Write Zeroes command's actions are completely different from copying all-zero data to the SSD's storage chip via the file system. The process of zeroing logical blocks after receiving the Write Zeroes command on the SSD involves no actual data transfer. Different parameter configurations have a significant impact on Write Zeroes performance. The performance difference of Write Zeroes across the entire disk can reach the hour level. Testing and optimizing on solid-state drives that support Write Zeroes commands can improve the competitiveness of product performance.

[0003] Currently, the industry practice is to use the NVMe-cli tool to test whether a solid-state drive (SSD) supports the Write Zeroes command. However, because NVMe-cli's Write Zeroes test is limited to a maximum of 32MB of LBAs per command, performance testing of the entire drive in Write Zeroes is inefficient. Therefore, tests using NVMe-cli to assess SSD Write Zeroes performance typically involve testing a small range of LBAs, and it cannot replace full-drive Write Zeroes performance evaluation, nor does it offer sufficient flexibility in terms of test coverage. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, and storage medium for performing Write Zeroes performance testing based on solid-state drives to address the aforementioned technical problems.

[0005] A Write Zeroes performance testing method based on solid-state drives, the method comprising:

[0006] Perform a secure erase on the solid-state drive under test;

[0007] The MDTS is read and recorded by command, and it is determined whether the MDTS is within the expected range. The MDTS is the maximum data transmission size.

[0008] If MDTS is not within the expected range, reading MDTS parameters will fail. If MDTS is within the expected range, the block size in FIO will be configured and FIO disk filling will be performed. After disk filling, the disk will be idle for a certain period of time.

[0009] Test the performance of Write Zeroes across the entire disk under high queue depth and determine whether the test completion time is within the expected time. If it is within the expected time, the performance of Write Zeroes meets expectations, and record the bandwidth and time of Write Zeroes across the entire disk.

[0010] Perform FIO disk filling again, and then leave it idle for a certain period of time after filling.

[0011] Test the performance of Write Zeroes within a 1GB range under low queue depth and determine whether the test completion time is within the expected time. If it is within the expected time, the performance of Write Zeroes under low queue conditions meets expectations. Record the bandwidth and time corresponding to Write Zeroes and block size.

[0012] In one embodiment, the step of securely erasing the solid-state drive under test is further included:

[0013] Send commands to read the controller data structure using NVME tools;

[0014] Determine if the SSD under test supports the Write Zeroes command. If it does not support the Write Zeroes command, exit the test.

[0015] In one embodiment, after the step of determining whether the solid-state drive under test supports the Write Zeroes command, the following method is further included:

[0016] If the Write Zeroes command is supported, check if the Write Zeroes command is functioning correctly.

[0017] Use FIO to write fixed data patterns within a certain small range;

[0018] Use FIO in conjunction with the Libblkio library, which supports Write Zeroes commands, and the io_uring driver to perform small-scale Write Zeroes operations;

[0019] Read data within a small range and determine if the read data is all zeros. If it is all zeros, the WriteZeroes function is working properly. If the read data is the fixed data pattern to be written, the WriteZeroes function has failed.

[0020] In one embodiment, after the step of testing the performance of full-disk Write Zeroes at high queue depths and determining whether the test completion time is within the expected time, the method further includes:

[0021] If the performance fails to meet expectations, Write Zeroes will fail. Record the bandwidth and time of all Write Zeroes operations for analysis and optimization.

[0022] In one embodiment, after the step of testing the performance of Write Zeroes within a 1GB range at low queue depth and determining whether the test completion time is within the expected time, the method further includes:

[0023] If the performance of Write Zeroes fails to meet expectations within the time frame, the performance of Write Zeroes in low queue configuration will fail. Record the bandwidth and time corresponding to Write Zeroes and block size for analysis and optimization.

[0024] A Write Zeroes performance testing device based on a solid-state drive, the device comprising:

[0025] An erasure module, which is used to securely erase the solid-state drive under test;

[0026] The judgment module is used to read and record MDTS through commands and determine whether MDTS is within the expected range. MDTS is the maximum data transfer size. If MDTS is not within the expected range, reading MDTS parameters will fail. If MDTS is within the expected range, the block size in FIO will be configured.

[0027] The disk filling module is used to perform FIO disk filling and then idles for a certain period of time after filling.

[0028] The first test module is used to test the performance of full-disk Write Zeroes under high queue depth and determine whether the test completion time is within the expected time. If it is within the expected time, the Write Zeroes performance meets the expectations and the bandwidth and time of full-disk Write Zeroes are recorded.

[0029] The second test module is used to test the performance of Write Zeroes within a 1GB range under low queue depth and determine whether the test completion time is within the expected time. If it is within the expected time, the performance of Write Zeroes under low queue condition meets the expectations, and the bandwidth and time corresponding to Write Zeroes and block size are recorded.

[0030] In one embodiment, the apparatus further includes a support determination module, the support determination module being used to:

[0031] Send commands to read the controller data structure using NVME tools;

[0032] Determine if the SSD under test supports the Write Zeroes command. If it does not support the Write Zeroes command, exit the test.

[0033] In one embodiment, the device further includes a function detection module, the function detection module being used to:

[0034] If the Write Zeroes command is supported, check if the Write Zeroes command is functioning correctly.

[0035] Use FIO to write fixed data patterns within a certain small range;

[0036] Use FIO in conjunction with the Libblkio library, which supports Write Zeroes commands, and the io_uring driver to perform small-scale Write Zeroes operations;

[0037] Read data within a small range and determine if the read data is all zeros. If it is all zeros, the WriteZeroes function is working properly. If the read data is the fixed data pattern to be written, the WriteZeroes function has failed.

[0038] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.

[0039] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above methods.

[0040] The aforementioned method, apparatus, computer device, and storage medium for testing Write Zeroes performance based on solid-state drives (SSDs) involve reading and recording the Maximum Data Transfer Scale (MDTS) via commands and determining whether the MDTS is within the expected range. The MDTS represents the maximum data transfer size. If the MDTS is outside the expected range, reading the MDTS parameters fails; if it is within the expected range, the block size in the FIO (Fulfilled I / O) is configured, and FIO disk filling is performed, followed by a period of idle time. The performance of Write Zeroes across the entire disk at high queue depths is tested, and the test completion time is determined to be within the expected time. If it is within the expected time, the Write Zeroes performance meets expectations, and the bandwidth and time of the entire Write Zeroes test are recorded. FIO disk filling is performed again, followed by a period of idle time. The performance of Write Zeroes within a 1GB range at low queue depths is tested, and the test completion time is determined to be within the expected time. If it is within the expected time, the Write Zeroes performance under low queue conditions meets expectations, and the bandwidth and time corresponding to the Write Zeroes and block size are recorded. This invention can quickly and efficiently test the performance anomalies and Write Zeroes processing capabilities of SSDs at different queue depths and LBA ranges using Shell scripts, providing an objective performance evaluation. Attached Figure Description

[0041] Figure 1 This is a flowchart illustrating a Write Zeroes performance testing method based on a solid-state drive in one embodiment.

[0042] Figure 2 This is a flowchart illustrating the Write Zeroes performance testing method based on a solid-state drive in another embodiment;

[0043] Figure 3 This is a flowchart illustrating the Write Zeroes performance testing method based on solid-state drives in another embodiment;

[0044] Figure 4 This is a structural block diagram of a Write Zeroes performance testing device based on a solid-state drive in one embodiment.

[0045] Figure 5 This is a structural block diagram of a Write Zeroes performance testing device based on a solid-state drive in another embodiment;

[0046] Figure 6 This is a structural block diagram of a solid-state drive-based Write Zeroes performance testing device in another embodiment;

[0047] Figure 7This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0049] Currently, existing technologies typically use the NVME-cli tool to test whether a solid-state drive (SSD) supports the Write Zeroes command. However, because NVME-cli's Write Zeroes test is limited to a maximum of 32MB of LBAs per command, performance testing across the entire drive is inefficient. Therefore, NVME-cli tests SSD Write Zeroes performance by performing small-scale tests on only a few LBAs, and it cannot replace full-disk Write Zeroes performance evaluation, nor does it offer sufficient flexibility in terms of the test's traversal range.

[0050] Based on this, this solution provides a Write Zeroes performance testing method based on solid-state drives, which aims to improve the testing efficiency and scope of Write Zeroes performance testing.

[0051] In one embodiment, such as Figure 1 As shown, a performance testing method for Write Zeroes based on solid-state drives is provided, which includes:

[0052] Step 102: Perform a secure erase on the solid-state drive under test;

[0053] Step 107: Read and record MDTS via command and determine whether MDTS is within the expected range, where MDTS is the maximum data transmission size;

[0054] Step 106: If MDTS is not within the expected range, reading MDTS parameters will fail; if MDTS is within the expected range, the block size in FIO will be configured and FIO disk filling will be performed. After disk filling, the disk will be idle for a certain period of time.

[0055] Step 108: Test the performance of Write Zeroes on the entire disk under high queue depth and determine whether the test completion time is within the expected time. If it is within the expected time, the performance of Write Zeroes meets expectations and the bandwidth and time of Write Zeroes on the entire disk are recorded.

[0056] Step 110: Perform FIO disk filling again, and leave it idle for a certain period of time after filling.

[0057] Step 112: Test the performance of Write Zeroes within a 1GB range under low queue depth and determine whether the test completion time is within the expected time. If it is within the expected time, the performance of Write Zeroes under low queue conditions meets expectations, and record the bandwidth and time corresponding to Write Zeroes and block size.

[0058] In this embodiment, a Write Zeroes performance testing method based on solid-state drives is provided, and the specific testing environment includes:

[0059] Hardware Requirements: The computer under test is an ASUS Z790. The method described in this patent is applicable to desktops, laptops, and other computers supporting the M.2 PCIe interface, but the specific model is not mandatory. In this embodiment, the ASUS Z790 is preferred as the computer under test. The solid-state drive under test is a consumer-grade solid-state drive. The solid-state drive under test is located as a slave drive.

[0060] Software requirements: Operating system is Linux Ubuntu; tools and software include FIO and NVME-cli; test scripts are self-written shell scripts.

[0061] For details, please refer to [link / reference]. Figure 2 The latter half of the flowchart for the Write Zeroes performance testing method based on solid-state drives. First, the disk under test is securely erased using the NVMe format command.

[0062] Next, use the id-ctrl command of NVME to read byte 70 and record the size of MDTS (maximum data transfer size, hereinafter referred to as MDTS). MDTS=6 means that MDTS is 256K, and MDTS=7 means that MDTS is 512K.

[0063] Then, determine whether the size of MDTS is within the expected range. If the size is within the expected range, configure bs (block size, hereinafter referred to as bs) in FIO. The purpose is to obtain the performance of Write Zeroes when the corresponding queue depth is 256 under different MDTS. The configuration method is to multiply MDTS by 256. If the size is not within the expected range, read the MDTS parameter FAIL.

[0064] In one embodiment, after testing the performance of the entire Write Zeroes system at a high queue depth and determining whether the test completion time is within the expected time, the method further includes: if the Write Zeroes performance fails within the expected time, recording the bandwidth and time of the entire Write Zeroes system for analysis and optimization.

[0065] Specifically, FIO fills 8GB of disk (to simulate the size of a Linux system), using sequential writes with bs = 1024k, queue depth (iodepth) 8, and threads (numbobs) = 1. After filling, it idles for 1 minute. The FIO disk filling configuration is as follows:

[0066] fio--name=prefill--rw=write--direct=1--ioengine=libaio--numjobs=1--filename= / dev / nvme0n1--bs=1024k--iodepth=8--size=8G

[0067] The performance of full-disk write zeroes was tested at a high queue depth of 256. The FIO test configuration is as follows:

[0068] fio --rw=trim --size=100% --ioengine=libblkio --libblkio_driver=io_uring\--libblkio_path= / dev / nvme0n1 --name=write-zero\--libblkio_write_zeroes_on_trim--bs=MDTS x 256"

[0069] Determine if the completion time of the above steps is within the expected timeframe. If it is, the Write Zeroes performance meets expectations, and record the bandwidth and time of the entire Write Zeroes process. If it is not within the expected timeframe, the Write Zeroes performance fails, and the bandwidth and time of the entire Write Zeroes process need to be recorded for further analysis and optimization.

[0070] In one embodiment, after testing the performance of Write Zeroes within a 1GB range at a low queue depth and determining whether the test completion time is within the expected time, the method further includes: if it is not within the expected time, the performance of Write Zeroes under the low queue configuration fails, and the bandwidth and time corresponding to Write Zeroes and block size are recorded for analysis and optimization.

[0071] Specifically, FIO fills 8GB of disk (to simulate the size of a Linux system), using sequential writes with bs = 1024k, queue depth (iodepth) 8, and threads (numbobs) = 1. After filling, it idles for 1 minute. The FIO disk filling configuration is as follows:

[0072] fio--name=prefill--rw=write--direct=1--ioengine=libaio--numjobs=1--filename= / dev / nvme0n1--bs=1024k--iodepth=8--size=8G

[0073] This test assesses the performance of Write Zeroes within a 1GB range under low queue depths. The objective is to identify queue depths of 1-5, where Write Zeroes performance is extremely low (in very slow cases, the time taken to complete a full disk operation can be on the order of hours). Since only one queue depth can be specified at a time, queue depths 1-5 require a loop to iterate through them. The specific FIO test configuration is as follows:

[0074] fio--rw=trim--size=1G--ioengine=libblkio--libblkio_driver=io_uring\--libblkio_path= / dev / nvme0n1--name=write-zero\--libblkio_write_zeroes_on_trim--bs=MDTS x 1(~5)”

[0075] Determine if the completion time of the above steps is within the expected timeframe. If it is, the performance of WriteZeroes under low queue conditions meets expectations, and record the bandwidth and time when WriteZeroes and its corresponding bs sizes are set. If it is not within the expected timeframe, the performance of WriteZeroes under low queue configuration fails, and the bandwidth and time when WriteZeroes and its corresponding bs sizes are set, and further analysis and optimization are required.

[0076] In the above embodiment, the MDTS (Maximum Data Transfer Scale) is read and recorded via command, and it is determined whether the MDTS is within the expected range. The MDTS is the maximum data transfer size. If the MDTS is not within the expected range, reading the MDTS parameter fails. If the MDTS is within the expected range, the block size in FIO (Fixed I / O) is configured, and FIO disk filling is performed. After disk filling, the disk is idle for a certain period of time. The performance of Write Zeroes across the entire disk under high queue depth is tested, and it is determined whether the test completion time is within the expected time. If it is within the expected time, the Write Zeroes performance meets expectations, and the bandwidth and time of Write Zeroes across the entire disk are recorded. FIO disk filling is performed again, and the disk is idle for a certain period of time after filling. The performance of Write Zeroes within 1GB under low queue depth is tested, and it is determined whether the test completion time is within the expected time. If it is within the expected time, the performance of Write Zeroes under low queue conditions meets expectations, and the bandwidth and time corresponding to Write Zeroes and block size are recorded. This solution can quickly and efficiently test the anomalies and Write Zeroes processing capabilities of solid-state drives under different queue depths and different LBA ranges using Shell scripts, and provide an objective performance evaluation.

[0077] In one embodiment, such as Figure 3 As shown, a Write Zeroes performance testing method based on solid-state drives (SSDs) is provided. This method includes the following steps before performing a secure erase step on the SSD under test:

[0078] Step 302: Send a command to read the controller data structure using the NVME tool;

[0079] Step 304: Determine whether the SSD under test supports the Write Zeroes command. If it does not support the WriteZeroes command, exit the test.

[0080] Step 306: If the Write Zeroes command is supported, check whether the Write Zeroes command is functioning correctly;

[0081] Step 308: Use FIO to write a fixed data pattern within a certain small range;

[0082] Step 310: Use FIO in conjunction with the Libblkio library that supports Write Zeroes commands and the io_uring driver to perform a small-scale Write Zeroes operation;

[0083] Step 312: Read data within a small range and determine if the read data is all zeros. If it is all zeros, the Write Zeroes function is normal. If the read data is the fixed data pattern to be written, the Write Zeroes function has failed.

[0084] In this embodiment, the open-source Libblkio library and the FIO performance testing tool are used to combine FIO and Libblkio. By reconfiguring and compiling the source code, the new io engine Libblkio is integrated into FIO, enabling FIO to quickly deploy Write Zeroes by configuring the latest io engine libblikio + driver io_uring + path liblkio_path + command trim + libblkio_write_zeroes_on_trim + test scope. See reference... Figure 2 The specific testing procedure for the first half shown is as follows:

[0085] 1. Use the NVME tool to send the id-ctrl command to read the value of bit 3 in the controller data structure byte 520 (ONCS, optional NVM command support, hereinafter referred to as ONCS), and determine whether the SSD under test supports the Write Zeroes command. If bit 3 is 1, it means that the solid-state drive supports the Write Zeroes command; if it is 0, it means that it does not support it, and exit this test.

[0086] 2. If the Write Zeroes command is supported, check whether the Write Zeroes command is functioning properly. A quick way to check is to use FIO's write + check configuration to write and check a small range of 512K (such as LBA0-10) with a fixed data pattern (such as a5, c3) to ensure that the written data meets expectations.

[0087] 3. Using FIO in conjunction with the Libblkio library and io_uring driver that support Write Zeroes commands, execute a small-scale Write Zeroes operation of 512K. A sample configuration is as follows:

[0088] fio--rw=trim--size=512k--ioengine=libblkio--libblkio_driver=io_uring\--libblkio_path= / dev / nvme0n1--name=write-zero\--libblkio_write_zeroes_on_trim--bs=MDTS--iodepth=1--thread=1”

[0089] 4. Use FIO to read the LBA address of the data written in step 2 above, and determine whether the read data is all 0s. If it is all 0s, it means that the Write Zeroes function is normal. If the read data is the data pattern written in step 2 above, it means that the Write Zeroes function FAIL. If it is other data, it means that the read command is abnormal and needs to be read and verified again.

[0090] The subsequent steps are the same as those in the previous embodiment, and will not be repeated here.

[0091] In this embodiment, by integrating the latest libblkio engine and combining it with NVME-cli, a shell script is written in the Linux system to automatically determine whether Write Zeroes is supported and automatically traverse the performance under high and low queue depths and different LBA ranges. Based on the test time and bandwidth, it is determined whether the performance of Write Zeroes meets expectations.

[0092] It should be understood that, although Figures 1-3 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figures 1-3 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0093] In one embodiment, such as Figure 4 As shown, a Write Zeroes performance testing device 400 based on a solid-state drive is provided, the device comprising:

[0094] Erasing module 401, the erasing module is used to safely erase the solid-state drive under test;

[0095] Judgment module 402 is used to read and record MDTS by command and determine whether MDTS is within the expected range. MDTS is the maximum data transmission size. If MDTS is not within the expected range, reading MDTS parameters fails. If MDTS is within the expected range, the block size in FIO is configured.

[0096] The pallet filling module 403 is used to perform FIO pallet filling and is idle for a certain period of time after filling.

[0097] The first test module 404 is used to test the performance of full-disk Write Zeroes under high queue depth and determine whether the test completion time is within the expected time. If it is within the expected time, the Write Zeroes performance meets the expectations and the bandwidth and time of full-disk Write Zeroes are recorded.

[0098] The second test module 405 is used to test the performance of Write Zeroes within a 1GB range under low queue depth and determine whether the test completion time is within the expected time. If it is within the expected time, the performance of Write Zeroes under low queue condition meets expectations and the bandwidth and time corresponding to Write Zeroes and block size are recorded.

[0099] In one embodiment, such as Figure 5 As shown, a Write Zeroes performance testing device 400 based on a solid-state drive is provided. This device also includes a judgment module 406, used for:

[0100] Send commands to read the controller data structure using NVME tools;

[0101] Determine if the SSD under test supports the Write Zeroes command. If it does not support the Write Zeroes command, exit the test.

[0102] In one embodiment, such as Figure 6 As shown, a Write Zeroes performance testing device 400 based on a solid-state drive is provided. This device also includes a function detection module 407, used for:

[0103] If the Write Zeroes command is supported, check if the Write Zeroes command is functioning correctly.

[0104] Use FIO to write fixed data patterns within a certain small range;

[0105] Use FIO in conjunction with the Libblkio library, which supports Write Zeroes commands, and the io_uring driver to perform small-scale Write Zeroes operations;

[0106] Read data within a small range and determine if the read data is all zeros. If it is all zeros, the WriteZeroes function is working properly. If the read data is the fixed data pattern to be written, the WriteZeroes function has failed.

[0107] In one embodiment, the first test module 404 is further configured to:

[0108] If the performance fails to meet expectations, Write Zeroes will fail. Record the bandwidth and time of all Write Zeroes operations for analysis and optimization.

[0109] In one embodiment, the second test module 405 is further configured to:

[0110] If the performance of Write Zeroes fails to meet expectations within the time frame, the performance of Write Zeroes in low queue configuration will fail. Record the bandwidth and time corresponding to Write Zeroes and block size for analysis and optimization.

[0111] For specific limitations on the Write Zeroes performance testing device based on solid-state drives, please refer to the limitations on the Write Zeroes performance testing method based on solid-state drives mentioned above, which will not be repeated here.

[0112] In one embodiment, a computer device is provided, the internal structure of which can be shown as follows: Figure 7 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a solid-state drive-based WriteZeroes performance testing method.

[0113] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0114] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the various method embodiments described above.

[0115] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the various method embodiments described above.

[0116] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0117] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0118] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A Write Zeroes performance testing method based on solid-state drives, the method comprising: By utilizing the open-source Libblkio library and FIO performance testing tools, FIO and Libblkio are combined, and the new io engine Libblkio is integrated into FIO through reconfiguration and source code compilation. Perform a secure erase on the solid-state drive under test; The MDTS is read and recorded by command, and it is determined whether the MDTS is within the expected range. The MDTS is the maximum data transmission size. If MDTS is not within the expected range, reading MDTS parameters will fail. If MDTS is within the expected range, the block size in FIO will be configured and FIO disk filling will be performed. After disk filling, the disk will be idle for a certain period of time. Test the performance of Write Zeroes across the entire disk under high queue depth and determine whether the test completion time is within the expected time. If it is within the expected time, the performance of Write Zeroes meets expectations, and record the bandwidth and time of Write Zeroes across the entire disk. Perform FIO disk filling again, and then leave it idle for a certain period of time after filling. Test the performance of Write Zeroes within a 1GB range under low queue depth and determine whether the test completion time is within the expected time. If it is within the expected time, the performance of Write Zeroes under low queue conditions meets expectations. Record the bandwidth and time corresponding to WriteZeroes and block size.

2. The solid state drive based Write Zeroes performance testing method of claim 1, wherein, The procedure before performing a secure erase on the solid-state drive under test includes: Send commands to read the controller data structure using NVME tools; Determine if the SSD under test supports the Write Zeroes command. If it does not support the Write Zeroes command, exit the test.

3. The solid state drive based Write Zeroes performance testing method of claim 2, wherein, Following the step of determining whether the solid-state drive under test supports the Write Zeroes command, the following is also included: If the Write Zeroes command is supported, check if the Write Zeroes command is functioning correctly. Use FIO to write fixed data patterns within a certain small range; Use FIO in conjunction with the Libblkio library, which supports Write Zeroes commands, and the io_uring driver to perform small-scale Write Zeroes operations; Read data within a small range and determine if the read data is all zeros. If it is all zeros, the Write Zeroes function is working properly. If the read data is the fixed data pattern to be written, the Write Zeroes function has failed.

4. The solid state drive based Write Zeroes performance testing method of claim 1, wherein, Following the steps of testing the performance of full-disk Write Zeroes under high queue depth and determining whether the test completion time is within the expected time, the following is also included: If the performance fails to meet expectations, Write Zeroes will fail. Record the bandwidth and time of all Write Zeroes operations for analysis and optimization.

5. The solid state drive based Write Zeroes performance testing method of claim 4, wherein, Following the steps of testing Write Zeroes' performance within a 1GB range at low queue depths and determining whether the test completion time is within the expected time, the following is also included: If the performance of Write Zeroes fails to meet expectations within the time frame, the performance of Write Zeroes in low queue configuration will fail. Record the bandwidth and time corresponding to Write Zeroes and block size for analysis and optimization.

6. A Write Zeroes performance testing apparatus based on solid state drive, characterized in that, The device utilizes the open-source Libblkio library and FIO performance testing tools to combine FIO and Libblkio. It integrates the new IO engine Libblkio into FIO through reconfiguration and source code compilation. The device includes: An erasure module, which is used to securely erase the solid-state drive under test; The judgment module is used to read and record MDTS through commands and determine whether MDTS is within the expected range. MDTS is the maximum data transfer size. If MDTS is not within the expected range, reading MDTS parameters will fail. If MDTS is within the expected range, the block size in FIO will be configured. The disk filling module is used to perform FIO disk filling and then idles for a certain period of time after filling. The first test module is used to test the performance of full-disk Write Zeroes under high queue depth and determine whether the test completion time is within the expected time. If it is within the expected time, the Write Zeroes performance meets the expectations and the bandwidth and time of full-disk Write Zeroes are recorded. The second test module is used to test the performance of Write Zeroes within a 1GB range under low queue depth and determine whether the test completion time is within the expected time. If it is within the expected time, the performance of Write Zeroes under low queue condition meets the expectations, and the bandwidth and time corresponding to Write Zeroes and block size are recorded.

7. The solid state drive based Write Zeroes performance testing apparatus of claim 6, wherein, The device further includes a support judgment module, the support judgment module being used for: Send commands to read the controller data structure using NVME tools; Determine if the SSD under test supports the Write Zeroes command. If it does not support the Write Zeroes command, exit the test.

8. The solid state drive based Write Zeroes performance testing apparatus of claim 7, wherein, The device further includes a function detection module, which is used for: If the Write Zeroes command is supported, check if the Write Zeroes command is functioning correctly. Use FIO to write fixed data patterns within a certain small range; Use FIO in conjunction with the Libblkio library, which supports Write Zeroes commands, and the io_uring driver to perform small-scale Write Zeroes operations; Read data within a small range and determine if the read data is all zeros. If it is all zeros, the Write Zeroes function is working properly. If the read data is the fixed data pattern to be written, the Write Zeroes function has failed.

9. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.