A network performance testing method and device
By deploying Qperf testing tools on financial-grade cloud platforms, using container technology to test network performance and process test results, the problem of network performance testing in the existing technology can only be tested once and data processing efficiency is low, and efficient network performance testing and data processing are achieved.
Patent Information
- Application Number
- CN202211504619.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-28
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-11-28
AI Technical Summary
Existing network performance testing tools can only be tested once, and batch export of test data and then processed inefficiently, which is particularly difficult in the security environment of financial-grade cloud platforms.
By deploying the Qperf test tool on a financial-level cloud platform, using container technology to test network performance cycles, generate a collection of test result files, and call a preset processing script to process multiple test result files, taking the mean as the final test result.
It realizes the completion of multiple tests and data processing in the same operation plane, removes environmental influencing factors, improves testing efficiency, reduces the impact on network bandwidth, and is suitable for performance comparison between different network plug-ins.
Smart Images

Figure CN115801622B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer networks and cloud computing, and in particular to a network performance testing method and device. Background Art
[0002] With the rapid development of Internet technology, especially Internet financial technology, more and more container technologies are being applied in the financial field. Taking banks in the financial field as an example, more and more business applications need to run on container management platforms to build financial-grade cloud platforms. Network performance testing of cloud platforms is extremely important, as it affects the business stability of hundreds of applications running on them.
[0003] In network performance testing, objective network conditions are often unstable. Different network plug-ins on the same platform are subject to different performance interference factors, and existing network performance testing tools can only present current test results. In addition, since the test environment of the financial-grade cloud platform is subject to strict security factors and is often in a cloud desktop or sandbox, it is particularly difficult to export and process a large amount of test data in a secure environment, which puts great pressure on service bandwidth and low processing efficiency. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a network performance testing method and device, which can at least solve the problem that the network performance testing tool in the prior art can only test once and obtain a test result once, and the efficiency of batch exporting test data and reprocessing is low.
[0005] To achieve the above object, according to one aspect of an embodiment of the present invention, a network performance testing method is provided, comprising:
[0006] In response to a selection operation on a target server, determining a container corresponding to the target server, and acquiring an Internet Protocol IP address of the container;
[0007] Determining a client corresponding to the target server to trigger the client to initiate a network performance test request for the network interface of the IP address;
[0008] Receive the network performance test request, call the test tool deployed in the container to cyclically test the network performance of the network interface, and obtain a test result file set;
[0009] Call a preset processing script, determine multiple test result files with the same preset position field in the file name, process the multiple test result files, obtain the target test result and return it.
[0010] Optionally, before calling the test tool deployed in the container, the method further includes:
[0011] In response to a create container instruction, configuration operations on a container image, environment variables, and configuration parameters are received to create a container; wherein the container image is obtained by packaging a test tool and operating system information, the test tool is deployed in the container, and the environment variables and configuration parameters are used when the container is running.
[0012] Optionally, the method further includes:
[0013] In the process of creating the container, receiving a selection operation of a type of network plug-in in the network plug-in type list, and displaying a network plug-in list of the type of network plug-in;
[0014] A selection operation of one of the network plug-ins in the network plug-in list is received, and the one of the network plug-ins is used as a network interface of the container.
[0015] Optionally, before determining the container corresponding to the target server in response to the selection operation on the target server, the method further includes:
[0016] Create two instances and run one of them in server mode to enable server mode by running a preset test process; and
[0017] Another instance is run in client mode to trigger the client to initiate a network performance test request for the network interface of the IP address.
[0018] Optionally, after obtaining the test result file set, the method further includes: calling a first preset processing script to perform a format conversion operation on the test result data in each test result file in batches.
[0019] Optionally, each test result file includes test result data of multiple message packet sizes;
[0020] The processing of the plurality of test result files to obtain and return target test results includes:
[0021] The test result data of the same message packet size in the multiple test result files are read, an average operation is performed on the test result data of the same message packet size, and the obtained average is used as the target test result and returned.
[0022] Optionally, the network performance includes bandwidth indicators and delay indicators, and the test result file includes bandwidth rate and delay duration.
[0023] Optionally, before determining the container corresponding to the target server in response to the selection operation on the target server, the method further includes:
[0024] The test tool is deployed in a container manner on a financial-grade cloud platform; wherein the financial-grade cloud platform is provided with one or more test clusters, each test cluster is deployed with one or more containers, and each container has a different type of network plug-in.
[0025] Optionally, the testing tool is a Qperf testing tool.
[0026] To achieve the above object, according to another aspect of an embodiment of the present invention, a network performance testing device is provided, comprising:
[0027] A response module, configured to determine a container corresponding to the target server in response to a selection operation on the target server, and obtain an Internet Protocol IP address of the container;
[0028] A trigger module, used to determine a client corresponding to the target server, so as to trigger the client to initiate a network performance test request for the network interface of the IP address;
[0029] A test module, configured to receive the network performance test request, call the test tool deployed in the container, so as to cyclically test the network performance of the network interface, and obtain a test result file set;
[0030] The processing module is used to call a preset processing script, determine multiple test result files with the same preset position field in the file name, process the multiple test result files, obtain the target test result and return it.
[0031] Optionally, the device further comprises a creation module, configured to:
[0032] In response to a create container instruction, configuration operations on a container image, environment variables, and configuration parameters are received to create a container; wherein the container image is obtained by packaging a test tool and operating system information, the test tool is deployed in the container, and the environment variables and configuration parameters are used when the container is running.
[0033] Optionally, the creation module is further used to:
[0034] In the process of creating the container, receiving a selection operation of a type of network plug-in in the network plug-in type list, and displaying a network plug-in list of the type of network plug-in;
[0035] A selection operation of one of the network plug-ins in the network plug-in list is received, and the one of the network plug-ins is used as a network interface of the container.
[0036] Optionally, also include instance modules for:
[0037] Create two instances and run one of them in server mode to enable server mode by running a preset test process; and
[0038] Another instance is run in client mode to trigger the client to initiate a network performance test request for the network interface of the IP address.
[0039] Optionally, it also includes a format conversion module, which is used to: call a first preset processing script to perform format conversion operations on the test result data in each test result file in batches.
[0040] Optionally, each test result file includes test result data of multiple message packet sizes;
[0041] The processing module is used to:
[0042] The test result data of the same message packet size in the multiple test result files are read, an average operation is performed on the test result data of the same message packet size, and the obtained average is used as the target test result and returned.
[0043] Optionally, the network performance includes bandwidth indicators and delay indicators, and the test result file includes bandwidth rate and delay duration.
[0044] Optionally, a deployment module is also included to:
[0045] The test tool is deployed in a container manner on a financial-grade cloud platform; wherein the financial-grade cloud platform is provided with one or more test clusters, each test cluster is deployed with one or more containers, and each container has a different type of network plug-in.
[0046] Optionally, the testing tool is a Qperf testing tool.
[0047] To achieve the above objective, according to another aspect of an embodiment of the present invention, a network performance testing electronic device is provided.
[0048] The electronic device of an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-mentioned network performance testing methods.
[0049] To achieve the above-mentioned purpose, according to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, any of the above-mentioned network performance testing methods is implemented.
[0050] To achieve the above object, according to another aspect of an embodiment of the present invention, a computer program product is provided. A computer program product of an embodiment of the present invention includes a computer program, and when the program is executed by a processor, the network performance testing method provided by the embodiment of the present invention is implemented.
[0051] According to the solution provided by the present invention, an embodiment of the above invention has the following advantages or beneficial effects: using the Qperf test tool, the test can be cyclically tested multiple times, which solves the problem that the existing test can only be performed once, and the network processing performance of different message packet sizes can be tested at the same time each time, so multiple processing result files can be quickly obtained without multiple operations; the average of multiple test result data is taken and then returned to remove environmental factors, which solves the problem of low efficiency caused by exporting the test result data first and then processing it, and avoids the impact of large amounts of data transmission on network bandwidth. This operation is also applicable to performance comparisons between different network plug-ins.
[0052] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0054] Figure 1 This is a schematic diagram of the main flow of a network performance testing method according to an embodiment of the present invention;
[0055] Figure 2 is a flow chart of an optional network performance testing method according to an embodiment of the present invention;
[0056] Figure 3 It is a logical diagram of the process of cloud platform network performance testing;
[0057] Figure 4 is a flow chart of another optional network performance testing method according to an embodiment of the present invention;
[0058] Figure 5 is a flow chart of another optional network performance testing method according to an embodiment of the present invention;
[0059] Figure 6 is a schematic diagram of main modules of a network performance testing device according to an embodiment of the present invention;
[0060] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0061] Figure 8It is a schematic diagram of the structure of a computer system of a mobile device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0062] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0063] It should be pointed out that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The acquisition, storage, use, processing and other aspects of data (such as user personal information) in the technical solution of this application are in compliance with the provisions of relevant laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities. Necessary measures should be taken for user personal information to prevent illegal access to such personal information data, ensure that persons who have access to personal information data comply with the provisions of relevant laws and regulations, and ensure the security of user personal information. Once these user personal information data are no longer needed, the risks should be minimized by restricting or even prohibiting data collection and / or deleting data.
[0064] When applicable, including in certain relevant applications, user privacy is protected by de-identifying data, such as by removing specific identifiers (e.g., date of birth, etc.) when applicable, controlling the amount or specificity of data stored, controlling how data is stored, and / or other methods of de-identification.
[0065] The traditional application deployment method is to install applications through plug-ins or scripts. The disadvantage of this is that the operation, configuration, management, and entire life cycle of the application will be bound to the current operating system, which is not conducive to application upgrades / rollbacks. Some functions can also be achieved by creating virtual machines, but virtual machines are very heavy and not conducive to portability.
[0066] The new approach is to deploy containers. Containers are isolated from each other, each with its own file system. Processes between containers do not affect each other, and computing resources can be differentiated. Compared with virtual machines, containers can be deployed quickly. Since containers are decoupled from the underlying infrastructure and machine file systems, they can be migrated between different clouds and different versions of operating systems.
[0067] Kubernetes, or K8s for short, is an abbreviation that replaces the eight characters "ubernete" with "8". Currently, K8s has become the mainstream in the cloud computing industry and the first choice for container orchestration. Simply put, K8s is a container cluster management system that manages containerized applications or operating systems on multiple hosts in a cloud platform, providing functions such as resource scheduling, deployment and operation, rolling upgrades, and capacity expansion and contraction. This solution is based on K8s and involves network performance testing of different container network interfaces CNI (container Networking Interface). Pod is the smallest scheduling unit in K8s. A Pod encapsulates a container (or multiple containers). The containers in the Pod share storage, network, etc. Therefore, this solution is also applicable to CNI network performance testing across Pods.
[0068] See also Figure 1 , which shows a main flow chart of a network performance testing method provided by an embodiment of the present invention, comprising the following steps:
[0069] S101: In response to a selection operation on a target server, determining a container corresponding to the target server, and acquiring an Internet Protocol IP address of the container;
[0070] S102: Determine a client corresponding to the target server to trigger the client to initiate a network performance test request for the network interface of the IP address;
[0071] S103: receiving the network performance test request, calling the test tool deployed in the container to cyclically test the network performance of the network interface, and obtaining a test result file set;
[0072] S104: Calling a preset processing script, determining a plurality of test result files having the same preset position field in the file name, processing the plurality of test result files, obtaining a target test result and returning it.
[0073] In the above implementation, in the current cloud computing environment, the role of the network in performance is becoming more and more important, and the system is becoming more and more distributed. Any network performance problem may lead to slow business response, so it is necessary to test the network performance. Commonly used network performance testing tools include Qperf, Netperf, Iperf, etc.
[0074] Take Iperf as an example. Iperf is a network performance testing tool based on TCP (Transmission Control Protocol) / IP (Internet Protocol Address) and UDP (User Datagram Protocol) / IP. It can be used to measure network bandwidth and network quality, and can also provide statistical information such as network delay jitter, packet loss rate, and maximum transmission unit. Network administrators can understand and judge network performance problems based on this information, thereby locating network bottlenecks and solving network failures.
[0075] In terms of working mode, Iperf runs in server and client mode. The server is mainly used to monitor the incoming test requests, while the client is mainly used to initiate connection sessions. Therefore, to use Iperf, two servers are required, one running in server mode and the other running in client mode.
[0076] For steps S101 to S102, this solution mainly uses Qperf technology. Compared with Netperf and Iperf, Qperf is a new tool. The working principle of Qperf is similar to that of Iperf, but Qperf supports loop traversal testing. Compared with the feature of Iperf that only tests once at a time, Qperf can be executed once and loop multiple tests. Qperf also needs to create two Qperf instances. One is artificially used as the server, and the Qperf process is run on the server to turn on the server mode. The sample code is root@q-sever-share-1: / #Qperf; the other is used as the client, and a network performance test request is initiated on the client.
[0077] The tester first selects a server as the target server on the financial-grade cloud platform. One server corresponds to only one container, so the container corresponding to the target server can be determined based on the correspondence between the server and the container. In this solution, each container is equipped with a network interface CNI for external services, and each network interface is equipped with an IP address. The IP addresses of network interfaces of different containers are different. The IP address can also be displayed on the interface of the financial-grade cloud platform.
[0078] In this solution, the relationship between the server and the client can be one-to-one or many-to-one, which is set by the staff. The performance test of the container network interface needs to be triggered by the client. Therefore, after the tester selects the target server, the corresponding client needs to be triggered so that the client initiates a network performance test request for the container's network interface.
[0079] For step S103, each container is configured with the Qperf test tool. Therefore, after receiving the network performance test request for the container network interface CNI initiated by the client, the financial-grade cloud platform will call the Qperf test tool deployed in the container to perform multiple loop tests on the network performance of the CNI, and record the test result data of each time into a raw format file, usually looping 10 to 20 times (the value is adjustable, this is just an example), and the obtained test result file examples are: x_10.193.144.158_data_2022-08-22-09-0.raw, x_10.193.144.158_data_2022-08-22-09-1.raw.
[0080] For step S104, since the test environment of the financial-grade cloud platform is subject to strict security factors and is often in a cloud desktop or sandbox, it is particularly difficult to export and reprocess a large amount of test data in a secure environment. To solve this problem, this solution places the original test results and data processing in the same cloud operation plane, and only the processed test results are returned in the end, and the final test results are simple and clear.
[0081] The file name consists of a prefix and a suffix. The prefix is the main file name, and the suffix is the file format. For example, in the aforementioned x_10.193.144.158_data_2022-08-22-09-0.raw, x_10.193.144.158_data_2022-08-22-09-0 is the prefix, and raw is the suffix. The prefix includes a timestamp. In some scenarios, long-term stability testing with load is required, which can be achieved by specifying the test run time (using the -t parameter). For example, to test 10 seconds of TCP bandwidth, you can use the -t parameter as follows: #Qperf[Pod-IP]-t 10tcp_bw.
[0082] In this solution, the prefix of the test result file name mainly consists of three parts: the network plug-in name (or CNI name), the container IP address or the server IP address, and the timestamp. The positions of the three can be adjusted arbitrarily and are set by the staff to form an ABC format.
[0083] Based on this feature, it can be determined which test result files have the same file names in the fields at the preset positions, such as x_10.193.144.158_data_2022-08-22-09-0.raw and x_10.193.144.158_data_2022-08-22-09-1.raw. The fields at position A of these two files are both x, the fields at position B are both 10.193.144.158, and the fields at position C are both 2022-08-22-09. Therefore, these two files can be merged for processing, and the processing includes but is not limited to averaging the data in the two files and taking out the maximum and minimum values and then calculating the average.
[0084] The method provided in the above embodiment uses the Qperf test tool to perform multiple cyclic tests on the network performance of the container CNI in a cloud platform environment, which solves the problem that the existing test can only be performed once; the original data result file obtained from the test and the data processing are in the same operation plane, and only the final processed data is returned, thereby removing environmental influencing factors, effectively saving the workload of testers, and maintaining the data security of the financial-grade cloud platform.
[0085] See also Figure 2 , shows a schematic flow chart of an optional network performance testing method according to an embodiment of the present invention, comprising the following steps:
[0086] S201: In response to a create container instruction, receiving a configuration operation on a container image, environment variables, and configuration parameters to create a container; wherein the container image is obtained by packaging a test tool and operating system information, the test tool is deployed in the container, and the environment variables and configuration parameters are used when the container is running;
[0087] S202: In the process of creating a container, receiving a selection operation of a type of network plug-in in the network plug-in type list, and displaying a network plug-in list of the type of network plug-in;
[0088] S203: Receive a selection operation on one of the network plug-ins in the network plug-in list, and use the one of the network plug-ins as a network interface of the container.
[0089] In the above implementation, for step S201, the data preparation phase is described here. First, a container needs to be created on a financial-grade cloud platform. The goal of K8s is to make the deployment of containerized applications simple and efficient. K8s provides a mechanism for application deployment, planning, updating, and maintenance.
[0090] Creating a container mainly includes configuration operations on container images, environment variables, and configuration parameters. Containers take up less resources and are quick to deploy. Each application / operating system can be packaged into a container image. The one-to-one relationship between each application / operating system and the container also gives containers greater advantages. Using containers, you can create container images for applications during the build or release phase, because each application does not need to be combined with the rest of the application stack, nor does it rely on the production environment infrastructure, which enables a consistent environment from R&D to testing and production. Similarly, containers are lighter and more "transparent" than virtual machines, making them easier to monitor and manage. The container image here needs to be made by yourself. The container host in this solution is the Linux operating system, and the Qperf test tool and Linux operating system information need to be packaged into a container image.
[0091] If you do not set environment variables and configuration parameters, the container will not run, so environment variables and configuration parameters are used when the container is running. Most environment variables have been configured in the container image. For example, if you need to configure the client or the server, you need to send the server IP address to the client and the client IP address to the server. In some cases, the server and the client are one, so there is no need to send the IP address. When the correspondence between the client and the server changes, the IP address also needs to be modified accordingly. Configuration parameters such as service port information.
[0092] For steps S202 and S203, the container relies on the network interface CNI to interact with the outside world. Therefore, in addition to creating the container, the network interface CNI of the container needs to be set. CNI has type restrictions, such as vpc2.0. In actual operation, multiple types of network plug-ins may be set, such as X, Y, and Z. The staff first selects one type of network plug-in from the network plug-in type on the financial-grade cloud platform, such as selecting a type of network plug-in X. In response to this operation, the cloud platform automatically pulls a list of all network plug-ins belonging to type X, so that the staff can select one from the list, such as selecting a3 from a1 / a2 / a3 / a4...an, and finally uses the selected network plug-in a3 as the network interface of the container.
[0093] In addition to the above operations, this solution will also deploy the Qperf test tool in a container on the financial-grade cloud platform. K8s does not deploy the Qperf test tool. This solution measures the network performance of different containers, and K8s needs to manage all containers, so the Qperf test tool needs to be deployed on K8s.
[0094] The financial-grade cloud platform is set up with one or more test clusters, each of which has one or more containers deployed. The network plug-in types of each container are different, such as containers with the aforementioned three types of network plug-ins: X, Y, and A. This solution takes place in the test cluster to test the network performance of the container's network interface. For details, see Figure 3 shown.
[0095] The method provided in the above embodiment implements configurable operations on the container by creating a container and selecting a network plug-in for the container.
[0096] See also Figure 4 , shows a schematic flow chart of another optional network performance testing method according to an embodiment of the present invention, comprising the following steps:
[0097] S401: In response to a selection operation on a target server, determining a container corresponding to the target server, and acquiring an Internet Protocol IP address of the container;
[0098] S402: Determine a client corresponding to the target server to trigger the client to initiate a network performance test request for the network interface of the IP address;
[0099] S403: receiving the network performance test request, calling the test tool deployed in the container to cyclically test the network performance of the network interface, and obtaining a set of test result files; wherein each test result file includes test result data of a plurality of message packet sizes;
[0100] S404: calling a first preset processing script to perform a format conversion operation on the test result data in each test result file in batches;
[0101] S405: Call a preset processing script to determine multiple test result files with the same preset position field in the file name, read the test result data of the same message packet size in the multiple test result files, take the average value of the test result data of the same message packet size, and return the obtained average value as the target test result.
[0102] In the above implementation, for steps S401 to S403, see Figure 1 The description shown is not repeated here.
[0103] In step S404, after the network performance of the container CNI is tested in a loop using the Qperf test tool, multiple test result files are obtained. However, considering that different time periods may have different units, it is necessary to perform preprocessing operations on the data before formally processing the test result data, specifically, format conversion operations.
[0104] Use Python scripts to batch convert the format of the test result data in all raw files, such as removing the unit name after the number, unit conversion, etc., such as converting GB to MB, so that all test result data have unified units, preparing for the next step of formal processing.
[0105] Here is an example:
[0106] #msgsize(Bytes)bw(MB / sec)lat(us) 64 12.0 25 256 40.5 24 1024 58.8 24 4096 146.0 31 16384 516.0 35 65536 1443.8 49
[0113] For step S405, when the Qperf test tool performs multiple loop tests on the network interface CNI, the message packet size can be changed each time, for example, from 16K to 64K, and the size is doubled each time until 64K. Multiple message packets of different sizes can also be set at the same time, such as 16K, 32K, and 64K, to achieve simultaneous testing.
[0114] #Qperf 11.165.67.18-oo msg_size:1:64K:*2-vu tcp_bw tcp_lat
[0115] tcp_bw:
[0116] bw=3.06MB / sec
[0117] msg_size = 1 bytes
[0118] tcp_bw:
[0119] bw=6.15MB / sec
[0120] msg_size = 2 bytes
[0121] tcp_bw:
[0122] bw=12MB / sec
[0123] …
[0124] You can set up a Shell script, pre-set the IP address table and save it to a specified path, so that the IP address, such as 11.165.67.18 above, can be passed to the Shell script as a parameter without having to copy or enter it manually each time.
[0125] Therefore, each test result file may contain a lot of test result data with different packet sizes. First, determine multiple test result files with the same preset position field in the file name prefix, and perform a loop averaging operation on the test result data of each message packet size in these test result files to obtain the average value of multiple tests. It is not easy to make mistakes when looping and calculating the average value. The command is as follows: ls [filename] - [0-9] | xargs . / avg.py> [filename]_avg, and the format of the average value data obtained is consistent with that before taking the value.
[0126] Taking the network rate of different message packet sizes as an example, the message packet size and the incremental gradient can be customized by the tester, some set the gradient to 2, and some set the gradient to 10. Assuming that the Qperf test tool is executed once an hour, if you need to test the network rate of different message packet sizes throughout the day, you need to take the average value and classify it according to different message packet sizes, because the rate of different message sizes is affected by fragmentation.
[0127] The method provided in the above embodiment converts the format of the test result data in the file before formally processing the data result file to unify the format of the data, and subsequently only selects files with the same prefix field for merging to improve the accuracy of the test results.
[0128] See also Figure 5 , shows a schematic flow chart of another optional network performance testing method according to an embodiment of the present invention, comprising the following steps:
[0129] S501: In response to a selection operation on a target server, determining a container corresponding to the target server, and acquiring an Internet Protocol IP address of the container;
[0130] S502: Determine a client corresponding to the target server to trigger the client to initiate a network performance test request for the network interface of the IP address; wherein the network performance includes a bandwidth index and a delay index;
[0131] S503: receiving the network performance test request, calling the test tool deployed in the container to cyclically test the network performance of the network interface, and obtaining a test result file set;
[0132] S504: Call a preset processing script, determine multiple test result files with the same preset position field in the file name, process the multiple test result files, obtain the target test result and return it.
[0133] In the above embodiment, for steps S501 and S504, see Figure 1 to Figure 4 The description shown is not repeated here.
[0134] For steps S502 and S503, one of the purposes of the network performance test is to monitor the utilization rate of the network bandwidth. Maximizing the utilization of network bandwidth is the basis for ensuring network performance. However, due to unreasonable network design, network security vulnerabilities and other reasons, the network bandwidth utilization rate is not high. To find the reason for the low network bandwidth utilization rate, it is necessary to monitor the network transmission.
[0135] The network performance of this solution mainly has two indicators: bandwidth and latency. The sample code is as follows:
[0136]
[0137] Latency determines the maximum QPS (Query Per Second), while bandwidth determines the maximum load that can be supported. Qperf, like Iperf / Netperf, can evaluate the bandwidth and latency between two nodes, and can test TCPIP protocol and RDMA (Remote Direct Memory Access) transmission. However, compared with Netperf and Iperf, supporting RDMA is a unique feature of the Qperf tool.
[0138] After obtaining the network card, switch model and physical distance, the bandwidth and delay can be determined in theory. However, in the actual environment, due to the use of different network card drivers, switch hop counts, and network configurations, different network interfaces will have different performances, so testing and verification are required. And during testing, it is usually necessary to obtain the bandwidth and delay performance curves of the network interface. Through the loop test provided by the Qperf test tool, all test result data can be obtained with one command.
[0139] A test result file is for one test. After obtaining the test result file for a certain CNI, you can compare it horizontally with the network performance of other CNI plug-ins in the same host environment. You can also test the CNI plug-in in different time periods to obtain the network performance comparison of the CNI plug-in or the same CNI plug-in in different time periods, which greatly reduces the workload of testers in processing data. Here, you can use the common data analysis software in this field for further processing. You can also make a vertical comparison, at this time for different network layers, such as container network plug-ins and host network.
[0140] For example, share is a CNI plug-in, and calico is also a CNI plug-in. These two plug-ins are tested at different times. Through the above operations, the final test results can be quickly obtained, which is convenient for the next step to draw a chart to display the results. The sample results are as follows:
[0141] calico-0704share-0706-2
[0142] calic0-0706-2share-0706-kua
[0143] calic0-0707-1share-0707-2
[0144] calico-0711-1share-0711-2
[0145] calico-0712-1share-0712-2
[0146] In the method provided in the above embodiment, the tester directly uses the Qperf test tool in the cloud platform environment to perform network performance testing between Pods. The network performance includes bandwidth and latency, thereby achieving all-round testing. The processed test result data is simple and clear, which is convenient for horizontal and vertical comparison of network performance of different network plug-ins.
[0147] See also Figure 6 , shows a schematic diagram of main modules of a network performance testing device 600 provided in an embodiment of the present invention, including:
[0148] A response module 601 is used to determine a container corresponding to the target server in response to a selection operation on the target server, and obtain an Internet Protocol IP address of the container;
[0149] A trigger module 602 is used to determine a client corresponding to the target server to trigger the client to initiate a network performance test request for the network interface of the IP address;
[0150] The test module 603 is used to receive the network performance test request, call the test tool deployed in the container, so as to cyclically test the network performance of the network interface and obtain a test result file set;
[0151] The processing module 604 is used to call a preset processing script, determine multiple test result files with the same preset position field in the file name, process the multiple test result files, obtain the target test result and return it.
[0152] The implementation device of the present invention also includes a creation module, which is used to:
[0153] In response to a create container instruction, configuration operations on a container image, environment variables, and configuration parameters are received to create a container; wherein the container image is obtained by packaging a test tool and operating system information, the test tool is deployed in the container, and the environment variables and configuration parameters are used when the container is running.
[0154] In the implementation device of the present invention, the creation module is also used for:
[0155] In the process of creating the container, receiving a selection operation of a type of network plug-in in the network plug-in type list, and displaying a network plug-in list of the type of network plug-in;
[0156] A selection operation of one of the network plug-ins in the network plug-in list is received, and the one of the network plug-ins is used as a network interface of the container.
[0157] The implementation device of the present invention also includes an instance module, which is used to:
[0158] Create two instances and run one of them in server mode to enable server mode by running a preset test process; and
[0159] Another instance is run in client mode to trigger the client to initiate a network performance test request for the network interface of the IP address.
[0160] The implementation device of the present invention also includes a format conversion module, which is used to: call a first preset processing script to perform a format conversion operation on the test result data in each test result file in batches.
[0161] In the implementation device of the present invention, each test result file includes test result data of a size of multiple message packets;
[0162] The processing module 604 is used to:
[0163] The test result data of the same message packet size in the multiple test result files are read, an average operation is performed on the test result data of the same message packet size, and the obtained average is used as the target test result and returned.
[0164] In the implementation device of the present invention, the network performance includes a bandwidth index and a delay index, and the test result file includes a bandwidth rate and a delay duration.
[0165] The implementation device of the present invention also includes a deployment module, which is used to:
[0166] The test tool is deployed in a container manner on a financial-grade cloud platform; wherein the financial-grade cloud platform is provided with one or more test clusters, each test cluster is deployed with one or more containers, and each container has a different type of network plug-in.
[0167] In the implementation device of the present invention, the test tool is a Qperf test tool.
[0168] In addition, the specific implementation content of the device described in the embodiment of the present invention has been described in detail in the method described above, so the repeated content will not be described again here.
[0169] Figure 7 An exemplary system architecture 700 to which embodiments of the present invention may be applied is shown, including terminal devices 701 , 702 , 703 , a network 704 and a server 705 (only an example).
[0170] Terminal devices 701, 702, 703 can be various electronic devices with display screens and supporting web browsing, and various communication client applications are installed. Users can use terminal devices 701, 702, 703 to interact with server 705 through network 704 to receive or send messages, etc.
[0171] The network 704 is used to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. The network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables.
[0172] The server 705 may be a server that provides various services. It should be noted that the method provided in the embodiment of the present invention is generally executed by the server 705 , and accordingly, the device is generally set in the server 705 .
[0173] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0174] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device suitable for implementing an embodiment of the present invention. Figure 8 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0175] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0176] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0177] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.
[0178] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0179] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing 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 boxes represented in succession 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 or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0180] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor includes a response module, a trigger module, a test module, and a processing module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, a processing module may also be described as a "data processing module".
[0181] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device executes any of the above network performance testing methods.
[0182] The computer program product of the present invention comprises a computer program, and when the computer program is executed by a processor, the network performance testing method in the embodiment of the present invention is implemented.
[0183] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A network performance testing method, characterized in that: include: In response to a selection operation on a target server, determining a container corresponding to the target server, and acquiring an Internet Protocol IP address of the container; Determining a client corresponding to the target server to trigger the client to initiate a network performance test request for the network interface of the IP address; Receive the network performance test request, call the test tool deployed in the container to cyclically test the network performance of the network interface, and obtain a test result file set; Call a preset processing script, determine multiple test result files with the same preset position field in the file name, process the multiple test result files, obtain the target test result and return it.
2. The method according to claim 1, characterized in that: Before calling the test tool deployed in the container, the method further includes: In response to a create container instruction, configuration operations on a container image, environment variables, and configuration parameters are received to create a container; wherein the container image is obtained by packaging a test tool and operating system information, the test tool is deployed in the container, and the environment variables and configuration parameters are used when the container is running.
3. The method according to claim 2, characterized in that The method further comprises: In the process of creating the container, receiving a selection operation of a type of network plug-in in the network plug-in type list, and displaying a network plug-in list of the type of network plug-in; A selection operation of one of the network plug-ins in the network plug-in list is received, and the one of the network plug-ins is used as a network interface of the container.
4. The method according to claim 1, characterized in that: Before determining a container corresponding to the target server in response to the selection operation on the target server, the method further includes: Create two instances and run one of them in server mode to enable server mode by running a preset test process; and Another instance is run in client mode to trigger the client to initiate a network performance test request for the network interface of the IP address.
5. The method according to claim 1, characterized in that After obtaining the test result file set, the method further includes: calling a first preset processing script to perform a format conversion operation on the test result data in each test result file in batches.
6. The method according to claim 1 or 5, characterized in that: Each test result file includes test result data of a size of multiple message packets; The processing of the plurality of test result files to obtain and return target test results includes: The test result data of the same message packet size in the multiple test result files are read, an average operation is performed on the test result data of the same message packet size, and the obtained average is used as the target test result and returned.
7. The method according to any one of claims 1 to 5, characterized in that Network performance includes bandwidth indicators and delay indicators, and the test result file includes bandwidth rate and delay duration.
8. The method according to claim 1, characterized in that Before determining a container corresponding to the target server in response to the selection operation on the target server, the method further includes: The test tool is deployed in a container manner on a financial-grade cloud platform; wherein the financial-grade cloud platform is provided with one or more test clusters, each test cluster is deployed with one or more containers, and each container has a different type of network plug-in.
9. A network performance testing device, characterized in that: include: A response module, configured to determine a container corresponding to the target server in response to a selection operation on the target server, and obtain an Internet Protocol IP address of the container; A trigger module, used to determine a client corresponding to the target server, so as to trigger the client to initiate a network performance test request for the network interface of the IP address; A test module, configured to receive the network performance test request, call the test tool deployed in the container, so as to cyclically test the network performance of the network interface, and obtain a test result file set; The processing module is used to call a preset processing script, determine multiple test result files with the same preset position field in the file name, process the multiple test result files, obtain the target test result and return it.
10. The device according to claim 9, characterized in that It also includes a format conversion module, which is used to call a first preset processing script to perform format conversion operations on the test result data in each test result file in batches.
11. The device according to claim 9 or 10, characterized in that Each test result file includes test result data of a size of multiple message packets; The processing module is used for: The test result data of the same message packet size in the multiple test result files are read, an average operation is performed on the test result data of the same message packet size, and the obtained average is used as the target test result and returned.
12. The device according to claim 10, characterized in that Network performance includes bandwidth indicators and delay indicators, and the test result file includes bandwidth rate and delay duration.
13. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
14. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Pressure test method of gRPC interface, computer equipment and storage medium
CN111752820A
Method and device for automatically testing quality of k8s cluster network and storage medium
CN114915571A