Method, device and equipment for testing user state data load balancing based on DPU (Data Processing Unit) network card
Patent Information
- Application Number
- CN202410761906.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-10-01
AI Technical Summary
[0037] In summary, the method shown in the embodiments of this application implements data sending and receiving by calling a low-latency protocol stack, which can reduce data concurrency delay and more intuitively determine the situation of multi-channel load balancing.
Smart Images

Figure CN118740677A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of network communication technology, and in particular to a test method, device, equipment and storage medium for user-mode data load balancing based on a DPU network card. Background Art
[0002] Low-latency network cards achieve acceleration by processing TCP and UDP protocol-related traffic through the TCP / IP acceleration protocol stack embedded in the network card, thereby bypassing the kernel-mode protocol stack. Currently developed low-latency network cards support hardware multi-queues. The TCP, UDP process or thread network card created by the low-latency acceleration library will be assigned a queue, which will be sent to the low-latency acceleration protocol stack for processing; and multi-user (multi-process) concurrent scenarios are the main scenarios for existing network applications, so it is particularly important to test whether the load balance of multi-user concurrent acceleration channel data transmission and reception is particularly important. Summary of the invention
[0003] The embodiments of the present application provide a test method, device and equipment for user-mode data load balancing based on a DPU network card. By calling a low-latency protocol stack to realize data reception and transmission, data concurrency delay can be reduced, and the multi-channel load balancing situation can be judged more intuitively through charts.
[0004] In a first aspect, an embodiment of the present application provides a test method for user-mode data load balancing based on a DPU network card, comprising:
[0005] Determining at least two servers, wherein the at least two servers include a first server;
[0006] Acquire a test environment, and configure IP addresses and test files for the at least two servers in the test environment;
[0007] According to the IP address and the test file, at least one user-mode data channel load balancing of the network card running on the first server is tested.
[0008] In a possible implementation, the test file includes: at least one of a TCP process script, a UDP process script, or a thread sending and receiving script, and an execution script.
[0009] In a possible implementation, the at least two servers include a second server, and the TCP or UDP process script is used to send and receive at least one process data, including:
[0010] Run a listening script on the first server and run a sending script of at least one TCP or UDP process on the second server; or,
[0011] Run a listening script on the first server, and run a sending script of at least one thread on the second server;
[0012] According to the monitoring script and the sending and receiving script, a data connection is established and data sending and receiving are realized.
[0013] In a possible implementation, establishing a data connection and implementing data transmission and reception according to the monitoring script and the transmission and reception script includes:
[0014] After the execution script establishes the data connection, the execution script calls the monitoring script and the sending and receiving script to realize the sending and receiving of data.
[0015] In a possible implementation, the method further includes:
[0016] The execution script performs data statistics and format conversion on the first server according to the first parameter.
[0017] In a possible implementation, the first parameter includes at least one of the following: a statistical interval, a statistical number, a number of processes, a number of threads, or a number of acceleration channels.
[0018] In a second aspect, an embodiment of the present application provides a test device for user-mode data load balancing based on a DPU network card, comprising:
[0019] A determination module, configured to determine at least two servers, wherein the at least two servers include a first server;
[0020] An acquisition module, used for acquiring a test environment, in which an IP address and a test file are configured for the at least two servers;
[0021] The test module is used to test the load balancing of at least one user-mode data channel of the network card running on the first server according to the IP address and the test file.
[0022] In a possible implementation, the test file includes: at least one of a TCP process script, a UDP process script, or a thread sending and receiving script, and an execution script.
[0023] In a possible implementation, the device further includes a transceiver module, the at least two servers include a second server, and the TCP or UDP process script is used to send and receive at least one process data, including:
[0024] Run a listening script on the first server and run a sending script of at least one TCP or UDP process on the second server; or,
[0025] Run a listening script on the first server, and run a sending script of at least one thread on the second server;
[0026] The transceiver module is used to establish a data connection and realize data transmission and reception according to the monitoring script and the transceiver script.
[0027] In a possible implementation, the transceiver module is further used to:
[0028] After the execution script establishes the data connection, the execution script calls the monitoring script and the sending and receiving script to realize the sending and receiving of data.
[0029] In a possible implementation manner, the device further includes an execution module, and the execution module is used to execute the execution script, that is, to perform data statistics and format conversion on the first server according to the first parameter.
[0030] In a possible implementation, the first parameter includes at least one of the following: a statistical interval, a statistical number, a number of processes, a number of threads, or a number of acceleration channels.
[0031] In a third aspect, an embodiment of the present application further provides an electronic device, the electronic device comprising:
[0032] at least one processor;
[0033] and a memory communicatively coupled to the at least one processor;
[0034] Among them, the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor to enable the electronic device to perform a load balancing test method corresponding to any embodiment in the first aspect of the embodiments of the present application.
[0035] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement a load balancing test method such as any one of the first aspect of the embodiments of the present application.
[0036] In a fifth aspect, the present disclosure further provides a computer program product, which includes computer execution instructions. When the computer execution instructions are executed by a processor, they are used to implement the load balancing test method of any embodiment corresponding to the first aspect of the present disclosure.
[0037] In summary, the method shown in the embodiment of the present application realizes data reception and transmission by calling a low-latency protocol stack, which can reduce data concurrency delay and more intuitively judge the multi-channel load balancing situation. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0039] 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 labor.
[0040] Figure 1 A test network diagram for user-mode data load balancing provided in an embodiment of the present application;
[0041] Figure 2 A test method for user state data load balancing provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of a test process provided for an embodiment of the present application;
[0043] Figure 4 A schematic diagram of the load balancing situation provided in the embodiment of the present application;
[0044] Figure 5 A schematic diagram of a test device for user-mode data load balancing provided in an embodiment of the present application;
[0045] Figure 6 A test electronic device for user-mode data load balancing provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.
[0047] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The following will describe the embodiments of the present application in conjunction with the accompanying drawings.
[0048] 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.
[0049] Low-latency network cards achieve acceleration by processing TCP and UDP protocol-related traffic through the TCP / IP acceleration protocol stack embedded in the network card, thereby bypassing the kernel-mode protocol stack. Currently developed low-latency network cards support hardware multi-queues. The TCP, UDP process or thread network card created by the low-latency acceleration library will be assigned a queue, which will be sent to the low-latency acceleration protocol stack for processing; and multi-user (multi-process) concurrent scenarios are the main scenarios for existing network applications, so it is particularly important to test whether the load balance of multi-user concurrent acceleration channel data transmission and reception is particularly important.
[0050] Existing testing tools all have shortcomings and deficiencies and cannot meet testing requirements. For example, Iperf, netperf, qperf, and sfnt-stream cannot implement multi-threaded or multi-process packet sending and receiving. Multiple terminals need to be opened to start multi-link processes, and there is a large time interval problem for starting multiple processes. In addition, the tool packaging model is relatively simple and cannot guarantee flexible changes in the business model.
[0051] Test instruments: poor interactivity, poor flexibility, and high testing costs;
[0052] The embodiment of the present application implements TCP / UDP link establishment and data transmission and reception through python3 socket multi-process / multi-thread programming, and implements multi-channel concurrent load balancing testing based on the specific low-latency network card (matching rules of low-latency network card acceleration channel: each process or thread matches one acceleration channel).
[0053] The test method for user-mode data load balancing provided in the embodiment of the present application realizes data transmission and reception by calling a low-latency protocol stack, which does not require additional test equipment investment and is flexible to use; it can reduce data concurrency delay and more intuitively judge the multi-channel load balancing situation through charts. Moreover, the traffic model is closest to the real business model, which can realize the transmission and reception of data packets and check the consistency of the transmitted and received packets.
[0054] like Figure 1 As shown, in order to implement the test network diagram of user-state data load balancing based on DPU network card shown in the embodiment of the present application, a schematic diagram of the network architecture is constructed. Figure 1 The system includes two Linux hosts, one end as a client and the other end as a server. In practical applications, the client and the server can establish a communication connection to realize TCP short connection communication, TCP long connection communication, and UDP transceiver communication, etc. The Linux host can also be called a server. In the embodiment of the present application, the auxiliary test network card end is used as a client, that is, the second server; the server where the tested network card is located is used as a server, that is, the first server.
[0055] Exemplarily, the test network and test environment involved in the embodiment of the present application are deployed: python3 is installed on the first server and the second server, and the python script is run.
[0056] The following is an illustrative explanation of the terms involved in the embodiments of the present application.
[0057] (1) Acceleration queue: A network port contains a queue that can be used by a VI. Depending on the configuration, a network port contains zero or more acceleration queues.
[0058] (2) gnuplot: gnuplot is a command-driven interactive function plotting program.
[0059] like Figure 2 As shown, the embodiment of the present application provides a test method for user-mode data load balancing based on a DPU network card. By calling a low-latency protocol stack to implement data transmission and reception, data concurrency delay can be reduced, and the multi-channel load balancing situation can be judged more intuitively. Figure 2 In the process, steps S201 to S203 are included, and each step is described in detail as follows.
[0060] Step S201: determining at least two servers, where the at least two servers include a first server.
[0061] In the embodiment of the present application, two servers are used for exemplary description, wherein the first server is used as the main test device, and the network card to be tested is inserted therein. The at least two servers also include a second server, and the second server is used as an auxiliary test device. It can be understood that the main test device and the auxiliary test device can be a Linux host, or a PC, or a server that can realize the function, and the embodiment of the present application does not limit this.
[0062] Step S202, obtaining a test environment, and configuring IP addresses and test files for the at least two servers in the test environment.
[0063] In the embodiment of the present application, a test environment needs to be built first. In the process of building the test environment, data access between the two servers can be achieved by configuring the same IP address for the first server and the second server. The test file is copied to the second server and the first server where the network card under test is located.
[0064] In a possible implementation, the test file includes: at least one of a TCP process script, a UDP process script, or a thread sending and receiving script, and an execution script.
[0065] In a possible implementation, the at least two servers include a second server, and the TCP or UDP process script is used to send and receive at least one process data, including:
[0066] Run a listening script on the first server and run a sending script of at least one TCP or UDP process on the second server; or,
[0067] Run a listening script on the first server, and run a sending script of at least one thread on the second server;
[0068] According to the monitoring script and the sending and receiving script, a data connection is established and data sending and receiving are realized.
[0069] It can be understood that the data connection established at this time is at least one multi-channel data established.
[0070] In a possible implementation, establishing a data connection and implementing data transmission and reception according to the monitoring script and the transmission and reception script includes:
[0071] After the execution script establishes the data connection, the execution script calls the monitoring script and the sending and receiving script to realize the sending and receiving of data.
[0072] In a possible implementation, the method further includes:
[0073] The execution script performs data statistics and format conversion on the first server according to the first parameter.
[0074] In a possible implementation, the first parameter includes at least one of the following: a statistical interval, a statistical number, a number of processes, a number of threads, or a number of acceleration channels.
[0075] Exemplarily, in the embodiment of the present application, the first parameter is described in detail as follows:
[0076] [root@bogon MultiQ]#. / start.sh
[0077] usage:. / start.sh interval count queuenum
[0078] Parameter Description:
[0079] interval: statistical interval;
[0080] count: the number of statistics;
[0081] queuenum: number of processes / threads or acceleration channels;
[0082] Exemplarily, after the statistical number count is completed, a plt file is generated, and a chart is generated according to the plt file, and the chart is used to analyze the load balancing of multi-channel traffic.
[0083] Step S203: Test the load balancing of at least one user-mode data channel of the network card running on the first server according to the IP address and the test file.
[0084] like Figure 3 The figure is a schematic diagram of the test flow provided by the embodiment of the present application. Figure 3 In one possible implementation, the scripts of the client and server are run, and the server runs a multi-process python listening process (test file) through a low-latency acceleration library;
[0085] In another possible implementation, the client executes a multi-process link python script (test file) to establish a link with the peer server, send and receive packets;
[0086] In another possible implementation, after the link is successfully established on the server side, the low-latency acceleration library will automatically create an IP rule for each link. After the subsequent traffic hits the rule, it will be sent to the acceleration queue and passed to the user-mode protocol stack.
[0087] In another possible implementation, while multi-channel data is being sent and received, the receiving statistics of each channel on the server are counted, and the statistical data file is converted into a format recognized by the plt tool through a shell script.
[0088] In another possible implementation, a shell script is used to generate a xx.plt file according to the number of channels, and the file can be opened with the gnuplot tool to obtain the following Figure 4 The line chart shown.
[0089] exist Figure 4 In the figure, 100 TCP link processes receiving data through 100 acceleration channels are taken as an example; the horizontal axis is time, and the vertical axis is the total amount of data received by each acceleration channel. The load balancing is mainly judged by whether multiple acceleration channels receive data at the same time and whether the data increment of each acceleration channel is consistent over time. From this figure, it can be seen that the 100 channel loads are receiving data at the same time at a certain point in time and the increment remains consistent.
[0090] The test method for user-mode data load balancing provided in the embodiment of the present application realizes data transmission and reception by calling a low-latency protocol stack, which does not require additional test equipment investment and is flexible to use; it can reduce data concurrency delay and more intuitively judge the situation of multi-channel load balancing. Moreover, the traffic model is closest to the real business model, which can realize the transmission and reception of data packets and check the consistency of the transmitted and received packets.
[0091] Figure 5 A test device for user-state data load balancing based on a DPU network card is provided for an embodiment of the present application, including:
[0092] A determination module, configured to determine at least two servers, wherein the at least two servers include a first server;
[0093] An acquisition module, used for acquiring a test environment, in which an IP address and a test file are configured for the at least two servers;
[0094] The test module is used to test the load balancing of at least one user-mode data channel of the network card running on the first server according to the IP address and the test file.
[0095] In a possible implementation, the test file includes: at least one of a TCP process script, a UDP process script, or a thread sending and receiving script, and an execution script.
[0096] In a possible implementation, the device further includes a transceiver module, the at least two servers include a second server, and the TCP or UDP process script is used to send and receive at least one process data, including:
[0097] Run a listening script on the first server and run a sending script of at least one TCP or UDP process on the second server; or,
[0098] Run a listening script on the first server, and run a sending script of at least one thread on the second server;
[0099] The transceiver module is used to establish a data connection and realize data transmission and reception according to the monitoring script and the transceiver script.
[0100] In a possible implementation, the transceiver module is further used to:
[0101] After the execution script establishes the data connection, the execution script calls the monitoring script and the sending and receiving script to realize the sending and receiving of data.
[0102] In a possible implementation manner, the device further includes an execution module, and the execution module is used to execute the execution script, that is, to perform data statistics and format conversion on the first server according to the first parameter.
[0103] In a possible implementation, the first parameter includes at least one of the following: a statistical interval, a statistical number, a number of processes, a number of threads, or a number of acceleration channels.
[0104] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the electronic device 600 includes: a memory 610 and a processor 620 .
[0105] The memory 610 stores a computer program that can be executed by at least one processor 620. The computer program is executed by at least one processor 620 to enable the electronic device to implement the method provided in any of the above embodiments.
[0106] The memory 610 and the processor 620 may be connected via a bus 630 .
[0107] The relevant instructions can be understood by referring to the relevant descriptions and effects corresponding to the method embodiments, which will not be repeated here.
[0108] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the following Figures 2 to 4 The method of any corresponding embodiment.
[0109] Among them, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0110] An embodiment of the present application provides a computer program product, which includes computer-executable instructions, which are used to implement the following when the computer-executable instructions are executed by a processor: Figures 2 to 4 The method of any corresponding embodiment.
[0111] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0112] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the disclosure disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope of the present application is indicated by the claims.
[0113] It should be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims
1. A test method based on DPU network card user state data load balancing, It is characterized in that include: Determining at least two servers, wherein the at least two servers include a first server; Acquire a test environment, and configure IP addresses and test files for the at least two servers in the test environment; According to the IP address and the test file, at least one user-mode data channel load balancing of the network card running on the first server is tested.
2. The method according to claim 1, It is characterized in that The test file includes: at least one of a TCP process script, a UDP process script, or a thread sending and receiving script, and an execution script.
3. The method according to claim 2, It is characterized in that The at least two servers include a second server, and the TCP or UDP process script is used to send and receive at least one process data, including: Run a listening script on the first server and run a sending script of at least one TCP or UDP process on the second server; or, Run a listening script on the first server, and run a sending script of at least one thread on the second server; According to the monitoring script and the sending and receiving script, a data connection is established and data sending and receiving are realized.
4. The method according to claim 3, It is characterized in that The step of establishing a data connection and implementing data transmission and reception according to the monitoring script and the transmission and reception script includes: After the execution script establishes the data connection, the execution script calls the monitoring script and the sending and receiving script to realize the sending and receiving of data.
5. The method according to any one of claims 2 to 4, It is characterized in that The method further comprises: The execution script performs data statistics and format conversion on the first server according to the first parameter.
6. The method according to claim 5, It is characterized in that The first parameter includes at least one of the following: a statistical interval, a statistical number of times, a number of processes, a number of threads, or a number of acceleration channels.
7. A test device for user-mode data load balancing based on a DPU network card, It is characterized in that include: A determination module, configured to determine at least two servers, wherein the at least two servers include a first server; An acquisition module, used for acquiring a test environment, in which an IP address and a test file are configured for the at least two servers; The test module is used to test the load balancing of at least one user-mode data channel of the network card running on the first server according to the IP address and the test file.
8. An electronic device, It is characterized in that include: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the electronic device to perform the method as claimed in any one of claims 1 to 6.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.
10. A computer program product comprising computer executable instructions, It is characterized in that The computer-executable instructions are used to implement the method according to any one of claims 1 to 6 when executed by a processor.
