Blockchain performance testing method, device, electronic device and storage medium
By automatically obtaining and determining blockchain performance test items and testing with input and output load tools, the problems of manual deployment and high code requirements in the existing technology are solved, and the effect of simplifying the blockchain performance testing process and improving testing efficiency is achieved.
Patent Information
- Application Number
- CN202211604658.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-13
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2042-12-13
AI Technical Summary
The existing blockchain performance testing methods require manual deployment and high code level requirements, making the test difficult.
Provide a blockchain performance testing method, by obtaining the file system test items of the server to be tested, automatically determine the input and output load items in combination with the host address array, and use the input and output load tool to test, and obtain the upper limit data of the blockchain performance.
It reduces the difficulty of blockchain performance testing, and does not require mastering complex code capabilities to achieve testing, improving testing efficiency and accuracy.
Smart Images

Figure CN116248543B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain testing technology, and in particular to a blockchain performance testing method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of blockchain technology, it has broad application prospects in various fields. When upgrading the blockchain platform or developing new blockchain products, it is necessary to test the blockchain to discover and locate existing problems.
[0003] At present, when performing performance testing on most blockchains, it is necessary to manually deploy the blockchain and test items first, which requires a high level of coding skills from the testers and makes the testing difficult. Summary of the invention
[0004] In order to solve the technical problem of how to reduce the difficulty of blockchain performance testing, the present application provides a blockchain performance testing method, device, electronic device and storage medium.
[0005] In a first aspect, the present application provides a blockchain performance testing method, the method comprising:
[0006] Get the test items of the file system of the server to be tested;
[0007] Determine the input and output load items of each host in the server to be tested according to the test items and the host address array of the server to be tested;
[0008] Using an input / output load tool, the input / output load item of each host is tested to obtain first test data, where the first test data is used to characterize the blockchain performance upper limit of the server to be tested;
[0009] Optionally, after performing a performance test on the input and output load items of each of the hosts by using an input and output load tool and obtaining first test data, the method further comprises:
[0010] The file system is blockchainized by using a blockchain management tool to obtain N blocks;
[0011] Testing each of the blocks using a blockchain performance testing tool to obtain second test data, where the second test data is used to characterize the blockchain performance of the block;
[0012] Optionally, before obtaining the test items of the file system of the server to be tested, the method further includes setting up a test environment;
[0013] The process of building a test environment includes:
[0014] A first disk array and a second disk are configured for the server to be tested; the performance of the first disk array is used to characterize the performance of the server to be tested;
[0015] Install the basic system of the server to be tested on the second disk;
[0016] Initializing the first disk array, obtaining the file system of the server to be tested, and mounting the file system to the basic system;
[0017] Deploy software tools; the software tools are used for performance testing or collecting data during performance testing;
[0018] Optionally, after deploying the software tool and before obtaining the test items of the file system of the server to be tested, the method further includes:
[0019] Performing a status test on the software tool to obtain a status test result;
[0020] If the status test result is consistent with the pre-stored target result of the software tool, determining that the status of the software tool is normal;
[0021] Optionally, in the process of testing each of the blocks, the method further includes:
[0022] Obtaining the indicator data collected during the test; writing the indicator data into a log file, and uploading the indicator data to the blockchain, so as to save all the indicator data during the test in a block; the log file is used to record information of the collected indicator data;
[0023] Calling the contract analysis record file in the server to be tested and the indicator data on the blockchain to generate a collectible file; the collectible file includes feature information and test item information of this test;
[0024] Pushing the collectible file to the database of the server to be tested;
[0025] Optionally, the method further comprises: using a visualization tool to display at least one of the indicator data, the log file and the test result; wherein the test result comprises at least one of the first test data and the second test data;
[0026] Optionally, after testing each of the blocks using a blockchain performance testing tool and obtaining second test data, the method further includes:
[0027] Calculating environmental factors based on the hard disk temperature, seek error rate, error read rate, idle CPU percentage, and CPU time percentage during the issuance of input and output requests of the server to be tested;
[0028] Performing blockchain performance bottleneck analysis on the server to be tested according to the environmental factors;
[0029] Optionally, the test items of the file system of the server to be tested include: defining block size, read-write ratio, random ratio, test time, process and read-write mode;
[0030] Accordingly, according to the test item and the host address array of the server to be tested, the input and output load items of each host in the server to be tested are determined, including:
[0031] Obtain the host address array of the server to be tested, as well as the user name and user password of each host;
[0032] Establishing rapid mutual trust between the hosts according to the host address array, the user name and the user password;
[0033] The input and output load items of each of the hosts are determined in an exhaustive manner according to the defined block size, the read-write ratio, the random ratio, the test time, the process and the read-write mode.
[0034] In a second aspect, the present application provides a blockchain performance testing device, the device comprising:
[0035] An acquisition module is used to obtain test items of the file system of the server to be tested;
[0036] A determination module, configured to determine the input and output load items of each host in the server to be tested according to the test items and the host address array of the server to be tested;
[0037] The testing module is used to test the input and output load items of each of the hosts through an input and output load tool to obtain first test data, where the first test data is used to characterize the blockchain performance upper limit of the server to be tested.
[0038] In a third aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0039] Memory, used to store computer programs;
[0040] The processor is used to implement the steps of the blockchain performance testing method described in any one of the embodiments of the first aspect when executing the program stored in the memory.
[0041] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the blockchain performance testing method as described in any one of the embodiments of the first aspect.
[0042] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:
[0043] The method provided in the embodiment of the present application obtains the test items of the file system of the server to be tested; determines the input and output load items of each host in the server to be tested according to the test items and the host address array of the server to be tested; and tests the input and output load items of each host through the input and output load tool to obtain the first test data, which is used to characterize the upper limit of the blockchain performance of the server to be tested. This method can automatically obtain the input and output load items of each host by obtaining the test items of the file system of the server to be tested and combining the host address array of the server to be tested. By testing the input and output load items of each host, the upper limit of the blockchain performance of the server to be tested can be obtained. Blockchain performance testing can be implemented without mastering complex code capabilities, reducing the difficulty of testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0046] Figure 1 A system architecture diagram of a blockchain performance testing method provided for one embodiment of the present application;
[0047] Figure 2 A network topology diagram of a blockchain performance testing method provided by one embodiment of the present application;
[0048] Figure 3 A flowchart of a blockchain performance testing method provided for one embodiment of the present application;
[0049] Figure 4 A flowchart of a data collection method in a blockchain performance test provided by an embodiment of the present application;
[0050] Figure 5A schematic diagram of the structure of a blockchain performance testing device provided for one embodiment of the present application;
[0051] Figure 6 A schematic diagram of the structure of an electronic device provided in accordance with an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution 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 part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0053] The first embodiment of the present application provides a blockchain performance testing method, which can be applied to Figure 1 The system architecture shown includes at least a blockchain testing platform 101 and a server to be tested 102, and the blockchain testing platform 101 and the server to be tested 102 establish a communication connection.
[0054] The method can be applied to the blockchain testing platform 101 in the system architecture to perform blockchain performance testing on the server 102 to be tested. The specific composition of the blockchain testing platform 101 is not limited.
[0055] Specifically, this method can be applied to Figure 2 The network topology, Figure 2 A network topology diagram of a blockchain performance testing method provided for one embodiment of the present application.
[0056] Among them, the stress server is used to generate load and perform stress testing. Grafana, as a visualization tool, provides test result visualization services for blockchain performance testing. Prometheus is used to collect data during the performance testing process.
[0057] Next, based on the system architecture or network topology, the blockchain performance testing method is described in detail. A blockchain performance testing method, such as Figure 3 ,include:
[0058] Step 301: Acquire test items of the file system of the server to be tested.
[0059] Each test item may include six variables, namely, block size (block_list), read-write ratio (rw_list), random ratio (random_list), test time (time), process (threads) and read-write mode (way). The specific values of the variables may be set or selected as needed. Of course, they may also be automatically allocated according to the server to be tested. The value of each variable may be one or more. Multiple test items may be generated through free combination. Specifically, the test items to be tested may be exhaustively listed through a for loop, thereby realizing the definition of the test items.
[0060] For each test item, the performance indicators of the test can be divided into two parts, one is the number of read and write operations per unit time (Input / Output Operations Per Second, i.e. iops), and the other is the data throughput, that is, the amount of data that can be transmitted per unit time.
[0061] Since the storage medium of blockchain has a minimum read and write unit, mechanical disks are usually 512 bytes, and solid-state drives are usually 4kb, 4k block size can be used for testing when testing IOPS. However, due to factors such as network bandwidth and system IO strategy, 1M block size can be used for testing when testing data throughput performance.
[0062] In terms of performance testing, in order to avoid false performance caused by storage medium cache, direct reading is usually selected for storage medium performance testing, and IOPS and throughput are included. The block size is 4K and 1M, and the test time is 5 to 30 minutes. For the mean time to repair (MTTR) in the reliability direction of the storage medium, it is necessary to use greater pressure to initiate random IO to the storage medium, and meet daily usage scenarios, the block size is more than 1M, the read-write method is 70% read, and the time is more than 168 hours.
[0063] Based on the above conclusions, the following commonly used test indicators are given:
[0064] Performance indicators: 4k random write, 4k random read, 4k sequential read, 4k sequential write, 1M random write, 1M random read, 1M sequential read, 1M sequential write, time is 5 minutes for each item, and 32 concurrent processes.
[0065] Reliability indicators: 1M mixed random read and write, read-write ratio of 7:3, time of 168 hours, concurrent processes of 64.
[0066] During testing, the values of each variable in each test item can be determined based on the above commonly used test indicators to meet the test needs, without specific restrictions.
[0067] Step 302: Determine the input and output load items of each host in the server to be tested according to the test items and the host address array of the server to be tested.
[0068] The server to be tested generally includes multiple hosts. The host address array is used to store the host addresses of each host. The host address array of the server to be tested, as well as the user name and password of each host, can be obtained first. According to the host address array, user name and password, fast mutual trust between the hosts is established. Specifically, a shell script can be used to achieve fast mutual trust between hosts by using ssh-copy-id and expect tools.
[0069] After achieving rapid mutual trust between hosts, data communication between hosts is facilitated. By defining block size, read-write ratio, random ratio, test time, process, and read-write method, combined with the host address array, the input and output load items (also called IO load items) of each host can be determined through an exhaustive for loop.
[0070] Step 303: Test the input and output load items of each host through the input and output load tool to obtain first test data, which is used to characterize the blockchain performance upper limit of the server to be tested.
[0071] When the IO load items of multiple hosts are tested for performance using the input and output load tool (IO load tool), all processes can be carried out in series, and the test start time T1 and end time T2 are recorded. The data obtained between T1 and T2 is the upper limit of blockchain performance.
[0072] This method can automatically obtain the input and output load items of each host by obtaining the test items of the file system of the server to be tested and combining them with the host address array of the server to be tested. By testing the input and output load items of each host, the blockchain performance upper limit of the server to be tested can be obtained. Blockchain performance testing can be implemented without mastering complex code capabilities, reducing the difficulty of testing.
[0073] In one embodiment, after the input and output load items of each host are performance tested by an input and output load tool and first test data is obtained, the method further includes: blockchaining the file system by a blockchain management tool to obtain N blocks; and testing each block by a blockchain performance testing tool to obtain second test data, wherein the second test data is used to characterize the blockchain performance of the block.
[0074] When testing the block performance on the file system through the blockchain performance testing tool, all processes can be carried out serially, and the test start time is recorded as T3 and the end time is T4. The data between T3 and T4 is the blockchain performance data.
[0075] In this embodiment, the blockchain performance testing tool can be the hyperbench software tool in Table 1. When testing the block, the four variables of the number of virtual machines, test time, host address, and rate can be considered, and a for loop can be used for exhaustive enumeration to define the test items for all block tests, thereby realizing automatic IO generation of the blockchain, reducing the operating difficulty of the tester, and improving the test efficiency.
[0076] In one embodiment, before obtaining the test items of the file system of the server to be tested, the method further includes setting up a test environment.
[0077] Building a test environment includes building the hardware environment, network environment, and software environment.
[0078] Building a hardware environment includes: configuring the first disk array and the second disk for the server to be tested; the performance of the first disk array is used to characterize the performance of the server to be tested. In order to ensure the security of blockchain data, the disk array technology is used to perform hard raid processing on the hard disk, and the XOR check method is used to ensure that if only one disk is damaged, data will not be lost, thereby improving the security of data and blockchain.
[0079] In addition, the first disk array for testing performance and the second disk for deploying the system are two sets of disks respectively to eliminate interference caused by system factors. Of course, the second disk can also be a disk array without limitation.
[0080] To build a network environment, you can build Figure 2 The network topology shown will not be described in detail.
[0081] Building a software environment includes: installing the basic system of the server to be tested on the second disk; initializing the first disk array to obtain the file system of the server to be tested, and mounting the file system to the basic system; deploying software tools; and using the software tools for performance testing or collecting data during performance testing.
[0082] Specifically, you can use the Linux system as the basic system. Of course, you can also use the Mac and Windows systems in the Mac and Windows environments.
[0083] After the system is installed, format the disk array and use the tool to initialize the disk array to make it a usable file system. Then mount the file system to the system environment. After the above steps are completed, deploy the following software, as shown in Table 1.
[0084] Table 1
[0085]
[0086]
[0087] After deploying the software tool, before obtaining the test items of the file system of the server to be tested, all tools can also be tested to see if the required information can be correctly obtained. The specific steps include: performing a status test on the software tool to obtain a status test result; if the status test result is consistent with the pre-stored target result of the software tool, it is determined that the software tool status is normal.
[0088] In this embodiment, the target result of the software tool can be pre-stored. If the status test result is consistent with the target result, it means that the software tool can be used normally and the status is normal. The names and abbreviations of the information obtained by the software tool are shown in Table 2.
[0089] Table 2
[0090]
[0091] In one embodiment, during the process of testing each block, the method further includes:
[0092] Obtain the indicator data collected during the test; write the indicator data into a log file, and upload the indicator data to the blockchain to save all indicator data during the test in the block; the log file is used to record the information of the collected indicator data;
[0093] Call the contract analysis record file in the server to be tested and the indicator data on the blockchain to generate a collectible file; the collectible file includes the feature information and test item information of this test;
[0094] Push the collectible files to the database of the server under test.
[0095] In this embodiment, when collecting data, a scheduled task can be used and written as a service to obtain the indicators mentioned in Table 2. All generated logs can be written into a log file using a fixed format, such as written in the format of time, level, and content as the three sections of the log file. Log files stored in the same format are easy to read and use. Of course, the above specific formats are only examples and do not represent restrictions on the log file format.
[0096] The Prometheus database can be used for the collected data. The Prometheus database has a situation where availability is greater than consistency and tolerates the loss of some replica data, which will result in inaccurate data. In addition, Prometheus is not friendly to log events. Therefore, the database collection method is modified in this embodiment, such as Figure 4 As shown, the improved acquisition process is as follows, including:
[0097] Step 401, after the script completes data collection, the data is written to the log record file and uploaded directly to the chain.
[0098] Step 402: Each block stores all data of a single test item.
[0099] Step 403, after calling the contract analysis record file and on-chain data through a third-party script, a collectible file is generated. The generated data needs to contain the feature information (version) of this test and the test item information (option).
[0100] Step 404: Push the data to the database through pushgateway, where the collection interval from step 401 to step 404 should be the interval required by the test particle. The Prometheus database generally uses pull to pull data. In this embodiment, the pushgateway component is used to push the data to the Prometheus database to ensure the integrity of the data.
[0101] Step 405, after the content of the log file is disassembled into three sections, it is put into the collection file in the form of key-value pairs. After all tests are completed, it is pushed to the database, and the version field of each test is added for subsequent search.
[0102] The improved Prometheus database collection method can ensure the accuracy and completeness of the collected data, and improve the accuracy of subsequent data display, performance analysis, and performance bottleneck analysis.
[0103] In one embodiment, a visualization tool may be used to display data, including: using a visualization tool to display at least one of indicator data, log files, and test results, wherein the test results include at least one of first test data and second test data.
[0104] In this embodiment, the visualization tool can use Grafana. When displaying, the indicator data can be presented using a line chart, the log file information can be presented using a table, and the test results can be quickly switched using Variables to improve the visualization display effect of the test results.
[0105] This embodiment can not only display the data, but also display and analyze the test performance.
[0106] You can filter the data of each corresponding test item according to the option, which makes it convenient to view the corresponding data under the option and analyze it. The data can be differentiated according to time. For example, the data obtained from T1 to T2 is the upper limit of the blockchain performance in this scenario, and the data obtained from T3 to T4 is the blockchain performance data, which improves the efficiency of data analysis.
[0107] In one embodiment, after obtaining the test data, performance bottleneck analysis may be performed.
[0108] When analyzing bottlenecks, you can analyze based on environmental factors. The calculation process of environmental factors can be as follows:
[0109] Environmental factor = (66 + Temp-Idle-SER-RER) * Util / 10000
[0110] Among them, Temp is the hard disk temperature of the server to be tested, SER is the seek error rate, RER is the error read rate, Idle is the percentage of idle CPU, and Util is the percentage of CPU time during the issuance of input and output requests. The environmental factor can be calculated based on the above parameters, and the blockchain performance bottleneck analysis of the server to be tested can be performed based on the environmental factor.
[0111] The blockchain performance testing method provided in this embodiment includes the following steps: setting up a test environment, conducting performance testing according to IO indicators and an automated IO generation solution, real-time collection of valid data during the test, real-time customized chart generation and display, and performance status and bottleneck analysis.
[0112] This embodiment can customize the IO automatic generation solution, support any mainstream platforms such as mac, linux, windows, etc., display data in charts, customizable styles, beautiful interface, data persistence, easy to filter, view history, comprehensive available data, easy to search logs, and analyze performance and bottlenecks.
[0113] This solution is very friendly to operation and maintenance personnel. They do not need to master complex front-end code capabilities to realize test result visualization, and can almost achieve a once-and-for-all effect after a process is completed. They can also obtain storage medium performance fluctuations and performance indicators through images, quickly obtain blockchain performance ceilings and locate blockchain performance bottlenecks, and ensure the accuracy and effectiveness of test data through data chain verification, without spending a lot of time extracting valid information from a lot of test data.
[0114] Based on the same technical concept, the second embodiment of the present application provides a blockchain performance testing device, such as Figure 5 ,include:
[0115] The acquisition module 501 is used to acquire the test items of the file system of the server to be tested;
[0116] A determination module 502, configured to determine an input and output load item of each host in the server to be tested according to the test item and the host address array of the server to be tested;
[0117] The testing module 503 is used to test the input and output load items of each of the hosts through an input and output load tool to obtain first test data, where the first test data is used to characterize the blockchain performance upper limit of the server to be tested.
[0118] The device can automatically obtain the input and output load items of each host by acquiring the test items of the file system of the server to be tested and combining them with the host address array of the server to be tested. By testing the input and output load items of each host, the blockchain performance upper limit of the server to be tested can be obtained. Blockchain performance testing can be implemented without mastering complex code capabilities, reducing the difficulty of testing.
[0119] like Figure 6 As shown, the third embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0120] Memory 113, used for storing computer programs;
[0121] In one embodiment, the processor 111 is used to execute the program stored in the memory 113 to implement the blockchain performance testing method provided by any of the aforementioned method embodiments, including:
[0122] Get the test items of the file system of the server to be tested;
[0123] Determine the input and output load items of each host in the server to be tested according to the test items and the host address array of the server to be tested;
[0124] The input and output load items of each of the hosts are tested by using an input and output load tool to obtain first test data, where the first test data is used to characterize the blockchain performance upper limit of the server to be tested.
[0125] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0126] The communication interface is used for communication between the above terminal and other devices.
[0127] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0128] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can 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 gate or transistor logic devices, discrete hardware components.
[0129] The fourth embodiment of 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 steps of the blockchain performance testing method provided in any of the aforementioned method embodiments are implemented.
[0130] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0131] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0132] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. In the description, the use of suffixes such as "module", "component" or "unit" used to represent elements is only to facilitate the description of the present invention and has no specific meaning in itself. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0133] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A blockchain performance testing method, It is characterized in that The method comprises: Get the test items of the file system of the server to be tested; Determine the input and output load items of each host in the server to be tested according to the test items and the host address array of the server to be tested; Using an input / output load tool, the input / output load item of each host is tested to obtain first test data, where the first test data is used to characterize the blockchain performance upper limit of the server to be tested; The file system is blockchainized by using a blockchain management tool to obtain N blocks; Testing each of the blocks using a blockchain performance testing tool to obtain second test data, where the second test data is used to characterize the blockchain performance of the block; Wherein, after testing each of the blocks by using a blockchain performance testing tool and obtaining second test data, the method further includes: The environmental factor is calculated according to the hard disk temperature, seek error rate, error read rate, idle CPU percentage and CPU time percentage during the period of issuing input and output requests of the server to be tested; wherein the calculation process of the environmental factor is as follows: environmental factor = (66 + Temp-Idle-SER-RER)*Util / 10000; wherein Temp is the hard disk temperature of the server to be tested, SER is the seek error rate, RER is the error read rate, Idle is the idle CPU percentage, and Util is the CPU time percentage during the period of issuing input and output requests; Perform blockchain performance bottleneck analysis on the server to be tested according to the environmental factors.
2. The method according to claim 1, It is characterized in that Before obtaining the test items of the file system of the server to be tested, the method further includes setting up a test environment; The process of building a test environment includes: A first disk array and a second disk are configured for the server to be tested; the performance of the first disk array is used to characterize the performance of the server to be tested; Install the basic system of the server to be tested on the second disk; Initializing the first disk array, obtaining the file system of the server to be tested, and mounting the file system to the basic system; Deploy software tools; the software tools are used for performance testing or collecting data during performance testing.
3. The method according to claim 2, It is characterized in that After deploying the software tool and before obtaining the test items of the file system of the server to be tested, the method further includes: Performing a status test on the software tool to obtain a status test result; If the status test result is consistent with the pre-stored target result of the software tool, it is determined that the status of the software tool is normal.
4. The method according to claim 1, It is characterized in that In the process of testing each of the blocks, the method further comprises: Obtaining the indicator data collected during the test; writing the indicator data into a log file, and uploading the indicator data to the blockchain, so as to save all the indicator data during the test in a block; the log file is used to record information of the collected indicator data; Calling the contract analysis record file in the server to be tested and the indicator data on the blockchain to generate a collectible file; the collectible file includes feature information and test item information of this test; The collectible file is pushed to the database of the server to be tested.
5. The method according to claim 4, It is characterized in that The method further includes: using a visualization tool to display at least one of the indicator data, the log file, and the test result; wherein the test result includes at least one of the first test data and the second test data.
6. The method according to claim 1, It is characterized in that The test items of the file system of the server to be tested include: defining block size, read-write ratio, random ratio, test time, process and read-write mode; Accordingly, according to the test item and the host address array of the server to be tested, the input and output load items of each host in the server to be tested are determined, including: Obtain the host address array of the server to be tested, as well as the user name and user password of each host; Establishing rapid mutual trust between the hosts according to the host address array, the user name and the user password; The input and output load items of each of the hosts are determined in an exhaustive manner according to the defined block size, the read-write ratio, the random ratio, the test time, the process and the read-write mode.
7. A blockchain performance testing device, It is characterized in that The device comprises: An acquisition module is used to obtain test items of the file system of the server to be tested; A determination module, configured to determine the input and output load items of each host in the server to be tested according to the test items and the host address array of the server to be tested; A testing module, used to test the input and output load items of each of the hosts through an input and output load tool to obtain first test data, where the first test data is used to characterize the blockchain performance upper limit of the server to be tested; A blockchain module, used to blockchain the file system through a blockchain management tool to obtain N blocks; A second testing module is used to test each of the blocks using a blockchain performance testing tool to obtain second test data, where the second test data is used to characterize the blockchain performance of the block; A calculation module is used to calculate an environmental factor according to the hard disk temperature, seek error rate, error read rate, idle CPU percentage and CPU time percentage during the input and output request of the server to be tested; wherein the calculation process of the environmental factor is as follows: Environmental factor = (66 + Temp-Idle-SER-RER) *Util / 10000; where Temp is the hard disk temperature of the server to be tested, SER is the seek error rate, RER is the read error rate, Idle is the percentage of idle CPUs, and Util is the percentage of CPU time during which input and output requests are issued; The analysis module is used to perform blockchain performance bottleneck analysis on the server to be tested according to the environmental factors.
8. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the blockchain performance testing method described in any one of claims 1 to 6 when executing the program stored in the memory.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the blockchain performance testing method as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Block chain data processing method and device, readable storage medium and computer equipment
CN110245147A