Hard disk performance automated testing method, device, electronic equipment and storage medium
By automatically obtaining the hard disk list, adjusting the fan speed and generating test configuration files, the existing hard disk performance testing methods cannot accurately reflect the hard disk read and write efficiency, and efficient and accurate hard disk performance testing is achieved.
Patent Information
- Application Number
- CN202111359630.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2041-11-17
AI Technical Summary
Existing hard disk performance testing methods cannot accurately reflect the hard disk's read and write efficiency in complex environments, and a lot of manual configuration is required during the test, resulting in inefficient testing.
By automatically obtaining the list of hard disks to be tested, modifying the BMC fan power management mode to manual mode, adjusting the fan speed according to the preset fan speed configuration file, dynamically generate test configuration files, perform performance testing, and considering the impact of fan vibration on hard disk performance.
It realizes that the read and write efficiency of the hard disk is accurately reflected in the case of considering the impact of fan vibration, and greatly reduces the number of configuration files required for testing, improving the testing efficiency.
Smart Images

Figure CN114049909B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and specifically relates to a hard disk performance automated testing method, device, electronic equipment and storage medium. Background Art
[0002] With the rapid development of Internet technology, the development of informatization, big data and cloud computing has placed higher and higher requirements on server performance. A large amount of important data generated by the server during use is stored in the hard disk on the server, so the performance of the hard disk will directly affect the performance of the server. As a result, many server manufacturers are constantly improving the methods of hard disk performance testing to improve the accuracy and quality of the test.
[0003] Most of the current hard disk performance tests are stress tests. For example, using the fio tool to stress test the hard disk. Although this test method plays a vital role in verifying the stability and reliability of the hard disk, it cannot accurately reflect the read and write efficiency of the hard disk in a complex environment. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a hard disk performance automated testing method, device, electronic device and storage medium to improve the problem that the existing testing method cannot accurately reflect the read and write efficiency of the hard disk.
[0005] The embodiment of the present application is implemented as follows:
[0006] In the first aspect, the embodiment of the present application provides a method for automated testing of hard disk performance, including: automatically obtaining a list of hard disks to be tested of a test machine; automatically changing the fan power management mode of the BMC to manual mode, and automatically adjusting the fan speed according to a preset fan speed configuration file; for each hard disk to be tested in the list of hard disks to be tested, dynamically generating a corresponding test configuration file according to the hard disk to be tested and preset test configuration parameters, and testing the performance of the hard disk to be tested at the adjusted speed based on the test configuration file to obtain a test result. In the embodiment of the present application, when testing the hard disk performance, by taking into account the vibration generated by the rotation of the fan, the vibration generated when the fan rotates will cause the hard disk to vibrate, that is, taking into account the impact of the hard disk vibration on the hard disk performance, so that the read and write efficiency of the hard disk can be accurately reflected. At the same time, the corresponding test configuration file can be automatically generated during the test process, which can greatly reduce the number of configuration files that need to be configured in advance for the test and improve the test efficiency.
[0007] In combination with a possible implementation of the first aspect, the preset fan speed configuration file includes a plurality of speeds of different sizes; the automatic adjustment of the fan speed according to the preset fan speed configuration file includes: according to the plurality of speeds in the preset fan speed configuration file, the fan speed of the fan is automatically adjusted in sequence from small to large; wherein, when the performance test of each hard disk to be tested is completed at the current speed, the fan speed of the fan is automatically adjusted from the current speed to the next speed until all speeds are traversed. In the embodiment of the present application, by presetting a plurality of speeds of different sizes (different speeds correspond to different vibrations), when adjusting the speed, the fan speed of the fan is automatically adjusted in sequence from small to large, and when the performance test of each hard disk to be tested is completed at the current speed, the fan speed of the fan is automatically adjusted from the current speed to the next speed until all speeds are traversed, so that the impact of different fan speeds on hard disk performance can be tested.
[0008] In combination with a possible implementation of the first aspect, the performance of the hard disk to be tested at the adjusted rotation speed is tested based on the test configuration file to obtain a test result, including: based on the test configuration file, the hard disk to be tested at the adjusted rotation speed is tested for a preset number of random writes of the first preset size and a sequential write of the second preset size, and the test data of each random write of the first preset size and the test data of the sequential write of the second preset size are automatically obtained. In the embodiment of the present application, the hard disk to be tested is tested for a preset number of random writes of the first preset size and a sequential write of the second preset size at the same time to test the performance impact of different write modes at the adjusted rotation speed.
[0009] In combination with a possible implementation manner of the first aspect embodiment, the test data includes IOPS and hard disk transmission bandwidth; after obtaining the test results, the method further includes: automatically generating a test report based on the test results of each hard disk to be tested, wherein the test report includes the IOPS and hard disk transmission bandwidth of each first preset size random write and the IOPS and hard disk transmission bandwidth of the second preset size sequential write at each fan speed for each hard disk to be tested, the average IOPS and hard disk transmission bandwidth of the first preset size random write for the preset number of times and the average IOPS and hard disk transmission bandwidth of the second preset size sequential write for each hard disk to be tested at each fan speed, the decay rate of the average IOPS of the first preset size random write at the lowest fan speed of each hard disk to be tested and the average IOPS of the first preset size random write at the remaining fan speeds, the decay rate of the average hard disk transmission bandwidth of the first preset size random write, the decay rate of the average IOPS of the second preset size sequential write, and the decay rate of the average hard disk transmission bandwidth of the second preset size sequential write. In the example of the present application, the average IOPS of random writes of the first preset size, the average hard disk transmission bandwidth of random writes of the first preset size, the average IOPS of sequential writes of the second preset size, and the average hard disk transmission bandwidth of sequential writes of the second preset size are taken as benchmark tests at the lowest fan speed of the system, so as to obtain the decay rate of the average IOPS of random writes of the first preset size, the decay rate of the average hard disk transmission bandwidth of random writes of the first preset size, the decay rate of the average IOPS of sequential writes of the second preset size, and the decay rate of the average hard disk transmission bandwidth of sequential writes of the second preset size at the remaining fan speeds; in this way, it can be verified whether the fan is reasonably designed, and in this way, the design of insufficient hard disk protection in server research and development and design can be found out, product quality and customer satisfaction can be improved, and the problem of high server hard disk failure rate caused by unreasonable fan design can be avoided.
[0010] In combination with a possible implementation of the first aspect of the embodiment, the preset test configuration parameters include: fixed test configuration parameters and hard disk read and write mode (rw) that needs to be dynamically set, single read and write data size (bs) and hard disk number (sdx); dynamically generate a corresponding test configuration file according to the hard disk to be tested and the preset test configuration parameters, including: automatically assigning the value of the hard disk number to the number of the hard disk to be tested, and automatically assigning the hard disk read and write mode and the single read and write data size according to the test requirements; generating a corresponding test configuration file according to the fixed test configuration parameters and the hard disk read and write mode after assignment, the single read and write data size and the hard disk number. In the embodiment of the present application, by setting some general test configuration parameters, and for some personalized parameters that need to be modified (such as the above-mentioned sdx, rw, bs), it is not set (assigned), the automation program will automatically assign values dynamically according to the program settings, and then automatically generate the corresponding test configuration file based on the fixed test configuration parameters and the personalized parameters after assignment, which can greatly reduce the number of configuration files that need to be configured in advance for the test and improve the test efficiency.
[0011] In combination with a possible implementation of the first aspect, obtaining a list of hard disks to be tested includes: obtaining a list of all hard disks of the test machine; automatically removing solid-state hard disks and system disks from the list of all hard disks to obtain the list of hard disks to be tested. In the embodiment of the present application, since the reading and writing of solid-state hard disks are not affected by mechanical vibrations, solid-state hard disks are automatically removed during testing, and in order to avoid downtime caused by the test, system disks are also automatically removed.
[0012] In combination with a possible implementation of the embodiment of the first aspect, the performance of the hard disk to be tested includes write performance, and before the performance of the hard disk to be tested under the adjusted rotation speed is tested based on the test configuration file, the method further includes: automatically turning off the write cache function of the hard disk to be tested. In the embodiment of the present application, during the test, the write cache function of the hard disk to be tested is automatically turned off, so that when writing data, the cache of the machine to be tested can be skipped, and the hard disk can be written directly, which can more accurately reflect the impact of different fan speeds on the hard disk write performance.
[0013] In combination with a possible implementation of the embodiment of the first aspect, after the test results are obtained, the method further includes: automatically restoring the settings modified by the test machine during the test to the settings before the test, including automatically restoring the fan power management mode of the BMC from the manual mode to the automatic mode. In the embodiment of the present application, after the test is completed, the settings modified by the test machine during the test are automatically restored to the settings before the test to prevent the normal use of the test machine from being affected.
[0014] In the second aspect, the embodiment of the present application also provides an automatic hard disk performance test device, including: an acquisition module, a setting module and a test module. The acquisition module is used to automatically acquire the list of hard disks to be tested of the test machine; the setting module is used to automatically change the fan power management mode of the BMC to the manual mode, and automatically adjust the fan speed according to the preset fan speed configuration file; the test module is used to dynamically generate a corresponding test configuration file for each hard disk to be tested in the list of hard disks to be tested according to the hard disk to be tested and the preset test configuration parameters, and test the performance of the hard disk to be tested at the adjusted speed based on the test configuration file to obtain the test result.
[0015] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory and a processor, the processor being connected to the memory; the memory being used to store programs; the processor being used to call the programs stored in the memory to execute the method provided in the above-mentioned first aspect embodiment and / or any possible implementation method in combination with the first aspect embodiment.
[0016] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method provided by the above-mentioned first aspect embodiment and / or any possible implementation method in combination with the first aspect embodiment is executed.
[0017] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by implementing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings without creative work. As shown in the drawings, the above and other purposes, features and advantages of the present application will be clearer. The same reference numerals indicate the same parts in all the drawings. The drawings are not deliberately scaled to the actual size, and the focus is on showing the main purpose of the present application.
[0019] Figure 1 A flow chart of a hard disk performance automation testing method provided in an embodiment of the present application is shown.
[0020] Figure 2A flow chart of another method for automated hard disk performance testing provided in an embodiment of the present application is shown.
[0021] Figure 3 A module schematic diagram of a hard disk performance automatic testing device provided in an embodiment of the present application is shown.
[0022] Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0023] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0024] It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it is not necessary to further define and explain it in the subsequent drawings. At the same time, in the description of this application, relational terms such as "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements limited by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.
[0025] Furthermore, the term "and / or" in this application is merely a term used to describe the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone.
[0026] The inventor discovered during the process of developing this application that when the hard disk is reading and writing, the rotating airflow generated by the high-speed rotation of the hard disk platter will cause the magnetic head to float above the platter. When the mechanical arm moves horizontally to read data, the rotating airflow will generate torque, causing the mechanical arm to vibrate itself, thereby reducing the hard disk's own reading and writing efficiency. In addition, when there is a large vibration from the outside world transmitted to the inside of the hard disk, or a small vibration that can resonate with the hard disk itself, it will also cause the internal vibration of the hard disk to intensify, thereby reducing the hard disk's own reading and writing efficiency. The defects existing in the above schemes are all the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the embodiments of the present invention below for the above problems should all be the contributions made by the inventor to the present invention during the process of the invention.
[0027] Therefore, the embodiment of the present application provides an automated hard disk performance testing method to solve the problem that the existing stress test cannot accurately reflect the hard disk read and write efficiency. In the embodiment of the present application, by taking into account the vibration generated by the rotation of the fan, that is, taking into account the impact of the hard disk vibration on the hard disk performance, the hard disk read and write efficiency can be accurately reflected. In addition, it can also be found that the hard disk protection is insufficient in the server R&D design, so as to improve it, so as to improve product quality and customer satisfaction.
[0028] The following will be combined Figure 1 , the hard disk performance automated testing method provided in the embodiment of the present application is described.
[0029] S1: Automatically obtain the hard disk list to be tested on the test machine.
[0030] When the hard disk performance of the test machine needs to be tested, obtain the list of hard disks to be tested of the test machine. In one embodiment, the list of hard disks to be tested can be obtained in advance, such as being obtained in advance and saved in a database, and when it is needed, it can be directly obtained from the database. In another optional embodiment, it can be obtained when the hard disk performance of the test machine is tested.
[0031] The test machine may be a server.
[0032] Optionally, the process of obtaining the hard disk list to be tested may be: first obtain the list of all hard disks of the test machine, then automatically remove the solid-state hard disk and the system disk from the list of all hard disks to obtain the list of hard disks to be tested, that is, the list of hard disks to be tested may be the list of hard disks remaining after the solid-state hard disk and the system disk are automatically removed from the list of all hard disks. For example, the automation program reads the hard disk list of the system through the lsscsi command of the Linux system, then reads the hard disk information through smartmontools (an open source hard disk detection tool) and uses the screening parameters to determine whether the hard disk is a solid-state hard disk, then removes the solid-state hard disk from the hard disk list, then uses the lsblk command of the Linux system and uses the boot keyword to screen the system disk, then removes the system disk from the hard disk list, and the remaining hard disk list is the list of hard disks to be tested.
[0033] It should be noted that when executing the hard disk performance automation test method provided by this application, the system needs to install the test tools required for the test, such as the Python3 tool (used to provide the test environment required for the test), the hdparm tool (used to turn off or restore the hard disk write cache function), the fio tool (used for read and write testing), the ipmitool tool (used to control the fan power management mode and speed control of the BMC (Baseboard Manager Controller)), smartmontools (used to read hard disk information and determine the hard disk type (mechanical hard disk or solid state drive)), etc. When executing the hard disk performance automation test method provided by this application, the automation program will detect whether the test tools required for the test are installed in the system. If not, it will automatically call the program installation scripts corresponding to these test tools to install the required test tools.
[0034] S2: Automatically change the fan power management mode of the BMC to manual mode, and automatically adjust the fan speed according to the preset fan speed configuration file.
[0035] To ensure that the fan rotates at the required speed during the test, you need to automatically change the fan power management mode of the BMC to manual mode, and then automatically adjust the fan speed according to the preset fan speed configuration file.
[0036] In one implementation mode, the automation program can be to modify the fan power management mode of the BMC to the manual mode through the ipmitool tool, and then control the BMC to adjust the fan speed through the ipmitool tool according to the preset fan speed configuration file. After the adjustment, the program will wait for a period of time, such as 2 minutes, and perform subsequent operations after the fan speed and airflow are stable. For example, the automation program can modify the fan power management mode of the BMC to the manual mode by calling the ipmitool tool to execute the command (ipmitool raw 0x3a 0x0b 0 00x1e). When the fan power management mode of the BMC is in the manual mode, the automation program adjusts the fan speed accordingly by calling the ipmitool tool to execute the command (ipmitool raw 0x3a 0x0d 0xff speed). For example, if the speed in the command is 20% (duty cycle), the command is ipmitoolraw 0x3a 0x0d 0xff 20, then the corresponding adjustment of the fan speed is 20%.
[0037] The speed data required for testing the fan is saved in the configuration file. The automation program will automatically read these values and set the fan speed according to the program execution requirements. You can set multiple different speed duty cycles, such as [20, 30, 40, 50, 60, 70, 80, 90, 100]. The fan speed in the configuration file can be changed by the user according to actual needs. At the same time, once the speed set by the user exceeds the range controlled by the BMC, the automation program will remind the user to reset the speed.
[0038] Optionally, the preset fan speed configuration file contains multiple speeds of different sizes; the process of automatically adjusting the fan speed according to the preset fan speed configuration file can be: according to the multiple speeds in the preset fan speed configuration file, the fan speed is automatically adjusted in sequence from small to large. Wherein, when the performance test of each hard disk to be tested at the current speed is completed, the fan speed of the fan is automatically adjusted from the current speed to the next speed until all speeds are traversed. For example, assuming that the preset fan speed configuration file contains three speeds, namely speed 1, speed 2, and speed 3, and speed 1 is less than speed 2 and less than speed 3, the fan speed is automatically adjusted to speed 1 at the beginning, and after the performance test of each hard disk to be tested at speed 1 is completed, the fan speed is automatically adjusted to speed 2, and after the performance test of each hard disk to be tested at speed 2 is completed, the fan speed is automatically adjusted to speed 3 until all speeds are traversed.
[0039] S3: For each hard disk to be tested in the hard disk to be tested list, a corresponding test configuration file is dynamically generated according to the hard disk to be tested and preset test configuration parameters, and the performance of the hard disk to be tested at the adjusted rotation speed is tested based on the test configuration file to obtain a test result.
[0040] For each hard disk to be tested in the hard disk to be tested list, the automation program dynamically and automatically generates a corresponding test configuration file based on the hard disk to be tested and the preset test configuration parameters, and then tests the performance of the hard disk to be tested at the adjusted rotation speed based on the test configuration file to obtain the test result. For example, the automation program will automatically generate a corresponding test configuration file based on the hard disk to be tested list obtained above and the preset test configuration parameters, and execute the test configuration file through the fio tool to test the performance of the hard disk to be tested at the adjusted rotation speed. After each execution of the fio tool, the test log is parsed and the test result of the test is saved.
[0041] Optionally, the preset test configuration parameters include: fixed test configuration parameters and the hard disk read and write mode (rw), the single read and write data size (bs) and the hard disk number (sdx) that need to be dynamically set; the process of dynamically generating a corresponding test configuration file based on the hard disk to be tested and the preset test configuration parameters can be: automatically assigning the value of the hard disk number to the number of the hard disk to be tested, and automatically assigning the hard disk read and write mode and the single read and write data size according to the test requirements; generating a corresponding test configuration file based on the fixed test configuration parameters and the assigned hard disk read and write mode, the single read and write data size and the hard disk number.
[0042] For ease of understanding, the following is an example. In one implementation, the preset test configuration parameters mainly include the following:
[0043] Global settings:
[0044] ioengine=libaio #The io engine used by fio, the default is libaio;
[0045] rw=#hard disk read and write mode, usually random write randwrite or sequential write write, fill in as needed;
[0046] bs=#single io block size, usually the first preset size (such as 4k) or the second preset size (such as 256k), fill in as needed;
[0047] direct=1#Bypass the machine's own buffer and read and write directly;
[0048] iodepth=8#Set the io queue depth, which is only useful for asynchronous io;
[0049] runtime=120#Specify the test time as 120 seconds;
[0050] refill_buffers#Force refilling of read and write cache;
[0051] time_based #Set up time-based testing;
[0052] thread#Use pthread_create to create a thread;
[0053] randrepeat = 0 # means that the sequence generated each time the execution is repeated is the same;
[0054] norandommap# specifies fio to obtain a new random offset each time;
[0055] ramp_time=30 #fio waits for 30 seconds before running;
[0056] new_group#Display results by group;
[0057] group_reporting#Displays the results and summarizes the information of each process;
[0058] name = fio testing...#job name, the name of the output information;
[0059] Hard disk under test
[0060] [sdx]
[0061] Filename = / dev / sdx#The drive letter of the hard disk to be tested. x is the number of the hard disk. Fill it in as needed.
[0062] The above rw can be set to random write randwrite or sequential write write, and bs is the size of the io block, which can be set to the first preset size, such as 4K or the second preset size, such as 256K. The automation program will automatically set these two options dynamically according to the program settings. The hard disk sdx to be tested is also dynamically generated according to the hard disk list obtained earlier. The automation program will dynamically save these settings in a configuration file named config. By calling the fio tool to execute the fio config command, fio can be started to perform the test.
[0063] In the embodiment of the present application, by setting some general (fixed) test configuration parameters (such as the parameters other than sdx, rw, and bs in the above-mentioned preset test configuration parameters), and for some personalized parameters that need to be modified (such as the above-mentioned sdx, rw, and bs), it is not necessary to set (assign values), the automation program will automatically set them dynamically according to the program settings, and automatically generate corresponding test configuration files, which can greatly reduce the number of configuration files that need to be configured in advance for the test and improve the test efficiency. For example, if a sequential write operation test is to be performed on the hard disk 1 to be tested, rw is set to sequential write, bs is set to the second preset size, and x in sdx is set to 1, and then based on the assigned personalized parameters and fixed test configuration parameters, the corresponding test configuration file can be automatically generated, and then the test configuration file can be used to perform a sequential write test on the hard disk 1 to be tested.
[0064] In one embodiment, the performance test of the hard disk to be tested may refer to testing the read and write performance of the hard disk to be tested. Since the time required to read data is much smaller than the time required to write data, in one embodiment, the performance test of the hard disk to be tested may refer to testing the write performance of the hard disk to be tested. When performing the write performance test, the first preset size, such as a 4k random write test, may be performed, or the second preset size, such as a 256K sequential write test. Of course, both the first preset size, such as a 4k random write, and the second preset size, such as a 256K sequential write, may be tested. It should be noted that the first preset size is not limited to 4k, and may also be 8k, etc. Similarly, the second preset size is not limited to 256k, and may also be 512k, etc.
[0065] Optionally, the performance of the hard disk to be tested at the adjusted rotation speed is tested based on the test configuration file, and the process of obtaining the test result can be: based on the test configuration file, the hard disk to be tested at the adjusted rotation speed is tested for a preset number of times (such as 10 times) of 4k random write and 256K sequential write operations, and the test data of each 4k random write and the test data of the 256K sequential write are obtained. For example, for each hard disk to be tested, at each fan speed, the fio tool will perform 4k random write and 256K sequential write operations 10 times. The fio tool execution times default to 10, and the user can also specify the number of runs when the program is executed. After each execution, the test results will be saved in a log file, and the automation program will extract the IOPS (Input Output Per Second, the number of read and write operations per second) and hard disk transmission bandwidth (bw) of the test from the log file, and save them in a json file for subsequent automatic generation of test reports.
[0066] The test data includes IOPS and hard disk transmission bandwidth; after obtaining the test results, the hard disk performance automation test method also includes: automatically generating a test report based on the test results of each hard disk to be tested. The test report includes the IOPS and hard disk transmission bandwidth of each 4k random write and the IOPS and hard disk transmission bandwidth of 256K sequential write for each hard disk to be tested at each fan speed, the average IOPS and hard disk transmission bandwidth of 4k random write for each hard disk to be tested for a preset number of times at each fan speed, and the average IOPS and hard disk transmission bandwidth of 256K sequential write, the decay rate of the average IOPS of 4k random write at the lowest fan speed of each hard disk to the average IOPS of 4k random write at the remaining fan speeds, the decay rate of the average hard disk transmission bandwidth of 4k random write, the decay rate of the average IOPS of 256K sequential write, and the decay rate of the average hard disk transmission bandwidth of 256K sequential write.
[0067] For ease of understanding, let's assume that the preset fan speed configuration file contains three speeds, namely speed 1, speed 2, and speed 3, and speed 1 is less than speed 2 and less than speed 3; and the hard disk list to be tested contains two hard disks to be tested, namely hard disk 1 and hard disk 2. The test report includes:
[0068] At rotation speed 1: IOPS and hard disk transfer bandwidth of hard disk 1 performing 10 4K random writes, average IOPS and hard disk transfer bandwidth of hard disk 1 performing 10 4K random writes, IOPS and hard disk transfer bandwidth of hard disk 1 performing 10 256K sequential writes, average IOPS and hard disk transfer bandwidth of hard disk 1 performing 10 256K sequential writes; IOPS and hard disk transfer bandwidth of hard disk 2 performing 10 4K random writes, average IOPS and hard disk transfer bandwidth of hard disk 2 performing 10 4K random writes, IOPS and hard disk transfer bandwidth of hard disk 2 performing 10 256K sequential writes, average IOPS and hard disk transfer bandwidth of hard disk 2 performing 10 256K sequential writes.
[0069] At rotation speed 2: IOPS and hard disk transfer bandwidth of hard disk 1 performing 10 4K random writes, average IOPS and hard disk transfer bandwidth of hard disk 1 performing 10 4K random writes, IOPS and hard disk transfer bandwidth of hard disk 1 performing 10 256K sequential writes, average IOPS and hard disk transfer bandwidth of hard disk 1 performing 10 256K sequential writes; IOPS and hard disk transfer bandwidth of hard disk 2 performing 10 4K random writes, average IOPS and hard disk transfer bandwidth of hard disk 2 performing 10 4K random writes, IOPS and hard disk transfer bandwidth of hard disk 2 performing 10 256K sequential writes, average IOPS and hard disk transfer bandwidth of hard disk 2 performing 10 256K sequential writes.
[0070] At rotation speed 3: IOPS and hard disk transfer bandwidth of hard disk 1 performing 10 4K random writes, average IOPS and hard disk transfer bandwidth of hard disk 1 performing 10 4K random writes, IOPS and hard disk transfer bandwidth of hard disk 1 performing 10 256K sequential writes, average IOPS and hard disk transfer bandwidth of hard disk 1 performing 10 256K sequential writes; IOPS and hard disk transfer bandwidth of hard disk 2 performing 10 4K random writes, average IOPS and hard disk transfer bandwidth of hard disk 2 performing 10 4K random writes, IOPS and hard disk transfer bandwidth of hard disk 2 performing 10 256K sequential writes, average IOPS and hard disk transfer bandwidth of hard disk 2 performing 10 256K sequential writes.
[0071] Hard disk 1: The average 4k random write IOPS at rotation speed 2 is equivalent to the decay rate of the average 4k random write IOPS at rotation speed 1, the average hard disk transmission bandwidth of 4k random write at rotation speed 2 is equivalent to the decay rate of the average hard disk transmission bandwidth of 4k random write at rotation speed 1, the average 4k random write IOPS at rotation speed 3 is equivalent to the decay rate of the average 4k random write IOPS at rotation speed 1, and the average hard disk transmission bandwidth of 4k random write at rotation speed 3 is equivalent to the decay rate of the average hard disk transmission bandwidth of 4k random write at rotation speed 1.
[0072] Hard disk 2: The decay rate of the average 4k random write IOPS at rotation speed 2 is equivalent to the decay rate of the average 4k random write IOPS at rotation speed 1, the decay rate of the average hard disk transmission bandwidth for 4k random write at rotation speed 2 is equivalent to the decay rate of the average hard disk transmission bandwidth for 4k random write at rotation speed 1, the decay rate of the average 4k random write IOPS at rotation speed 3 is equivalent to the decay rate of the average 4k random write IOPS at rotation speed 1, and the decay rate of the average hard disk transmission bandwidth for 4k random write at rotation speed 3 is equivalent to the decay rate of the average hard disk transmission bandwidth for 4k random write at rotation speed 1.
[0073] By taking the average IOPS of 4k random write, the average hard disk transmission bandwidth of 4k random write, the average IOPS of 256K sequential write, and the average hard disk transmission bandwidth of 256K sequential write as the benchmark test, the decay rate of the average IOPS of 4k random write, the decay rate of the average hard disk transmission bandwidth of 4k random write, the decay rate of the average IOPS of 256K sequential write, and the decay rate of the average hard disk transmission bandwidth of 256K sequential write at the remaining fan speeds can be obtained. In this way, it can be verified whether the fan design is reasonable, and the design of insufficient hard disk protection in server R&D design can be found out through this method, so as to improve product quality and customer satisfaction and avoid the problem of unreasonable fan design leading to a high failure rate of server hard disk.
[0074] Optionally, in one implementation, before testing the performance of the hard disk to be tested at the adjusted rotation speed based on the test configuration file, the hard disk performance automation test method further includes: automatically turning off the write cache function of the hard disk to be tested. For example, the automation program calls the hdparm tool to turn off the write cache function of the hard disks in the hard disk list to be tested. The hdparm tool can be called to turn off the write cache function of hard disk x in the hard disk list to be tested by the following command hdparm-W0 / dev / sdx, where x is the number of the hard disk to be tested.
[0075] Optionally, after obtaining the test results, the hard disk performance automated testing method further includes: automatically restoring the settings modified by the test machine during the test to the settings before the test, including automatically restoring the fan power management mode of the BMC from the manual mode to the automatic mode. If the write cache function of the hard disk to be tested is automatically turned off during the test, then when automatically restoring the settings modified by the test machine during the test to the settings before the test, it also includes automatically restoring the write cache function of the hard disk to be tested that was automatically turned off. For example, after all tests are completed, the fan power management mode of the BMC can be restored from the manual mode to the automatic mode through the ipmitool tool, and the write cache function of the hard disk in the hard disk list to be tested can be restored through the hdparm tool, that is, the write cache function is turned on.
[0076] In an optional implementation manner, the flowchart of the above-mentioned hard disk performance automatic testing method is as follows: Figure 2 As shown, at the beginning of the test, it is first detected whether the test tools required for the test are installed in the system. If not, the required test tools are installed. Then, the list of hard disks to be tested of the test machine is obtained, the fan power management mode of the BMC is automatically changed to manual mode, and the fan speed is automatically adjusted according to the preset fan speed configuration file; for each hard disk to be tested in the list of hard disks to be tested, the write cache function of the hard disk to be tested is automatically turned off, and a corresponding test configuration file is dynamically generated according to the hard disk to be tested and the preset test configuration parameters, and the performance of the hard disk to be tested at the adjusted speed is tested based on the test configuration file to obtain the test result, and it is determined whether all speeds in the preset fan speed configuration file have been traversed. If not all speeds have been traversed, the fan speed of the fan is automatically adjusted from the current speed to the next speed. If all speeds have been traversed, a test report is automatically generated based on the test results of each hard disk to be tested, and the settings modified by the test machine during the test are automatically restored to the settings before the test.
[0077] Based on the same inventive concept, the embodiment of the present application also provides a hard disk performance automatic testing device 100, such as Figure 3 The hard disk performance automatic testing device 100 comprises: an acquisition module 110 , a setting module 120 , and a testing module 130 .
[0078] The acquisition module 110 is used to automatically acquire a list of hard disks to be tested of the test machine.
[0079] Optionally, the acquisition module 110 is used to obtain a list of all hard disks of the test machine; and automatically remove solid state disks and system disks from the list of all hard disks to obtain the list of hard disks to be tested.
[0080] The setting module 120 is used to automatically change the fan power management mode of the BMC to the manual mode, and automatically adjust the fan speed according to a preset fan speed configuration file.
[0081] Optionally, the preset fan speed configuration file includes multiple speeds of different sizes, and the setting module 120 is used to automatically adjust the fan speed in sequence from small to large according to the multiple speeds in the preset fan speed configuration file; wherein, when the performance test of each hard disk to be tested is completed at the current speed, the fan speed of the fan is automatically adjusted from the current speed to the next speed until all speeds are traversed.
[0082] The test module 130 is used to dynamically generate a corresponding test configuration file for each hard disk to be tested in the hard disk to be tested list according to the hard disk to be tested and preset test configuration parameters, and test the performance of the hard disk to be tested at the adjusted rotation speed based on the test configuration file to obtain a test result.
[0083] Optionally, the preset test configuration parameters include: fixed test configuration parameters and the hard disk read and write mode, single read and write data size and hard disk number that need to be dynamically set; the test module 130 is used to automatically assign the value of the hard disk number to the number of the hard disk to be tested, and automatically assign the hard disk read and write mode and the single read and write data size according to the test requirements; generate a corresponding test configuration file according to the fixed test configuration parameters and the assigned hard disk read and write mode, the single read and write data size and the hard disk number.
[0084] Optionally, the test module 130 is used to perform a preset number of random write operations of the first preset size and the sequential write operations of the second preset size on the hard disk to be tested at the adjusted rotation speed based on the test configuration file, and automatically obtain the test data of each random write of the first preset size and the test data of each sequential write of the second preset size.
[0085] The test data includes IOPS and hard disk transmission bandwidth; optionally, the test module 130 is also used to automatically generate a test report based on the test results of each hard disk to be tested after obtaining the test results, wherein the test report includes the IOPS and hard disk transmission bandwidth of each first preset size random write and the IOPS and hard disk transmission bandwidth of the second preset size sequential write at each fan speed for each hard disk to be tested, the average IOPS and hard disk transmission bandwidth of the first preset size random write for the preset number of times and the average IOPS and hard disk transmission bandwidth of the second preset size sequential write at each fan speed for each hard disk to be tested, the decay rate of the average IOPS of the first preset size random write at the lowest fan speed and the average IOPS of the first preset size random write at the remaining fan speeds for each hard disk to be tested, the decay rate of the average hard disk transmission bandwidth of the first preset size random write, the decay rate of the average IOPS of the second preset size sequential write, and the decay rate of the average hard disk transmission bandwidth of the second preset size sequential write.
[0086] Optionally, the performance of the hard disk to be tested includes write performance, and the setting module 120 is also used to automatically turn off the write cache function of the hard disk to be tested before the testing module 130 tests the performance of the hard disk to be tested at the adjusted rotation speed based on the test configuration file.
[0087] Optionally, after obtaining the test result, the setting module 120 is further used to automatically restore the settings modified by the test machine during the test to the settings before the test, including automatically restoring the fan power management mode of the BMC from the manual mode to the automatic mode.
[0088] The hard disk performance automatic testing device 100 provided in the embodiment of the present application has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0089] like Figure 4 As shown, Figure 4 The structural block diagram of an electronic device 200 provided in an embodiment of the present application is shown. The electronic device 200 includes: a transceiver 210, a memory 220, a communication bus 230 and a processor 240, and further includes a hard disk for storing data (including a mechanical hard disk (including a system disk), a solid-state hard disk), a fan for heat dissipation, and a BMC for adjusting the fan speed.
[0090] The transceiver 210, the memory 220, and the processor 240 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses 230 or signal lines. The transceiver 210 is used to send and receive data. The memory 220 is used to store computer programs, such as storing Figure 3 The software function module shown in is the hard disk performance automation test device 100. Among them, the hard disk performance automation test device 100 includes at least one software function module that can be stored in the memory 220 in the form of software or firmware or solidified in the operating system (OS) of the electronic device 200. The processor 240 is used to execute the executable module stored in the memory 220, such as the software function module or computer program included in the hard disk performance automation test device 100. For example, the processor 240 is used to automatically obtain the list of hard disks to be tested of the test machine (which can refer to the electronic device itself); automatically change the fan power management mode of the BMC to the manual mode, and automatically adjust the fan speed according to the preset fan speed configuration file; for each hard disk to be tested in the hard disk list to be tested, dynamically generate a corresponding test configuration file according to the hard disk to be tested and the preset test configuration parameters, and test the performance of the hard disk to be tested at the adjusted speed based on the test configuration file to obtain the test result.
[0091] Among them, the memory 220 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
[0092] The processor 240 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor 240 may also be any conventional processor, etc.
[0093] The electronic device 200 mentioned above includes but is not limited to a computer, such as a server, etc.
[0094] An embodiment of the present application also provides a non-volatile computer-readable storage medium (hereinafter referred to as storage medium), on which a computer program is stored. When the computer program is run by a computer such as the above-mentioned electronic device 200, the above-mentioned hard disk performance automatic testing method is executed.
[0095] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0096] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0097] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0098] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a computer-readable storage medium, including several instructions for enabling a computer device (which can be a personal computer, a laptop, a server, or an electronic device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned computer-readable 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.
[0099] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A hard disk performance automated testing method, characterized in that: include: Automatically obtain the list of hard disks to be tested on the test machine; Automatically change the fan power management mode of the BMC to manual mode, and automatically adjust the fan speed according to the preset fan speed configuration file; For each hard disk to be tested in the hard disk to be tested list, a corresponding test configuration file is dynamically generated according to the hard disk to be tested and preset test configuration parameters, and the performance of the hard disk to be tested under the adjusted rotation speed is tested based on the test configuration file to obtain a test result, wherein the performance test includes performing a preset number of random writes of a first preset size and sequential writes of a second preset size, and the test result includes: the decay rate of the average IOPS of random writes of the first preset size of each hard disk to be tested at the lowest fan speed and the average IOPS of random writes of the first preset size at the remaining fan speeds, the decay rate of the average hard disk transmission bandwidth of random writes of the first preset size, the decay rate of the average IOPS of sequential writes of the second preset size, and the decay rate of the average hard disk transmission bandwidth of sequential writes of the second preset size; The preset test configuration parameters include: general fixed test configuration parameters and personalized parameters that need to be dynamically set, including hard disk read and write mode, single read and write data size, and hard disk number; dynamically generate a corresponding test configuration file according to the hard disk to be tested and the preset test configuration parameters, including: Automatically assign the value of the hard disk number to the number of the hard disk to be tested, and automatically assign the hard disk read and write mode and the single read and write data size according to the test requirements; A corresponding test configuration file is generated according to the fixed test configuration parameters and the assigned personalized parameters including the hard disk read and write mode, the single read and write data size and the hard disk number.
2. The method according to claim 1, characterized in that The preset fan speed configuration file includes a plurality of speeds of different sizes; the automatically adjusting the fan speed according to the preset fan speed configuration file includes: According to the plurality of speeds in the preset fan speed configuration file, the fan speeds are automatically adjusted in ascending order; When the performance test of each hard disk to be tested is completed at the current rotation speed, the fan rotation speed of the fan is automatically adjusted from the current rotation speed to the next rotation speed until all rotation speeds are traversed.
3. The method according to claim 1 or 2, characterized in that: The performance of the hard disk to be tested under the adjusted rotation speed is tested based on the test configuration file to obtain a test result, including: Based on the test configuration file, the hard disk to be tested is tested for a preset number of random writes of the first preset size and sequential writes of the second preset size at the adjusted rotation speed, and test data of each random write of the first preset size and test data of each sequential write of the second preset size are automatically obtained.
4. The method according to claim 1, characterized in that Get the hard disk list to be tested, including: Obtain a list of all hard disks of the test machine; Solid-state hard disks and system disks are automatically removed from the list of all hard disks to obtain the list of hard disks to be tested.
5. The method according to claim 1, characterized in that The performance of the hard disk to be tested includes write performance. Before testing the performance of the hard disk to be tested at the adjusted rotation speed based on the test configuration file, the method further includes: Automatically disable the write cache function of the hard disk under test.
6. The method according to claim 1, characterized in that After obtaining the test result, the method further includes: The settings of the test machine modified during the test are automatically restored to the settings before the test, including automatically restoring the fan power management mode of the BMC from the manual mode to the automatic mode.
7. A hard disk performance automated testing device, characterized in that: include: The acquisition module is used to automatically acquire the hard disk list to be tested of the test machine; The setting module is used to automatically change the fan power management mode of the BMC to the manual mode and automatically adjust the fan speed according to the preset fan speed configuration file; A test module is used to dynamically generate a corresponding test configuration file for each hard disk to be tested in the hard disk to be tested list according to the hard disk to be tested and preset test configuration parameters, and test the performance of the hard disk to be tested under the adjusted rotation speed based on the test configuration file to obtain a test result, wherein the performance test includes performing a preset number of random write operations of a first preset size and a sequential write operation of a second preset size, and the test result includes: a decay rate of an average IOPS of a first preset size random write at the lowest fan speed of each hard disk to an average IOPS of a first preset size random write at each remaining fan speed, a decay rate of an average hard disk transmission bandwidth of a first preset size random write, a decay rate of an average IOPS of a second preset size sequential write, and a decay rate of an average hard disk transmission bandwidth of a second preset size sequential write; The preset test configuration parameters include: general fixed test configuration parameters and personalized parameters that need to be dynamically set, including hard disk read and write mode, single read and write data size, and hard disk number; the test module is specifically used for: Automatically assign the value of the hard disk number to the number of the hard disk to be tested, and automatically assign the hard disk read and write mode and the single read and write data size according to the test requirements; A corresponding test configuration file is generated according to the fixed test configuration parameters and the assigned personalized parameters including the hard disk read and write mode, the single read and write data size and the hard disk number.
8. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is connected to the memory; The memory is used to store programs; The processor is used to call the program stored in the memory to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is executed.
Citation Information
Patent Citations
Hard disk performance test method and system in vibration environment, terminal and storage medium
CN110851307A