A disk testing method and device based on FIO testing tool
By entering test parameters on the human-computer interactive interface to update the running script and configuration files of the FIO test tool and making judgments on the system disk, the problem of inability to modify the running script commands and incorrect detection of the system disk in the existing technology is solved, and a fast, accurate and secure disk testing effect is achieved.
Patent Information
- Application Number
- CN202210508602.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-10
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2042-05-10
AI Technical Summary
The existing technology cannot modify the commands in the running script during disk performance testing, which is prone to manual modification errors, and there is a risk of error detection of the system disk, resulting in system crashes and other problems.
The disk testing method based on FIO testing tools is adopted. By entering multiple test parameters on the human-computer interactive interface, the running script and configuration files are updated, and the system disk is judged to ensure the accuracy and security of the test.
It realizes the rapid, accurate and safe testing of detection disks, avoids the problems of manual modification of errors and system disk error detection, and improves the testing efficiency and reliability.
Smart Images

Figure CN114706719B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of server testing, and in particular to a disk testing method and device based on an FIO testing tool. Background Art
[0002] At present, with the development of storage servers, the hardware requirements for storage servers are constantly increasing. With the improvement of CPU, memory, and bus performance, disk performance has become the key to restricting the read and write rate, and the test of disk performance has become increasingly important. There are currently two methods for testing disk performance:
[0003] The first method for testing disk performance is to manually input a test command. However, the manual command input method is not only time-consuming and cumbersome, but also prone to errors when manually inputting commands, causing damage to the disk.
[0004] The second method to test disk performance is to automatically perform disk detection according to preset scripts and configuration files. Although this method will not cause command errors, it is impossible to modify the preset scripts and configuration files, and there is a risk of misjudging the system disk, which can easily cause a series of problems such as system crashes. Summary of the invention
[0005] In view of this, the purpose of the present application is to provide a disk testing method and device based on the FIO testing tool, which can update the running script by inputting multiple test parameters on the human-computer interface, and the method of judging the system disk solves the problems in the prior art that the commands in the running script cannot be modified and manual modification is prone to errors and easy to cause misdetection of the system disk, so as to achieve the effect of quickly, accurately and safely testing the disk to be tested.
[0006] In a first aspect, an embodiment of the present application provides a disk testing method based on an FIO testing tool, the disk testing method comprising: receiving test parameters for a disk to be tested in a server input on a human-computer interaction interface, the test parameters comprising a disk identifier for indicating the disk to be tested, the number of available threads when performing a disk test on the disk to be tested, and multiple file block sizes of file blocks used when performing a disk test; creating multiple test folders corresponding to the multiple file block sizes under a first target folder, the first target folder being a folder for storing benchmark configuration files; using the disk identifier, the number of available threads, and the storage paths of the multiple test folders, respectively updating a test disk flag, an available thread number flag, and a test data read and write path in a benchmark run script to obtain a test run script; determining whether the disk to be tested indicated by the disk identifier includes a system disk of the server; if the disk to be tested does not include a system disk, running the test run script to perform a disk read and write test on the disk to be tested, and generating a disk test result for the disk to be tested.
[0007] Optionally, the disk to be tested includes multiple disks, and the disk test results include multiple disk test results for the multiple disks to be tested, wherein the disk testing method further includes: classifying the multiple disk test results according to the test disk flag in the test running script; storing the classified multiple disk test results in a first target folder under a preset target storage path; and for each disk test result, modifying the read and write running parameters of the disk to be tested corresponding to the disk test result.
[0008] Optionally, the benchmark operation script includes at least one single test item from the following items: sequential read test, sequential write test, random read test, random write test, and the benchmark operation script also records the number of file blocks used when performing disk testing, and the file block size corresponding to each file block is different, wherein the multiple file block sizes are received in the following manner: according to the number of file blocks recorded in the benchmark operation script, a file block size input box corresponding to the number is displayed on the human-computer interaction interface; for each file block size input box, the file block size of the file block corresponding to the file block size input box is determined according to the numerical value entered in the file block size input box.
[0009] Optionally, the benchmark running script also includes a mixed test item for a mixed read and write test, and the disk testing method also includes: displaying a mixed read and write ratio input box on the human-computer interaction interface according to the mixed test items in the benchmark running script; receiving a ratio value entered in the mixed read and write ratio input box, the ratio value being used to characterize the proportion of the test data corresponding to each single test item to the total number of tests for the mixed read and write test; and updating the single mixed read and write ratio corresponding to the mixed read and write test in the test running script according to the ratio value.
[0010] Optionally, the disk to be tested includes a disk cache. When the disk to be tested is performing a sequential read test or a random read test, the test running script stores the data read from the disk to be tested in the disk cache, and then stores the read data in a test data storage file block corresponding to the disk test item through the disk cache. The step of running the test running script to perform a disk read and write test on the disk to be tested includes: determining whether the test running script has completed the sequential read test or the random read test; if the test running script has completed the sequential read test or the random read test, clearing the data in the disk cache; if the test running script has not completed the sequential read test or the random read test, stopping execution of the test running script.
[0011] Optionally, when the disk to be tested is performing a sequential write test or a random write test, the test running script reads data from the test data storage file block corresponding to the disk test item and stores it in the disk cache, and then stores the data stored in the disk cache to the disk to be tested, wherein the step of running the test running script to perform a disk read and write test on the disk to be tested includes: determining whether the test running script has completed the sequential write test or the random write test; if the test running script has completed the sequential write test or the random read and write test, clearing the data in the disk cache; if the test running script has not completed the sequential write test or the random write test, stopping execution of the test running script.
[0012] Optionally, a log record is performed on the disk test process of the test running script, and the log record is stored in a second target folder under a preset log storage path.
[0013] In a second aspect, an embodiment of the present application further provides a disk testing device based on the FIO testing tool, the device comprising:
[0014] A test parameter receiving module is used to receive test parameters for a disk to be tested in a server input on a human-computer interaction interface, wherein the test parameters include a disk identifier for indicating the disk to be tested, the number of available threads when performing a disk test on the disk to be tested, and multiple file block sizes of file blocks used when performing a disk test;
[0015] A file block creation module, used to create a plurality of test folders corresponding to the plurality of file block sizes under a first target folder, wherein the first target folder is a folder for storing a benchmark configuration file;
[0016] A benchmark running script updating module, used to use the disk identifier, the number of available threads and the storage paths of the multiple test folders to respectively update the test disk flag, the number of available threads flag and the test data read and write path in the benchmark running script to obtain a test running script;
[0017] A system disk determination module, used to determine whether the disk to be tested indicated by the disk identifier includes a system disk of the server;
[0018] The disk read / write test module is used to run the test run script to perform a disk read / write test on the disk to be tested if the disk to be tested does not include a system disk, and generate a disk test result of the disk to be tested.
[0019] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus, and when the machine-readable instructions are executed by the processor, the steps of the disk testing method based on the FIO testing tool as described above are performed.
[0020] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the disk testing method based on the FIO testing tool as described above are executed.
[0021] The disk testing method and device based on the FIO test tool provided in the embodiment of the present application can update the running script and configuration file by inputting multiple test parameters on the human-machine interface, and judge the system disk. The problem that the commands in the running script cannot be modified, manual modification is prone to errors, and the system disk is prone to misdetection is solved in the prior art, and the effect of quickly, accurately and safely testing the disk to be tested is achieved.
[0022] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 A flowchart of a disk testing method based on the FIO testing tool provided in an embodiment of the present application;
[0025] Figure 2 A flowchart of another disk testing method based on the FIO testing tool provided in an embodiment of the present application;
[0026] Figure 3 A schematic diagram of the structure of a disk testing device based on the FIO testing tool provided in an embodiment of the present application;
[0027] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0029] First, the application scenarios to which this application is applicable are introduced. This application can be applied to server disk testing.
[0030] Research has found that with the development of storage servers, the hardware requirements for storage servers are increasing. With the improvement of CPU, memory, and bus performance, disk performance has become the key to restricting the read and write rate, and the test of disk performance has become increasingly important. Currently, there are two methods for testing disk performance:
[0031] The first method for testing disk performance is to manually input a test command. However, the manual command input method is not only time-consuming and cumbersome, but also prone to errors when manually inputting commands, causing damage to the disk.
[0032] The second method to test disk performance is to automatically perform disk detection according to preset scripts and configuration files. There will be no command errors, but the preset scripts and configuration files cannot be modified. There is also a risk of misjudging the system disk, which can easily cause a series of problems such as system crashes.
[0033] Based on this, an embodiment of the present application provides a disk testing method based on the FIO testing tool to achieve the effect of accurately, quickly and safely testing the disk.
[0034] See also Figure 1 , Figure 1 A flowchart of a disk testing method based on the FIO testing tool provided in an embodiment of the present application.
[0035] The FIO test tool includes a benchmark configuration file and a benchmark running script, where the test parameters in the benchmark running script and the benchmark configuration file can be updated according to instructions.
[0036] like Figure 1 As shown in , the disk testing method provided by the embodiment of the present application includes:
[0037] S101 : receiving test parameters for a disk to be tested in a server input on a human-computer interaction interface.
[0038] The test parameters include a disk identifier for indicating the disk to be tested, the number of available threads when performing a disk test on the disk to be tested, and multiple file block sizes of file blocks used when performing the disk test.
[0039] Here, there can be multiple disks to be tested. For example, you can enter C, E, and D in the disk identification position in the human-computer interaction interface to test the three disks C, E, and D in the server. Among them, C, E, and D represent the three disk devices sdc, sde, and sdd in the server respectively. The number of available threads of the disk is related to the number of available threads of the server's processor. For example, if the server's processor is a quad-core processor, its number of available threads should be less than 4. Multiple file block sizes should be file block size values of different sizes.
[0040] In this way, the test engineer can input various test parameters in the human-computer interaction interface according to the requirements and the hardware equipment of the server being tested.
[0041] Among them, the benchmark running script includes at least one of the following single test items: sequential read test, sequential write test, random read test, random write test. The benchmark running script also records the number of file blocks used when performing disk testing, and the file block size corresponding to each file block is different.
[0042] Specifically, the sizes of multiple file blocks are received in the following manner: according to the number of file blocks recorded in the benchmark running script, a file block size input box corresponding to the number is displayed on the human-computer interaction interface; for each file block size input box, the file block size of the file block corresponding to the file block size input box is determined according to the numerical value entered in the file block size input box.
[0043] For example, the benchmark operation script records that four file blocks of different sizes are required for read and write tests. At this time, the human-computer interaction interface displays four file block size input boxes on the human-computer interaction interface based on the benchmark operation script. For each file block size input value, a file block corresponding to the input file block size can be automatically generated.
[0044] In this way, the size of the file blocks to be input corresponding to the number of file blocks required to be used in the benchmark running script can be displayed in the human-computer interaction interface.
[0045] Optionally, the type of disk test can also be selected in the human-computer interaction interface, and the types of disk tests include: disk performance test and disk stress test. After selecting different types of disk tests, a benchmark running script corresponding to the test type can be generated according to the different test types and the test parameters.
[0046] Optionally, multiple parameter input boxes can also be set in the human-computer interaction interface, such as: IO bit depth, script running time, script running mode and file reading and writing methods, etc., wherein the IO bit depth is used to set the queue depth of the IO queue when the kernel calls, and the script running mode is used to indicate that the script uses a serial or parallel method to test the disk.
[0047] S102: Create multiple test folders corresponding to the multiple file block sizes under the first target folder.
[0048] The first target folder is a folder for storing the reference configuration file.
[0049] Exemplarily, if the file block sizes input by the test engineer in the human-computer interaction interface are 1, 3, 5, and 7 (megabytes), four test folders are created under the first target folder.
[0050] In this way, a test result file for classifying and performing disk testing can be created under the benchmark configuration file according to the input in the human-computer interaction interface.
[0051] S103, using the disk identifier, the number of available threads and the storage paths of the multiple test folders, respectively updating the test disk flag, the number of available threads flag and the test data read and write path in the benchmark running script to obtain a test running script.
[0052] The test data read / write path automatically generates the test data read / write path corresponding to the test data in the test folder after the test folder is stored in the first folder.
[0053] In this way, the benchmark running script can be updated according to the test data setting by the test engineer in the human-computer interaction interface to obtain the test running script for testing.
[0054] It should be noted that in the disk test script, the read and write modes in the benchmark running script can be defined by inputting through the human-machine interface or directly modifying the code, and the read and write modes include: sync, libaio, vsync, psync and other read and write modes.
[0055] For example, the steps for testing the storage disk in sync mode are as follows: when writing data to the disk to be tested, it is first stored in the disk cache, and then the read data is forced to be stored on the disk through the disk cache, and then a read and write success flag is returned to the kernel to prevent data loss caused by sudden power failure.
[0056] The libaio mode tests the storage disk by asynchronous reading and writing. That is, a batch of IO read and write requests can be submitted from the disk to be tested to the processor at one time, reducing interactions and blocking.
[0057] S104: Determine whether the disk to be tested indicated by the disk identifier includes a system disk of the server.
[0058] Here, whether the disk to be tested indicated by the disk identifier includes the system disk of the server can be determined after receiving the input disk identifier in step S101, or after updating the benchmark running script.
[0059] In this way, the problem of server system crash caused by testing the system disk can be avoided by judging the disk to be tested.
[0060] S105: If the disk to be tested does not include a system disk, run the test running script to perform a disk read and write test on the disk to be tested, and generate a disk test result of the disk to be tested.
[0061] There are multiple disks to be tested, and the disk test result includes multiple disk test results for the multiple disks to be tested.
[0062] Specifically, the disk to be tested includes a disk cache. When the disk to be tested is performing a sequential read test or a random read test, the test running script stores the data read from the disk to be tested in the disk cache, and then stores the read data in a test data storage file block corresponding to the disk test item through the disk cache. The step of running the test running script to perform a disk read and write test on the disk to be tested includes: determining whether the test running script has completed the sequential read test or the random read test; if the test running script has completed the sequential read test or the random read test, clearing the data in the disk cache; if the test running script has not completed the sequential read test or the random read test, stopping execution of the test running script.
[0063] When the disk to be tested is performing a sequential write test or a random write test, the test running script reads data from the test data storage file block corresponding to the disk test item and stores it in the disk cache, and then stores the data stored in the disk cache to the disk to be tested, wherein the step of running the test running script to perform a disk read and write test on the disk to be tested includes: determining whether the test running script has completed the sequential write test or the random write test; if the test running script has completed the sequential write test or the random read and write test, clearing the data in the disk cache; if the test running script has not completed the sequential write test or the random write test, stopping execution of the test running script.
[0064] Specifically, the test results include data on disk read and write speed and stability under different threads, different read and write pressures (read and write durations), and different file block size test conditions.
[0065] In this way, the read and write speed and stability of the disk in the server under different read and write conditions can be obtained.
[0066] Optionally, the benchmark running script can also identify the disk to be tested and determine whether the disk to be tested is a multi-disk environment. If the disk to be tested is a multi-disk environment, serial and parallel reading and writing are judged on the disk to be tested; if the disk to be tested is a single-disk environment, serial and parallel reading and writing are not judged.
[0067] Optionally, if the disks to be tested include a system disk, the read and write test is not performed on the system disk, and a prompt message indicating that the system disk cannot be tested is displayed in the human-computer interaction interface.
[0068] Optionally, the benchmark running script also includes: a test mode flag, and the human-computer interaction interface also includes test mode selection items for serial testing, parallel testing, and serial and parallel simultaneous testing.
[0069] Specifically, the disk test method further includes: updating the test mode flag in the benchmark running script according to the selection of the test mode selection item received in the human-computer interaction interface to obtain the test running script.
[0070] Optionally, when performing a disk test on the disk to be tested, it is also necessary to determine the disk type so as to identify the type of the disk to be tested in the disk test result.
[0071] Optionally, the benchmark running script also includes a mixed test item for a mixed read and write test, and the disk testing method also includes: displaying a mixed read and write ratio input box on the human-computer interaction interface according to the mixed test items in the benchmark running script; receiving a ratio value entered in the mixed read and write ratio input box, the ratio value being used to characterize the proportion of the test data corresponding to each single test item to the total number of tests for the mixed read and write test; and updating the single mixed read and write ratio corresponding to the mixed read and write test in the test running script according to the ratio value.
[0072] Optionally, if the benchmark running script does not include a mixed read-write test, the mixed read-write ratio input box is not displayed in the human-computer interaction interface.
[0073] Exemplarily, the total number of mixed read and write tests is 100 megabytes, and the received mixed read and write ratio value is 1:2:3:4. The updated test run script controls the mixed read and write test sequence to perform a 10-megabyte sequential read test, a 20-megabyte sequential write test, a 30-megabyte random read test, and a 40-megabyte random read test.
[0074] In this way, the ratios of various mixed read-write tests of the mixed read-write test can be controlled according to the input in the human-computer interaction interface.
[0075] Optionally, the human-computer interaction interface also includes a mixed read-write type option, the mixed read-write type includes random read-write or sequential read-write, and the mixed read-write type in the test run script is updated according to the selection of the mixed read-write type entered in the human-computer interaction interface.
[0076] Optionally, the disk testing method further comprises: logging the disk testing process of the test running script, and storing the log record in a second target folder under a preset log storage path.
[0077] The log records the execution process of the script, for example, the script controls the server to read the first file block from the first target folder and store the data in the first file block in the D disk.
[0078] Here, the preset log storage path can be a storage address in the server where the disk to be detected is located, or a storage address of other storage devices connected to the server where the disk to be detected is located. Before storing the log records, the log records can also be analyzed and classified, and different types of logs can be stored in different log record folders.
[0079] The embodiment of the present application provides a disk testing method based on the FIO test tool. By updating the running script and configuration file by inputting multiple test parameters on the human-computer interface and judging the system disk, the method solves the problems in the prior art that the commands in the running script cannot be modified and manual modification is prone to errors and easy to cause misdetection of the system disk, thereby achieving the effect of quickly, accurately and safely testing the disk to be tested according to the input of the test parameters on the human-computer interaction interface.
[0080] See also Figure 2 , Figure 2 This is a flowchart of a disk testing method based on the FIO testing tool provided in another embodiment of the present application. Figure 2 As shown in , the disk testing method based on the FIO testing tool provided in the embodiment of the present application includes:
[0081] S201 : receiving test parameters for a disk to be tested in a server input on a human-computer interaction interface.
[0082] S202: Create multiple test folders corresponding to the multiple file block sizes under the first target folder.
[0083] S203, using the disk identifier, the number of available threads and the storage paths of the multiple test folders, respectively update the test disk flag, the number of available threads flag and the test data read and write path in the benchmark running script to obtain a test running script.
[0084] S204: Determine whether the disk to be tested indicated by the disk identifier includes a system disk of the server.
[0085] S205: If the disk to be tested does not include a system disk, run the test running script to perform a disk read and write test on the disk to be tested, and generate a disk test result of the disk to be tested.
[0086] Among them, the description of S201 to S205 can refer to the description of S101 to S105, and can achieve the same technical effect, which is not repeated here.
[0087] S206: Classify the multiple disk test results according to the test disk flags in the test running script.
[0088] Exemplarily, after the test running script is completed, all test data of multiple disks to be tested will be obtained, and all test data related to the test results of the multiple disks can be classified together.
[0089] S207: Store the classified multiple disk test results in a first target folder under a preset target storage path.
[0090] Here, the target storage path is used to indicate a storage address for storing multiple disk test results.
[0091] S208 . For each disk test result, modify the read / write operation parameters of the disk to be tested corresponding to the disk test result according to the log record corresponding to the disk test result and the disk test result.
[0092] Among them, the disk test results include data on disk read and write speed and stability under different threads, different read and write pressures (read and write time), and different file block size test conditions.
[0093] The read and write operation parameters include the system's kernel parameters and IO scheduling methods.
[0094] For example, the test results of drive D are as follows: in a single thread, the average speed for sequentially reading 20-megabyte file blocks for 500 seconds is 2 megabytes per second, with a stability fluctuation of plus or minus 0.1 megabytes per second; in a single thread, the average speed for sequentially reading 20-megabyte file blocks for 600 seconds is 1.8 megabytes per second, with a stability fluctuation of 0.2 megabytes per second, and so on.
[0095] According to the different read and write test results of each disk, we can obtain the stability change curves of the read and write time and read and write stability of reading and writing file blocks of different sizes under different threads, and the read and write time and read and write speed change curves.
[0096] According to the speed change curves and stability change curves of reading and writing different file blocks under different threads, we can get the optimal speed and stability values of the disk when reading and writing file blocks of different sizes with different numbers of threads.
[0097] Based on multiple optimal speed values and optimal stability values, it can be determined how many threads have the best speed and stability for reading and writing file blocks. For example, the best speed for sequentially reading 40-megabyte file blocks under four threads is 4 megabytes per second and the best stability is plus or minus 0.03. Then, the sequential read operation parameters of the disk are adjusted. When performing the sequential read process, the file to be read is divided into 40-megabyte file blocks and read at a speed of 4 megabytes per second.
[0098] In this way, the disk parameters can be adjusted according to the results of the disk test to make the disk reach the optimal operating state.
[0099] Another disk testing method based on the FIO test tool provided in the embodiment of the present application is a method that can update the running script and configuration file by inputting multiple test parameters on the human-computer interface, and judge the system disk. The problem existing in the prior art that the commands in the running script cannot be modified and manual modification is prone to errors and easy to cause misdetection of the system disk is solved, and the effect of quickly, accurately and safely testing the disk to be tested and optimizing the running parameters of the disk is achieved according to the input of the test parameters on the human-computer interaction interface.
[0100] Based on the same inventive concept, the embodiments of the present application also provide a disk testing device based on the FIO testing tool corresponding to the disk testing method based on the FIO testing tool. Since the principle of solving the problem by the device in the embodiments of the present application is similar to the above-mentioned disk testing method based on the FIO testing tool in the embodiments of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0101] See also Figure 3 , Figure 3 A structural diagram of a disk testing device based on the FIO testing tool provided in an embodiment of the present application is shown in FIG. Figure 3 As shown in , the disk testing device 300 comprises:
[0102] The test parameter receiving module 301 is used to receive the test parameters for the disk to be tested in the server input on the human-computer interaction interface, and the test parameters include a disk identifier for indicating the disk to be tested, the number of available threads when performing a disk test on the disk to be tested, and multiple file block sizes of the file blocks used when performing the disk test.
[0103] The file block creation module 302 is used to create a plurality of test folders corresponding to the plurality of file block sizes under a first target folder, where the first target folder is a folder for storing a benchmark configuration file.
[0104] The benchmark running script updating module 303 is used to use the disk identifier, the number of available threads and the storage paths of the multiple test folders to respectively update the test disk flag, the number of available threads flag and the test data read and write path in the benchmark running script to obtain the test running script.
[0105] The system disk determination module 304 is used to determine whether the disk to be tested indicated by the disk identifier includes the system disk of the server.
[0106] The disk read / write test module 305 is used to run the test run script to perform a disk read / write test on the disk to be tested if the disk to be tested does not include a system disk, and generate a disk test result of the disk to be tested.
[0107] The disk test device based on the FIO test tool provided in the embodiment of the present application can update the running script and configuration file by inputting multiple test parameters on the human-computer interface, and can judge the system disk. The problem existing in the prior art that the commands in the running script cannot be modified and manual modification is prone to errors and easy to cause misdetection of the system disk is solved, and the effect of quickly, accurately and safely testing the disk to be tested and optimizing the running parameters of the disk is achieved according to the input of the test parameters on the human-computer interaction interface.
[0108] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown in , the electronic device 400 includes a processor 410 , a memory 420 and a bus 430 .
[0109] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned Figure 1 as well as Figure 2 The steps of the disk testing method based on the FIO testing tool in the method embodiment shown in the figure, the specific implementation method can be found in the method embodiment, and will not be repeated here.
[0110] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 as well as Figure 2 The specific implementation of the steps of the disk testing method in the method embodiment shown can be found in the method embodiment, and will not be repeated here.
[0111] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0112] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0113] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0114] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0115] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0116] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A disk testing method based on FIO testing tool, characterized in that: The FIO test tool includes a benchmark configuration file and a benchmark running script, and the method includes: Receiving test parameters for a disk to be tested in a server input on a human-computer interaction interface, the test parameters including a disk identifier for indicating the disk to be tested, the number of available threads when performing a disk test on the disk to be tested, and multiple file block sizes of file blocks used when performing the disk test; Creating a plurality of test folders corresponding to the plurality of file block sizes under a first target folder, wherein the first target folder is a folder for storing a benchmark configuration file; Using the disk identifier, the number of available threads, and the storage paths of the multiple test folders, respectively update the test disk flag, the number of available threads flag, and the test data read and write path in the benchmark running script to obtain a test running script; Determine whether the disk to be tested indicated by the disk identifier includes a system disk of the server; If the disk to be tested does not include a system disk, the test running script is run to perform a disk read and write test on the disk to be tested, and a disk test result of the disk to be tested is generated.
2. The method according to claim 1, characterized in that The disk testing method further comprises: Log the disk test process of the test running script, and store the log record in a second target folder under a preset log storage path.
3. The method according to claim 2, characterized in that The disks to be tested include multiple disks, and the disk test results include multiple disk test results for the multiple disks to be tested. Wherein, the method further comprises: Classifying the plurality of disk test results according to the test disk flags in the test run script; The classified multiple disk test results are stored in a first target folder under a preset target storage path; For each disk test result, the read / write operation parameters of the disk to be tested corresponding to the disk test result are modified according to the log record corresponding to the disk test result and the disk test result.
4. The method according to claim 1, characterized in that: The benchmark operation script includes at least one single test item from the following items: sequential read test, sequential write test, random read test, random write test, and the benchmark operation script also records the number of file blocks used when performing the disk test, and the file block size corresponding to each file block is different. The multiple file block sizes are received in the following manner: According to the number of file blocks recorded in the benchmark running script, displaying a file block size input box corresponding to the number on the human-computer interaction interface; For each file block size input box, the file block size of the file block corresponding to the file block size input box is determined according to the value input in the file block size input box.
5. The method according to claim 4, characterized in that The benchmark operation script also includes a mixed test item for a mixed read-write test, and the disk test method also includes: According to the mixed test items in the benchmark running script, displaying a mixed read-write ratio input box on the human-computer interaction interface; receiving a ratio value input in the hybrid read-write ratio input box, the ratio value being used to represent a ratio of the test data corresponding to each single test item to the total number of tests for the hybrid read-write test; According to the ratio value, the single mixed read-write ratio corresponding to the mixed read-write test in the test running script is updated.
6. The method according to claim 4, characterized in that The disk to be tested includes a disk cache. When the disk to be tested performs a sequential read test or a random read test, the test running script stores the data read from the disk to be tested in the disk cache, and then stores the read data in a test data storage file block corresponding to the disk test item through the disk cache. The step of running the test running script to perform a disk read and write test on the disk to be tested includes: Determine whether the test execution script has completed the sequential read test or the random read test; If the test running script completes the sequential read test or the random read test, clear the data in the disk cache; If the test running script does not complete the sequential read test or the random read test, the test running script is stopped.
7. The method according to claim 4, characterized in that When the disk to be tested is performing a sequential write test or a random write test, the test running script reads data from the test data storage file block corresponding to the disk test item and stores it in the disk cache, and then stores the data stored in the disk cache in the disk to be tested. The step of running the test running script to perform a disk read and write test on the disk to be tested includes: Determine whether the test running script has completed the sequential write test or the random write test; If the test running script completes the sequential write test or the random read and write test, clear the data in the disk cache; If the test running script does not complete the sequential write test or the random write test, the execution of the test running script is stopped.
8. A disk testing device based on the FIO testing tool, characterized in that: The FIO test tool includes a benchmark configuration file and a benchmark running script, and the disk test device includes: A test parameter receiving module is used to receive test parameters for a disk to be tested in a server input on a human-computer interaction interface, wherein the test parameters include a disk identifier for indicating the disk to be tested, the number of available threads when performing a disk test on the disk to be tested, and multiple file block sizes of file blocks used when performing a disk test; A file block creation module, used to create a plurality of test folders corresponding to the plurality of file block sizes under a first target folder, wherein the first target folder is a folder for storing a benchmark configuration file; A benchmark running script updating module, used to use the disk identifier, the number of available threads and the storage paths of the multiple test folders to respectively update the test disk flag, the number of available threads flag and the test data read and write path in the benchmark running script to obtain a test running script; A system disk determination module, used to determine whether the disk to be tested indicated by the disk identifier includes a system disk of the server; The disk read / write test module is used to run the test run script to perform a disk read / write test on the disk to be tested if the disk to be tested does not include a system disk, and generate a disk test result of the disk to be tested.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of any method as claimed in claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Virtual machine migration method, server and computer storage medium
CN111796903A
Method and device for visually testing disk stability and storage medium
CN114153669A