Performance measurement method, device, equipment and system of application program and storage medium

By obtaining the timestamp of TCP packets on the transmission path of the network protocol stack, the problem of inaccurate performance indicator measurement in the prior art is solved, and the precise measurement of the performance of the application at the TCP/IP layer is achieved.

CN119728492APending Publication Date: 2025-03-28HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311287548.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When measuring the performance indicators of an application, the performance indicators of the TCP/IP layer and above layer can only be measured, resulting in low measurement accuracy.

Method used

The performance indicators of the tested application are determined by obtaining at least two timestamps on the transmission path of the transmission control protocol TCP message on the network protocol stack, including the timestamp of the NIC layer receiving the TCP request message and the timestamp of the socket layer sending the first TCP response message.

Benefits of technology

The performance indicators of the application under test can be measured more accurately at the TCP/IP layer, improving the accuracy of performance measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728492A_ABST
    Figure CN119728492A_ABST
Patent Text Reader

Abstract

The invention discloses a performance measurement method, device, equipment and system of an application program and a storage medium, and belongs to the field of communication. In the application, a server obtains at least two timestamps of a TCP message on a transmission path of a network protocol stack, and the TCP message comprises at least one of a TCP request message sent by a client of a tested application program or a first TCP response message corresponding to the TCP request message; the at least two timestamps comprise a first timestamp when a socket layer in the network protocol stack sends a first TCP response message or a second timestamp when an NIC layer in the network protocol stack receives a TCP request message, and determining a performance index of the tested application program based on the at least two timestamps. The performance index of the tested application program in the layer below the TCP / IP layer can be measured, the first timestamp of the first TCP response message is utilized to calculate the performance index of the message in the sending direction, and the performance index of the tested application program is accurately measured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communications, and in particular, to a method, apparatus, device, system and storage medium for measuring the performance of an application. Background Art

[0002] In the field of information technology and system management, application performance management (APM) is the monitoring and management of application performance. It is dedicated to detecting and diagnosing application performance problems and continuously providing a series of application performance indicators.

[0003] In the related art, an extended Berkeley Packet Filter (eBPF) program is mounted in a function related to transmission control protocol (TCP) transmission and reception, which is a function of the TCP / internet protocol (IP) layer of the network protocol stack deployed in the server. When the TCP message sent by the client reaches the TCP / IP layer, the function related to TCP transmission and reception is called, thereby triggering the eBPF program to measure the performance of the application.

[0004] In the above-mentioned related technologies, since the eBPF program is mounted in the TCP / IP layer, the eBPF program can only measure the performance indicators of the application program in the TCP / IP layer and above in the network protocol stack, so the accuracy of the measured performance indicators is not high. Summary of the invention

[0005] The present application proposes a performance measurement method, device, equipment, system and storage medium for an application program, which are used to measure the performance of the application program below the TCP / IP layer and improve the accuracy of the performance measurement of the application program.

[0006] In a first aspect, the present application provides a performance measurement method for an application, which is applied to a server, and the method includes: obtaining at least two timestamps of a transmission control protocol TCP message on a transmission path of a network protocol stack, the TCP message including at least one of a TCP request message sent by a client of the application under test or a first TCP response message corresponding to the TCP request message, and the at least two timestamps including a first timestamp when a socket layer in the network protocol stack sends the first TCP response message or a second timestamp when a network interface card (NIC) layer in the network protocol stack receives the TCP request message; based on the at least two timestamps, determining the performance indicator of the application under test.

[0007] Compared with the method in which the eBPF program is mounted in the TCP / IP layer and in the TCP transceiver related functions, and the eBPF program is triggered to perform performance measurement when the TCP transceiver related functions are called, the server of the present application can obtain the second timestamp of the NIC layer in the network protocol stack receiving the TCP request message, or the first timestamp of the socket layer sending the first TCP response message, and the NIC layer is below the TCP / IP layer. Therefore, the performance indicators of the application under test in the layer below the TCP / IP layer can be measured, and the first timestamp of the first TCP response message can be used to calculate the delay of the message in the sending direction. In summary, the performance indicators of the application under test can be measured more accurately. Thus, the problem of inaccurate measurement of the performance indicators of the application is solved.

[0008] In one embodiment of the present application, when a TCP message includes a first TCP response message and at least two timestamps include a first timestamp, the TCP message also includes a TCP confirmation message corresponding to the TCP request message, and at least the two timestamps also include a third timestamp, which is the timestamp when the TCP / IP layer receives the TCP confirmation message; the performance indicator of the application under test includes a first segment delay of the application under test, and the first segment delay is the difference between the third timestamp and the first timestamp.

[0009] By subtracting the first timestamp of the first TCP response message sent by the socket layer from the third timestamp of the TCP confirmation message received by the TCP / IP layer in the network protocol stack, and taking the difference as the first segment delay, the delay between the transmission path from the socket layer sending the TCP response message, the client responding to the TCP response message and generating a TCP confirmation message, and the client returning the TCP confirmation message to the TCP / IP layer of the server can be accurately measured. That is, the first segment delay can reflect the delay of the TCP response message in the sending direction. Since the TCP response message needs to pass through the basic network when it is sent from the server to the client, and the TCP confirmation message also passes through the basic network when it is sent from the client to the server, the first segment delay can reflect the impact of the basic network delay on the round-trip delay of the application under test.

[0010] In one embodiment of the present application, when a TCP message includes a TCP request message and at least two timestamps include a second timestamp, the TCP message also includes a TCP confirmation message corresponding to the TCP request message, and at least two timestamps also include a third timestamp, which is the timestamp when the TCP / IP layer receives the TCP confirmation message; the performance indicator of the application under test includes the total delay of the application under test, and the total delay is the difference between the third timestamp and the second timestamp.

[0011] By subtracting the first timestamp when the NIC layer receives the TCP request message from the third timestamp when the TCP / IP layer in the network protocol stack receives the TCP acknowledgment message, and taking the difference as the total delay of the application under test, it is possible to accurately measure the total delay of the entire transmission path from the application under test receiving the TCP request message at the server end, the server end generating the first TCP response message according to the TCP request message, and sending the first TCP response message to the client end, the client end generating the TCP acknowledgment message after receiving the first TCP response message, and sending the TCP acknowledgment message to the server end, and the server end receiving the TCP acknowledgment message. Therefore, the delay of the entire transmission path from the user's actual request to the confirmation request response can be accurately measured at the server end.

[0012] In one embodiment of the present application, when the TCP message includes a TCP request message and at least two timestamps include a second timestamp, the at least two timestamps also include a fourth timestamp, and the fourth timestamp is the timestamp when the socket layer in the network protocol stack receives the TCP request message; the performance indicator of the application under test includes the second segment delay of the application under test, and the second segment delay of the application under test is the difference between the fourth timestamp and the second timestamp.

[0013] By subtracting the second timestamp of the TCP request message received by the NIC layer from the fourth timestamp of the TCP request message received by the socket layer in the network protocol stack, and using the difference as the second segment delay, the delay between the transmission path from the NIC layer receiving the TCP request message to the socket layer receiving the TCP request message can be accurately measured. During the transmission of the TCP request message from the NIC layer to the socket layer, the operating system on the server side calls the application program at the application layer. Therefore, the second segment delay can reflect the scheduling delay of the operating system scheduling the application program.

[0014] In one embodiment of the present application, when a TCP message includes a TCP request message and a first TCP response message, and at least two timestamps include a first timestamp, at least two timestamps also include a fourth timestamp, and the fourth timestamp is the timestamp when the socket layer in the network protocol stack receives the TCP request message; the performance indicator of the application under test includes the third segment delay of the application under test, and the third segment delay is the difference between the first timestamp and the fourth timestamp.

[0015] By subtracting the fourth timestamp of the TCP request message received by the socket layer from the first timestamp of the first TCP response message sent by the socket layer in the network protocol stack, and taking the difference as the third segment delay, the delay between the transmission path from the socket layer receiving the TCP request message to the application (APP) layer performing business processing on the TCP request message to obtain the first TCP response message, the APP layer sending the first TCP response message to the socket layer, and the socket layer sending the first TCP response message can be accurately measured. That is, the third segment delay can reflect the delay of the application in the application layer processing the TCP request message.

[0016] In one embodiment of the present application, when a TCP message includes a first TCP response message and at least two timestamps include a first timestamp, the TCP message also includes a second TCP response message, and at least two timestamps also include a fifth timestamp, the fifth timestamp is the timestamp when the socket layer in the network protocol stack sends the second TCP response message; the performance indicators of the application under test include transactions per second (TPS), TPS is the ratio of the sequence number difference to the time difference, wherein the sequence number difference is the difference between the second sequence number and the first sequence number, the time difference is the difference between the fifth timestamp and the first timestamp, the first sequence number is the sequence number corresponding to the first TCP response message, and the second sequence number is the sequence number corresponding to the second TCP response message.

[0017] Since the timestamp indicates the time of the TCP response message in the network protocol stack, the TPS of the application under test is determined based on the change of the sequence number of the TCP response message over a period of time. There is no need to calculate the TPS during the TCP connection handshake process. Therefore, the TPS indicator can be measured in both long connection scenarios and short connection scenarios, and there is no need to manually specify the service port, which can achieve fully automated measurement.

[0018] In a second aspect, an embodiment of the present application provides a performance measurement device for an application, which is configured on a server side, and includes: an acquisition module, used to acquire at least two timestamps of a transmission control protocol TCP message on a transmission path of a network protocol stack, the TCP message including at least one of a TCP request message sent by a client of the application under test or a first TCP response message corresponding to the TCP request message, the at least two timestamps including a first timestamp when a socket layer in the network protocol stack sends the first TCP response message or a second timestamp when a network interface card NIC layer in the network protocol stack receives the TCP request message; a determination module, used to determine the performance indicator of the application under test based on the at least two timestamps.

[0019] In one embodiment of the present application, when the TCP message includes the first TCP response message and the at least two timestamps include the first timestamp, the TCP message also includes a TCP confirmation message corresponding to the TCP request message, and the at least two timestamps also include a third timestamp, and the third timestamp is the timestamp when the TCP / Internet Protocol IP layer in the network protocol stack receives the TCP confirmation message; the performance indicator of the application under test includes the first segment delay of the application under test, and the first segment delay is the difference between the third timestamp and the first timestamp.

[0020] In one embodiment of the present application, when the TCP message includes the TCP request message and the at least two timestamps include the second timestamp, the TCP message also includes a TCP confirmation message corresponding to the TCP request message, and the at least two timestamps also include a third timestamp, which is the timestamp when the TCP / IP layer in the network protocol stack receives the TCP confirmation message; the performance indicator of the application under test includes the total delay of the application under test, and the total delay is the difference between the third timestamp and the second timestamp.

[0021] In one embodiment of the present application, when the TCP message includes the TCP request message and the at least two timestamps include the second timestamp, the at least two timestamps also include a fourth timestamp, and the fourth timestamp is the timestamp when the socket layer in the network protocol stack receives the TCP request message; the performance indicator of the application under test includes the second segment delay of the application under test, and the second segment delay of the application under test is the difference between the fourth timestamp and the second timestamp.

[0022] In one embodiment of the present application, when the TCP message includes the TCP request message and the first TCP response message, and the at least two timestamps include the first timestamp, the at least two timestamps also include a fourth timestamp, and the fourth timestamp is the timestamp when the socket layer in the network protocol stack receives the TCP request message; the performance indicator of the application under test includes the third segment delay of the application under test, and the third segment delay is the difference between the first timestamp and the fourth timestamp.

[0023] In one embodiment of the present application, when the TCP message includes the first TCP response message and the at least two timestamps include the first timestamp, the TCP message also includes a second TCP response message, and the at least two timestamps also include a fifth timestamp, and the fifth timestamp is the timestamp when the socket layer in the network protocol stack sends the second TCP response message; the performance indicator of the application under test includes a transaction processing volume per second TPS, and the TPS is a ratio of a sequence number difference to a time difference, wherein the sequence number difference is a difference between a second sequence number and a first sequence number, and the time difference is a difference between the fifth timestamp and the first timestamp, the first sequence number is a sequence number corresponding to the first TCP response message, the second sequence number is a sequence number corresponding to the second TCP response message, and the sixth timestamp is a timestamp corresponding to the second TCP response message.

[0024] In a third aspect, a network device is provided, comprising a processor, the processor being coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor, so that the network device implements the method for measuring the performance of any application in the first aspect.

[0025] In a fourth aspect, a computer-readable storage medium is provided, wherein the storage medium stores at least one program instruction or code, and when the program instruction or code is loaded and executed by a processor, the computer implements a method for measuring the performance of any application program in the first aspect.

[0026] In a fifth aspect, a system for measuring the performance of an application is provided, the system comprising a client and a server of the application under test, the client being used to send a TCP request message, and the server being used to execute the performance measurement method of any application in the first aspect.

[0027] In a sixth aspect, another communication device is provided, the device comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other through an internal connection path, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals, and when the processor executes the instructions stored in the memory, the processor executes the method in the first aspect or any possible implementation of the first aspect.

[0028] As an exemplary embodiment, there are one or more processors and one or more memories.

[0029] As an exemplary embodiment, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

[0030] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips respectively. The embodiments of the present application do not limit the type of memory and the setting method of the memory and the processor.

[0031] In a seventh aspect, a computer program (product) is provided, the computer program (product) comprising: a computer program code, when the computer program code is executed by a computer, the computer executes the methods in the above aspects.

[0032] In an eighth aspect, a chip is provided, comprising a processor for calling and executing instructions stored in a memory from the memory, so that a communication device equipped with the chip executes the methods in the above aspects.

[0033] In the ninth aspect, another chip is provided, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected through an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the methods in the above aspects.

[0034] The technical effects that can be achieved in any of the second to ninth aspects mentioned above can refer to the description of the beneficial effects in the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a system architecture diagram of a Kmon measurement tool provided by related technology;

[0036] Figure 2 It is a schematic diagram of a TCP message sequence sorted by timestamp in the related art;

[0037] Figure 3 This is a schematic diagram of the delay interval collected by the Kmon tool in a request in the related technology;

[0038] Figure 4 This is a schematic diagram of an application scenario of a performance measurement method for an application program provided in an embodiment of the present application;

[0039] Figure 5 is a flow chart of a performance measurement method for an application program provided in an embodiment of the present application;

[0040] Figure 6 It is a structure diagram of a delay measurement system of an application provided in an embodiment of the present application;

[0041] Figure 7 It is a flowchart of a delay measurement method of an application provided in an embodiment of the present application;

[0042] Figure 8 This is a flowchart of a timestamp corresponding to a TCP request message received by a NIC layer provided in an embodiment of the present application;

[0043] Fig. 9 This is a flowchart of a timestamp corresponding to a TCP request message received by a socket layer provided in an embodiment of the present application;

[0044] Fig.10 This is a flowchart of a timestamp when a socket layer sends a TCP response message provided by an embodiment of the present application;

[0045] Fig.11 This is a flowchart of a timestamp corresponding to when a TCP / IP layer receives a TCP confirmation message provided by an embodiment of the present application;

[0046] Fig.12 is a schematic diagram of measuring TPS provided in an embodiment of the present application;

[0047] Fig.13 is a flow chart of a method for measuring TPS provided in an embodiment of the present application;

[0048] Fig.14 is a schematic diagram of another scenario for measuring TPS provided in an embodiment of the present application;

[0049] Fig.15It is a structural schematic diagram of a performance measurement device for an application program provided in an embodiment of the present application;

[0050] Fig.16 It is a structural diagram of a network device provided in an embodiment of the present application;

[0051] Fig.17 It is a structural diagram of a network device provided in an embodiment of the present application;

[0052] Fig.18 It is a structural diagram of a network device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The terms used in the implementation section of the present application are only used to explain the embodiments of the present application and are not intended to limit the present application.

[0054] The following describes the application performance measurement method, apparatus, network device, system and storage medium provided in the embodiments of the present application in conjunction with the accompanying drawings.

[0055] At present, various applications are being used more and more widely, and can be used to solve practical problems in various industries. In actual use, some applications have higher requirements for performance. The performance of an application actually refers to the performance of the application when it is running on the server. In order to make the application have better performance, it is often necessary to test the performance of the application in combination with the network protocol stack in the server.

[0056] In the field of information technology and system management, APM monitors and manages the performance of applications. APM is dedicated to detecting and diagnosing application performance issues and continuously provides a series of application performance indicators. Among them, in application performance management, two groups of performance indicators are closely monitored. The first group of performance indicators defines the performance experienced by the end user of the application. The first group of performance indicators includes but is not limited to load and response time; load is the amount of transactions processed by the application, such as TPS, requests per second (RPS), queries per second (QPS). Response time is the time required for the application to respond to user operations under the aforementioned load. The second group of performance indicators measures the computing resources used by the application for the load, indicating whether there is enough capacity to support the load and the possible location of performance bottlenecks.

[0057] In the related technology, APM solutions are mainly divided into two categories: one is to obtain the performance indicators of the application through simulation detection, and the other is to detect the real operation data of the application through real user access, and then calculate the performance indicators of the application. Obtaining the performance indicators of the application through simulation detection means actively collecting and analyzing performance data by simulating users to initiate page access requests on the application client. This method will not affect the actual user experience, but because it is a simulated user access request on the page, not an access request of the real application, it cannot reflect the actual performance status of the application.

[0058] There are three main types of APM based on real user access:

[0059] The first method is to use the system basic indicator measurement tool to obtain the resource usage indicators of the device, which indirectly reflects the performance changes of the application. For example, the basic resource usage indicators at the operating system level are measured by the system basic indicator measurement tool to indirectly reflect the performance changes of the application. Among them, the resource usage indicators may include network performance indicators, disk usage, central processing unit (CPU) usage, etc. However, this method can only indirectly reflect the performance indicators of the application through the resource usage indicators of the device, and cannot obtain accurate performance indicators of the application.

[0060] The second category is to use the performance measurement tools of specific applications to measure the performance indicators of the specific application. The performance measurement tools of specific applications lack universality. Some performance measurement tools for specific applications need to limit the programming language. For example, the Java flight record (JFR) tool can collect data about the Java virtual machine (JVM) and the Java applications running on it; however, the performance indicators of applications built in other programming languages ​​will not be measured. Some performance measurement tools for specific applications require specific underlying architectures. For example, Istio is an open platform for service governance suitable for the service mesh form, but it is not applicable to other forms of servers. Some performance measurement tools for specific applications require application code adaptation. For example, the open telemetry framework (opentelemetry) is an open source observability framework consisting of a series of tools, application programming interfaces (APIs) and software development kits (SDKs). In summary, performance measurement tools for specific applications can only be used for specific applications and lack universality.

[0061] The third category is application performance measurement tools based on network protocol stacks, such as remote network monitoring tools (Kmon), system analysis kits (sysAK), etc., which can measure the performance indicators of applications and are versatile. Kmon is used as an example in the present application embodiment for illustration.

[0062] Kmon can monitor the message sending and receiving points on the TCP / IP layer of the network protocol stack. Figure 1 is a system architecture diagram of a Kmon measurement tool provided in an embodiment of the present application, such as Figure 1 As shown, the Kmon measurement tool mainly includes: data provider module (provider), data collection module (collector), eBPF program and output module (exporter). Among them, the provider directly collects upper-layer application information, for example: upper-layer application information includes microservice information (micorservice), system information (host), etc., and sends the collected upper-layer application information to the collector. The collector is responsible for interacting with the eBPF program. The collector loads the eBPF program into the kernel of the server. The collector controls the running status of the eBPF program. The collector converts and aggregates the data output by the eBPF program. The eBPF program is mounted in the function related to TCP transmission and reception. The function related to TCP transmission and reception is the function of the TCP / IP layer of the network protocol stack deployed in the server. When the TCP message sent by the client reaches the TCP / IP layer, the function related to TCP transmission and reception is called, thereby triggering the eBPF program to measure the performance of the application, obtain the performance indicators of the application and store them in the storage structure of eBPF, for example Figure 1 eBPF memory (instructions) in , also known as eBPF Maps (control). The exporter can export the performance metrics of the application from the eBPF storage structure and store the performance metrics of the application in the database. For example Figure 1 The eBPF memory (data) in is also called eBPF Map (data). The eBPF map is a general data structure used to store different types of data.

[0063] The eBPF program is a virtual machine running in the kernel. The eBPF program is mounted in the kernel of the operating system. The eBPF program can capture the messages in the kernel and filter the messages, for example, through Figure 1The conditional filter implementation in the eBPF program. The definition of registers and instruction sets is extended in the eBPF program, which improves the performance of the virtual machine and can handle more complex programs. In addition, the eBPF program also adds a storage structure stored in a key-value manner, which can save state information and pass it from one eBPF event processing function to another, or save some statistical information and pass it from the kernel to the user-mode program. Finally, eBPF can be registered on more kernel code hook functions and can handle more kernel events. In summary, the eBPF program provides a general ability to efficiently and safely execute specific code based on system or program events. Based on eBPF, various types of tools and platforms such as network analysis, performance analysis, system tracing, and network optimization can be developed.

[0064] Furthermore, the upper-layer application information that the provider needs to collect is shown in Table 1, mainly including: process identification (PID), which is mainly used to identify the receiving end of the TCP request message; service name (servicename), which is mainly used to convert PID into a service name with reading capability; Internet protocol (IP) listen list (listen list), which is used to identify the long connection server.

[0065] Table 1

[0066]

[0067] The application information that the eBPF program needs to collect is shown in Table 2, where the TCP send function (tcp_sendmsg) is a send function in the TCP protocol, and the TCP buffer cleanup function (tcp_cleanup_rbuf) is a function used to clear the buffer in the TCP protocol. If the copy field in the tcp_cleanup_rbuf function is greater than 0, it indicates that the client has read the TCP response message. By obtaining the information of the tcp_sendmsg function and the tcp_cleanup_rbuf function, the eBPF program can obtain the time when the TCP / IP layer receives the TCP request message and the time when the TCP response message is sent, and then calculate the delay of the TCP message based on the above time. The socket link establishment function (ssecurity_socket_accept) is a function used in the TCP protocol to characterize the establishment of a socket link. The TCP close function (tcp_close) is a function used in the TCP protocol to characterize the TCP close. By obtaining information from the tcp_sendmsg function and the tcp_cleanup_rbuf function, the eBPF program can obtain the time when the APP layer and the TCP / IP layer establish and disconnect the connection, and then identify the connected server.

[0068] Table 2

[0069]

[0070] In summary, the eBPF program is hooked onto functions related to TCP sending and receiving. When the TCP request message sent by the client reaches the TCP / IP layer of the server, the functions related to TCP sending and receiving in the server host operating system kernel are called, thereby triggering the eBPF program to measure the performance of the application, and then obtain the timestamp of each TCP request message and the timestamp of sending the TCP response message.

[0071] Furthermore, Figure 2 Schematic diagram of a TCP message sequence sorted by timestamp in an embodiment of the present application; Figure 2 As shown, the eBPF program calculates the delay of the TCP message by subtracting the timestamp T1 of the first TCP message received by the TCP / IP layer (tcp_sendmsg) from the timestamp T2 of the last TCP message sent by the TCP / IP layer (tcp_cleanup_rbuf), that is, the TCP message time is T2-T1. Among them, the timestamp of receiving the TCP message refers to the timestamp corresponding to when the TCP / IP layer receives the TCP request message forwarded by the traffic shaping layer, and the timestamp of sending the TCP message refers to the timestamp corresponding to when the TCP / IP layer sends the TCP response message corresponding to the TCP request message to the flow shaping layer.

[0072] In summary, the Kmon tool can effectively obtain the delay of the TCP request message from the TCP / IP layer to the APP layer. The APP layer processes the TCP request message and generates a TCP response message corresponding to the TCP request message, and returns the TCP response message to the TCP / IP layer. However, this method cannot fully and accurately reflect the user's actual request delay. Figure 3 This is a schematic diagram of the delay interval collected by the Kmon tool in a TCP request in an embodiment of the present application. As shown in 3, in a TCP request, the TCP request message (request) sent by the client passes through the basic network, NIC layer, TCP / IP layer, socket layer and APP layer in sequence. The APP layer processes the TCP request message and obtains a TCP response message (response) corresponding to the TCP request message. Then, the TCP response message passes through the socket layer, TCP / IP layer, NIC layer and basic network in sequence and returns to the client. After receiving the TCP response message, the client processes the TCP response message and generates a TCP confirmation (TCP acknowledge, TCP ACK) message corresponding to the TCP response message. Finally, the client sends the TCP confirmation message through the basic network and NIC layer to the TCP / IP layer of the server in sequence. Further, combined with Figure 3 As shown in the figure, the delay interval collected by the kmon tool only covers the part above the TCP / IP layer ( Figure 3 The bold part in the figure), such as TCP / IP layer, socket layer, APP layer, etc.; it does not cover the layer below TCP / IP ( Figure 3 The dashed part in the middle), such as the traffic control (TC) layer, the NIC layer, the basic network, etc. Therefore, this method is not accurate enough in measuring the performance of the application and cannot obtain accurate performance indicators of the application.

[0073] Furthermore, the performance indicators of the application also include TPS. In the relevant technology, the method of calculating the TPS indicator of the service based on TCP connection data is mainly: the server runs on a computer operating system (Unix or Linux platform), and calculates the TPS indicator of the target service through a scheduled task. Since various services correspond to their own ports, the port configuration is specified through the firewall (iptables), and the number of TCP close messages sent and received by the server per second in the TCP four waves is counted, and the number of TCP close messages in the TCP four waves per second is obtained. The minimum value obtained is the TPS of the application. Among them, iptables is an IP packet filtering system integrated with the Linux kernel. The system is conducive to better control of IP packet filtering and firewall configuration on the Linux system.

[0074] However, in the above TPS measurement method, the number of TCP close messages counted can only be detected and counted during the TCP disconnection process, which is not suitable for long connection services. In addition, the above method requires manual specification of the service port before use and cannot be fully automated.

[0075] In one embodiment of the present application, the application scenario of the embodiment of the present application, that is, the architecture of the network protocol stack is described. Figure 4 This is a schematic diagram of an application scenario of a performance measurement method for an application provided in an embodiment of the present application. The present application mainly implements the measurement of performance indicators of an application based on a network protocol stack. Figure 4 The complete process of a TCP request is shown in Figure 1, including: the client of the application sends a TCP request message to the server. After the NIC layer of the server receives the TCP request message, it forwards the TCP request message to the TCP / IP layer through the TC layer. Then the TCP / IP layer sends the TCP request message to the APP layer through the socket layer. After the APP layer receives the TCP request message, it processes the TCP request message to obtain a TCP response message corresponding to the TCP request message. Then, the TCP response message is sent to the client of the application through the socket layer, TCP / IP layer, TC layer, and NIC layer in sequence. After the client of the application receives the TCP response message, it processes the TCP response message to obtain a TCP confirmation message corresponding to the TCP message, and sends a TCP confirmation message to the TCP / IP layer of the server. The TCP confirmation message is used to inform the server that the client of the application has received the TCP response message.

[0076] The socket layer is an intermediate software abstraction layer between the APP layer and the TCP / IP layer in the network protocol stack. In the TCP protocol, the two processes that establish a connection each have a socket to identify them, and the socket pair composed of these two sockets uniquely identifies a connection.

[0077] The present application embodiment provides a method for measuring the performance of an application program. Figure 5 This is a flowchart of a performance measurement method for an application provided in an embodiment of the present application. The performance measurement method for this application is mainly used in a server that interacts with a client based on a network protocol stack. The server may be a server, such as a central server, an edge server, or a local server in a local data center. The server may be a physical server or a cloud server that provides cloud computing services. The client may be a terminal, such as a desktop computer, a laptop computer, or a smart phone. The client may also be a server or other device that can run an application. Figure 5 As shown, the performance measurement method of an application provided in an embodiment of the present application mainly includes steps S101-S102.

[0078] S101. Obtain at least two timestamps of a TCP message on a transmission path of a network protocol stack, where the TCP message includes at least one of a TCP request message sent by a client of a tested application or a first TCP response message corresponding to the TCP request message, and the at least two timestamps include a first timestamp when a socket layer in the network protocol stack sends the first TCP response message or a second timestamp when a NIC layer in the network protocol stack receives the TCP request message.

[0079] In an embodiment of the present application, if the NIC layer of the server receives a TCP request message sent by the client of the application under test for the first time, a TCP connection object is created. Among them, creating a TCP connection object refers to establishing a TCP connection between the client and the server of the application under test. Once the TCP connection object is established, it is a two-way session, that is, the client can send information to the server, and the server can also send information to the client. Furthermore, the creation of the TCP connection object can be initiated by either party of the TCP communication. In other words, the client can initiate a request to create a TCP connection object to the server, and the server can also initiate a request to create a TCP connection object to the client.

[0080] In an embodiment of the present application, the complete processing flow of a TCP request message is as follows: the client sends a TCP request message, and after the TCP request message passes through the basic network, NIC layer, TC layer, TCP / IP layer, socket layer and APP layer in sequence, the APP layer processes the TCP request message and obtains the first TCP response message corresponding to the TCP request message, and then the first TCP response message passes through the socket layer, TCP / IP layer, TC layer, NIC layer and basic network in sequence, and then returns to the client. After the client receives the first TCP response message, it processes the first TCP response message and generates a TCP confirmation message corresponding to the first TCP response message. Finally, the client sends the TCP confirmation message to the TCP / IP layer through the basic network, NIC layer, and TC layer in sequence, wherein the network protocol stack deployed in the server includes the NIC layer, TC layer, TCP / IP layer, socket layer and APP layer. Furthermore, the above-mentioned TCP request message, the first TCP response message and the TCP confirmation message are in a one-to-one correspondence.

[0081] Among them, the timestamp of the TCP message in the transmission path can be understood as the timestamp corresponding to when the TCP message reaches or leaves the layer in the network protocol stack. In one embodiment of the present application, the at least two timestamps include: a first timestamp when the socket layer in the network protocol stack sends the first TCP response message, a second timestamp when the NIC layer in the network protocol stack receives the TCP request message, a third timestamp when the TCP / IP layer in the network protocol stack receives the TCP confirmation message, and a fourth timestamp when the socket layer in the network protocol stack receives the TCP request message.

[0082] In one embodiment of the present application, there is a kernel structure (sock) in the network protocol stack, and sock and socket are in a one-to-one correspondence. Sock runs through each layer in the network protocol stack and can be used to receive, store and send relevant information of TCP messages in each layer in the network protocol stack. Among them, the above-mentioned relevant information includes the timestamp corresponding to the TCP message in each layer. Among them, the relevant information corresponding to all TCP connection objects can be stored in the sock kernel structure. Based on the TCP connection object between the client and the server of the application under test, the timestamp of the TCP message corresponding to the TCP connection object is screened out from the relevant information stored in the sock structure.

[0083] For example, if the performance index of the application under test 1 needs to be measured, the corresponding TCP connection object 1 is queried in the relevant information stored in sock using connection object 1 as a keyword for the timestamps of the TCP packets corresponding to connection object 1 in each layer. If the performance index of the application under test N needs to be measured, the corresponding TCP connection object N is queried in the relevant information stored in sock using connection object N as a keyword for the timestamps of the TCP packets corresponding to connection object N in each layer.

[0084] It should be noted that in the embodiment of the present application, the timestamp corresponding to the TCP message in each layer can be obtained from the sock, and the timestamp corresponding to the TCP message in each layer of the network protocol stack can be recorded by mounting other programs or codes in the network protocol stack. In the embodiment of the present application, the method for obtaining the timestamp corresponding to the TCP message in each layer is not limited.

[0085] In one embodiment of the application, a connection table corresponding to multiple TCP connection objects can be obtained from the sock, as shown in Table 3. The connection table includes multiple connection objects, and the connection objects are arranged in sequence numbers, for example: connection object 1, ..., connection object N. Each TCP connection object corresponds to round-trip time (RTT) sampling information and TPS sampling information. For example: the RTT sampling information of TCP connection object 1 is RTT data 1, the TPS sampling information of TCP connection object 1 includes TPS data 1, the RTT sampling information of TCP connection object N is RTT data N, and the TPS sampling information of TCP connection object N includes TPS data N. As shown in Table 4, each RTT sampling information mainly includes the current request status, timestamp and message sequence number. As shown in Table 5, each TPS sampling information mainly includes two parts of information, a timestamp and a sequence number. The timestamp TT2 corresponds to the currently sent sequence number TN2, and the timestamp TT1 corresponds to the last sent sequence number TN1.

[0086] Table 3

[0087]

[0088] Table 4

[0089] RTT sampling information Current request status Timestamp Serial Number

[0090] Table 5

[0091]

[0092] S102: Determine a performance indicator of the application program under test based on at least two timestamps.

[0093] In an embodiment of the present application, after the server receives the TCP request message sent by the client of the application under test, at least two timestamps formed by the TCP message in the transmission path are obtained, and then two timestamps can be arbitrarily selected from the at least two timestamps to determine the performance indicators of the application under test.

[0094] Since any two timestamps in the transmission path can be obtained, the performance index in any section of the transmission path can be determined, rather than just measuring the performance index between specific transmission intervals, so that the performance index of the application under test can be determined more accurately. Thus, the problem of inaccurate performance index detection of the application is solved.

[0095] In one embodiment of the present application, the performance indicator of the application under test includes at least one of the network delay of the application under test or the TPS of the application under test, wherein the network delay of the application under test includes at least one of the total delay of the application under test or the segmented delay of the application under test. In an embodiment of the present application, at least two timestamps can be used to measure the delay of the application under test, which solves the problem of inaccurate application delay measurement. In addition, at least two timestamps can be used to measure the TPS of the application under test, which can be applicable to measuring the TPS indicator of the application under test in a long link scenario.

[0096] The total delay refers to the delay for a TCP message to complete the entire transmission path in the network protocol stack. Exemplarily, the total delay is the delay between the NIC layer receiving the TCP request message and the TCP / IP layer receiving the TCP confirmation message corresponding to the TCP request message. The segment delay refers to the delay between any one or more layers in the network protocol stack, and the segment delay is part of the total delay.

[0097] By determining the latency of the application under test based on at least two timestamps, the network latency of the application under test can be measured more accurately, solving the problem of inaccurate application latency measurement. Alternatively, determining the TPS of the application under test based on at least two timestamps can be applicable to measuring the TPS indicator of the application under test in a long link scenario. It should be noted that the method for determining the network latency of the application under test and the method for determining the TPS of the application under test can be arbitrarily selected for execution, or both methods can be executed simultaneously.

[0098] Based on the above embodiments, a method for measuring the delay of an application is provided in an embodiment of the present application. Figure 6 is a structure diagram of a delay measurement system for an application provided in an embodiment of the present application, Figure 7 This is a flowchart of a method for measuring the delay of an application program provided in an embodiment of the present application. Figure 6 and Figure 7 The delay measurement method of the application provided in the embodiment of the present application is introduced by way of example. Figure 7 As shown, the delay measurement method of the application provided in the embodiment of the present application mainly includes the steps of:

[0099] S201. Create a TCP connection object.

[0100] In the disclosed embodiment, when the NIC layer receives a TCP request message, the server determines whether it is the first time to receive the TCP request message sent by the client of the application under test. If the NIC layer of the server receives the TCP request message sent by the client of the application under test for the first time, a TCP connection object is created.

[0101] S202. Obtain a timestamp corresponding to when the NIC layer receives the TCP request message, and record it as a second timestamp TS2.

[0102] In the disclosed embodiment, when the NIC layer in the server receives the TCP request message sent by the client, the timestamp corresponding to the TCP request message received by the NIC layer is recorded as the second timestamp TS2, and the connection state of the TCP connection object is recorded as starting sampling.

[0103] In one possible implementation, Figure 6 As shown, it can be Figure 6 The network card interrupt processing module shown in is used to perform step S202, wherein the network card interrupt processing module can be deployed at the NIC layer. The connection state of the TCP connection object is to start sampling, which means that the sampling of this TCP message starts from the current timestamp.

[0104] S203. Obtain the timestamp corresponding to when the socket layer receives the TCP request message, and record it as the fourth timestamp TS4.

[0105] In the disclosed embodiment, the TCP request message enters the TCP protocol stack queue. After the application is scheduled by the system, the socket layer starts to read the TCP request message. At this time, the connection state of the TCP connection object is modified to the request received, and the fourth timestamp TS4 corresponding to the reception of the TCP request message by the socket layer is recorded.

[0106] In one possible implementation, Figure 6 As shown, it can be Figure 6 The application request processing module shown in is used to perform step S203, wherein the application request processing module can be deployed at the socket layer. The connection state of the TCP connection object is a received request, which means that the TCP message of this transmission has been received by the socket layer.

[0107] S204. Obtain the timestamp of the TCP response message sent by the socket layer, and record it as the first timestamp TS1.

[0108] In the embodiment of the present application, after the APP layer completes the service processing, it generates a TCP response message corresponding to the TCP request message, and the APP layer sends the TCP response message to the socket layer, and the socket layer sends the TCP response message to the client through the TCP / IP layer, the NIC layer, and the basic network layer. The timestamp of the socket layer sending the TCP response message to the TCP / IP layer is recorded as the first timestamp TS1, and the connection state of the TCP connection object is recorded as the response has been sent.

[0109] In one possible implementation, Figure 6 As shown, it can be Figure 6 The application request processing module shown in is used to perform step S204. The application request processing module can be deployed at the socket layer. The connection state of the TCP connection object is that the response has been sent, which means that the TCP response message of this transmission has been sent by the socket layer.

[0110] S205 . Obtain the timestamp corresponding to when the TCP / IP layer receives the TCP confirmation message, and record it as the third timestamp TS3 .

[0111] In the embodiment of the present application, according to the TCP protocol, after the client receives the TCP response message sent by the server, it will generate a corresponding TCP confirmation message. The TCP confirmation message will carry the sequence number of the received TCP response message, record the third timestamp TS3 corresponding to the TCP confirmation received by the TCP / IP layer, and record the connection state of the TCP connection object as request response completed. In a possible implementation, such as Figure 6 As shown, it can be Figure 6 The response matching module shown in is used to perform step S205. The response matching module can be deployed in the TCP / IP layer. The connection status is request response completed, which means that the transmission process of this TCP message has ended.

[0112] In one embodiment of the present application, in the process of sending a TCP response message at the socket layer, the sequence number of the TCP response message is recorded. After the TCP response message reaches the client, the client processes the TCP response message, obtains a TCP confirmation message corresponding to the TCP response message, and adds the sequence number of the TCP response message to the TCP confirmation message. Then, the client sends the TCP confirmation message to the TCP / IP layer of the server. After the TCP / IP layer receives the TCP confirmation message, it parses the TCP confirmation message to obtain the message sequence number it carries. The sequence number carried in the TCP confirmation message is compared with the sequence number of the recorded TCP response message. If the sequence number carried in the TCP confirmation message is consistent with the sequence number of the recorded TCP response message, it indicates that the TCP confirmation message is a confirmation message for the TCP response message, and then the timestamp of the TCP / IP layer receiving the TCP confirmation message is used as the third timestamp TS3.

[0113] In the disclosed embodiment, after receiving the TCP confirmation message sent by the client, the TCP / IP layer first performs a sequence number match, and after the match is successful, records the timestamp. In this way, it can be ensured that the recorded timestamp is for the same TCP message, thereby ensuring the accuracy of the delay. In the embodiment of the present application, after steps S202-S205, the RTT sampling information obtained is shown in Table 6.

[0114] Table 6

[0115]

[0116] S206: Calculate the network delay of the application under test based on the difference between the two timestamps.

[0117] In the embodiment of the present disclosure, the delay of the application under test can be obtained by taking the difference between any two timestamps obtained in the above steps.

[0118] In one embodiment of the present application, a TCP message includes a first TCP response message corresponding to a TCP request message and a TCP acknowledgment message corresponding to the TCP request message; at least two timestamps include a first timestamp and a third timestamp, the third timestamp is the timestamp when the TCP / Internet Protocol IP layer in the network protocol stack receives the TCP acknowledgment message; the performance indicator of the application under test includes a first segment delay of the application under test, and the first segment delay is the difference between the third timestamp and the first timestamp.

[0119] In the embodiment of the present application, the timestamp of the TCP confirmation message received by the TCP / IP layer in the network protocol stack is subtracted from the timestamp of the TCP response message sent by the socket layer, and the difference is used as the first segment delay, so that the delay between the transmission path from the socket layer sending the first TCP response message, the client responding to the first TCP response message and generating a TCP confirmation message, and the client returning the TCP confirmation message to the TCP / IP layer of the server can be accurately measured. In other words, the first segment delay can reflect the delay of the first TCP response message in the sending direction. Since the first TCP response message needs to pass through the basic network during the process of being sent from the server to the client, and the TCP confirmation message also passes through the basic network during the process of being sent from the client to the server, the first segment delay can reflect the impact of the basic network delay on the round-trip delay of the application under test.

[0120] In one embodiment of the present application, a TCP message includes a TCP request message and a TCP confirmation message corresponding to the TCP request message; at least two timestamps include a second timestamp and a third timestamp, and the third timestamp is the timestamp when the TCP / IP layer in the network protocol stack receives the TCP confirmation message; the performance indicator of the application under test includes the total delay of the application under test, and the total delay is the difference between the third timestamp and the second timestamp.

[0121] In an embodiment of the present application, the timestamp when the TCP / IP layer in the network protocol stack receives the TCP acknowledgment message is subtracted from the timestamp when the NIC layer receives the TCP request message as the total delay of the application under test. The total delay of the application under test in the entire transmission path can be accurately measured when the TCP request message is received at the server, the server generates a first TCP response message based on the TCP request message, and sends the first TCP response message to the client, and after the client receives the first TCP response message, it generates a TCP acknowledgment message and sends a TCP acknowledgment message to the server. The server receives the TCP acknowledgment message. In other words, the delay of the entire transmission path from the user's actual request to the completion of the confirmation request response can be accurately measured at the server.

[0122] In one embodiment of the present application, a TCP message includes a TCP request message; at least two timestamps include a second timestamp and a fourth timestamp, wherein the fourth timestamp is the timestamp when the socket layer in the network protocol stack receives the TCP request message; the performance indicator of the application under test includes the second segment delay of the application under test, and the second segment delay of the application under test is the difference between the fourth timestamp and the second timestamp.

[0123] In an embodiment of the present application, the timestamp of the TCP request message received by the socket layer in the network protocol stack is subtracted from the timestamp of the TCP request message received by the NIC layer, and the difference is used as the second segment delay, so that the delay between the transmission path from the NIC layer receiving the TCP request message to the socket layer receiving the TCP request message can be accurately measured. During the transmission of the TCP request message from the NIC layer to the socket layer, the operating system of the server calls the application program of the application layer. Therefore, the second segment delay can reflect the scheduling delay of the operating system scheduling the application program.

[0124] In one embodiment of the present application, a TCP message includes a TCP request message and a first TCP response message corresponding to the TCP request message; at least two timestamps include a first timestamp and a fourth timestamp, and the fourth timestamp is the timestamp when the socket layer in the network protocol stack receives the TCP request message; the performance indicator of the application under test includes a third segment delay of the application under test, and the third segment delay is the difference between the first timestamp and the fourth timestamp.

[0125] In the embodiment of the present application, the first timestamp of the first TCP response message sent by the socket layer in the network protocol stack is subtracted from the fourth timestamp of the TCP request message received by the socket layer as the third segment delay, which can accurately measure the delay between the transmission path from the socket layer receiving the TCP request message to the APP layer performing business processing on the TCP request message to obtain the first TCP response message, the APP layer sending the first TCP response message to the socket layer, and the socket layer sending the first TCP response message. In other words, the third segment delay can reflect the delay of the application in the APP layer processing the TCP request message.

[0126] In an embodiment of the present application, a method for a network card interrupt module to collect RTT sampling information is provided. Figure 8 is a flowchart of a method for recording a second timestamp corresponding to a TCP request message received by a NIC layer provided by an embodiment of the present disclosure; Figure 8As shown, after the client sends a TCP request message, the TCP request message enters the NIC layer of the network protocol stack from the basic network. The NIC layer copies the TCP request message to the kernel memory of the server. At this time, the NIC layer generates an interrupt signal, which is used to inform the kernel that a TCP request message has been received. When processing the interrupt signal, the network card interrupt processing module determines whether the server has received the TCP request message of the current TCP connection object for the first time. If the server has received the TCP request message of the current TCP connection object for the first time, a TCP connection object is created and the information of the TCP connection object is recorded in the connection table. As shown in Table 7, in the connection table, the current TCP connection object is recorded as connection object N, and the second timestamp TS2 corresponding to the TCP request message received by the NIC layer is recorded. At the same time, the connection state of connection object N is recorded as starting sampling.

[0127] Table 7

[0128]

[0129] In an embodiment of the present application, a method for an application request processing module to collect RTT sampling information is provided. Fig. 9 is a flowchart of a fourth timestamp corresponding to a TCP request message received by a socket layer according to an embodiment of the present disclosure; Fig. 9 As shown, the TCP request message is processed by the TCP / IP core protocol stack and finally enters the TCP protocol stack receiving queue. At this time, after the application is scheduled by the system, the socket layer starts to read the TCP request message from the TCP protocol stack, and the application request processing module records the relevant information of the connection object N. As shown in Table 8, under the connection object N in the connection table, the fourth timestamp TS4 corresponding to the TCP request message received by the socket layer is recorded, and the connection state of the connection object N is recorded as the received request.

[0130] Table 8

[0131]

[0132] In an embodiment of the present application, a method for an application response processing module to collect RTT sampling information is provided. Fig.10 : is a flowchart of a first timestamp of a first TCP response message sent by a socket layer according to an embodiment of the present disclosure; Fig.10 As shown, after the APP layer completes the service processing, when sending the first response TCP message, the application response processing module records the relevant information of the connection object N. As shown in Table 9, under the connection object N in the connection table, the first timestamp TS1 of the first TCP response message sent by the socket layer is recorded, and the TCP connection state is recorded as the response has been sent. Furthermore, the sequence number of the first TCP response message sent by the socket layer is recorded.

[0133] Table 9

[0134]

[0135] In one embodiment of the present application, a method for a response matching module to collect RTT sampling information is provided. Fig.11 is a flowchart of the third timestamp of the TCP / IP layer receiving the TCP confirmation message provided by the embodiment of the present disclosure; Fig.11 As shown, the first TCP response message is processed by the TCP / IP kernel protocol stack, sent to the basic network through the NIC layer, and finally received by the client. According to the TCP protocol, after the client receives the first TCP response message from the server, it will generate a TCP confirmation message corresponding to the first TCP response message. When the server receives the TCP confirmation message, the response matching module will carry the sequence number of the first TCP response message corresponding to it in the TCP confirmation message according to the TCP protocol. The response matching module queries the connection table for the sequence number of the first TCP response message sent by the connection object N. If the sequence number carried by the TCP confirmation message is consistent with the sequence number of the first TCP response message sent, then as shown in Table 10, under the connection object N in the connection table, the third timestamp TS3 corresponding to the TCP confirmation message received by the TCP / IP layer is recorded, and the connection state of the connection object N is recorded as the request response completed.

[0136] Table 10

[0137]

[0138] In one embodiment of the present application, a method is provided for a statistical reporting module to calculate the latency of a tested application. After a TCP request is fully sampled, the statistical reporting module calculates and reports the RTT sampling information of the connection object N to obtain the latency of the application corresponding to the connection object N. The specific calculation method can refer to the description in the above embodiment.

[0139] On the basis of the above embodiment, the performance index of the tested application includes the TPS of the tested application, and a method for measuring the TPS of the application is provided in the embodiment of the present application. In the embodiment of the present application, the measurement principle of TPS is: by collecting the sequence numbers of TCP messages sent by a TCP connection object at different times, the slope of the change of the sent sequence number over time is obtained, thereby obtaining the TPS of the application.

[0140] In one embodiment of the present application, a method for measuring TPS of an application is provided. Fig.12 is a schematic diagram of measuring TPS provided by an embodiment of the present disclosure, Fig.13is a flow chart of a method for measuring the TPS of an application provided in an embodiment of the present application, such as Fig.13 As shown, the steps for measuring the TPS of the application under test include:

[0141] S301. Obtain a first sequence number corresponding to a first TCP response message and a second sequence number corresponding to a second TCP response message.

[0142] In the embodiments of the present disclosure, Fig.12 As shown, the sequence number corresponding to the first TCP response message sent by the socket layer is obtained as the first sequence number TN1, and the sequence number corresponding to the second TCP response message sent by the socket layer is obtained as the second sequence number TN2. The first TCP response message and the second TCP response message are TCP messages sent by the socket layer at different time points in the same TCP connection object. Exemplarily, the second TCP response message is the TCP response message sent by the socket layer at the current time point, and the first TCP response message is the previous TCP response message sent by the socket layer.

[0143] S302: Obtain a first timestamp corresponding to the first TCP response message and a fifth timestamp corresponding to the second TCP response message.

[0144] In the disclosed embodiment, the first timestamp corresponding to the first TCP response message refers to the timestamp TT1 corresponding to the first TCP message sent by the socket layer in the network protocol stack, and the fifth timestamp corresponding to the second TCP response message refers to the timestamp TT2 corresponding to the second TCP response message sent by the socket layer. Exemplarily, the first sequence number may be the sequence number corresponding to the first TCP response message, and the corresponding first timestamp is also the timestamp corresponding to the first TCP response message sent by the socket layer. The second sequence number may be the sequence number corresponding to the second TCP response message sent by the socket layer, and the corresponding fifth timestamp is also the timestamp corresponding to the second TCP response message sent by the socket layer.

[0145] S303: Calculate the TPS of the application under test based on the first timestamp, the fifth timestamp, the first sequence number, and the second sequence number.

[0146] In one embodiment of the present application, TPS is the ratio of the sequence number difference to the time difference, wherein the sequence number difference is the difference between the second sequence number TN2 and the first sequence number TN1, and the time difference is the difference between the fifth timestamp TT2 and the first timestamp TT1.

[0147] The TPS of the application under test is determined by the TCP messages sent by the same TCP connection object in different time periods and the timestamps corresponding to each TCP message.

[0148] In one embodiment of the present application, Fig.14 As shown, the server receives TCP request message 1 for the first time, and after the APP layer completes the service processing, it generates the first TCP response message 1 corresponding to the TCP request message 1 and sends it to the socket layer. When the socket layer sends the first TCP response message 1, the application response processing module records the first timestamp TT1 corresponding to the first TCP response message sent by the socket layer and the first sequence number TN1 of the first TCP response message under the TCP connection object N in the connection table. The server receives TCP request message 2 for the second time, and after the APP layer completes the service processing, it generates the second TCP response message 2 corresponding to the TCP request message 2 and sends it to the socket layer. When the socket layer sends the second TCP response message 2, the application response processing module records the fifth timestamp TT2 corresponding to the second TCP response message sent by the socket layer and the second sequence number TN2 of the second TCP response message under the TCP connection object N in the connection table.

[0149] After the above two samplings, the statistical reporting module performs statistical calculations on the TPS sampling information of the connection object N, and calculates the application degree TPS = (TN2-TN1) / (TT2-TT1).

[0150] In the embodiment of the present application, since the timestamp represents the time node of the TCP response message in the network protocol stack, the TPS of the application under test is determined according to the change of the sequence number of the TCP response message within a period of time, and there is no need to calculate the TPS when the TCP connection is waved. Therefore, the TPS index can be measured in both long connection scenarios and short connection scenarios, and there is no need to manually specify the service port, and fully automated measurement can be achieved. The TPS of the application under test is obtained by following the change of the TCP message over time, and automated calculation can be achieved.

[0151] The above describes the method for measuring the performance of an application provided by an embodiment of the present application. Corresponding to the above method, an embodiment of the present application also provides a device for measuring the performance of an application. Fig.15 is a schematic diagram of a performance measurement device for an application provided in an embodiment of the present application, the device is applied to a server, and the server is the above-mentioned Figures 4 to 14 The server shown in any of the attached figures. Fig.15 As shown in the following multiple modules, the Fig.15 The application performance measurement device shown can perform all or part of the operations performed by the server. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown, and the present application embodiment does not limit this. Fig.15As shown, the device includes: an acquisition module 151, which is used to obtain at least two timestamps of a transmission control protocol TCP message on a transmission path of a network protocol stack, the TCP message includes at least one of a TCP request message sent by a client of a tested application or a first TCP response message corresponding to the TCP request message, and the at least two timestamps include a first timestamp when a socket layer in the network protocol stack sends the first TCP response message or a second timestamp when a network interface card NIC layer in the network protocol stack receives the TCP request message; a determination module 152, which is used to determine the performance indicator of the tested application based on the at least two timestamps.

[0152] Compared with the method in the related art, in which the eBPF program is mounted in the TCP / IP layer and in the TCP transceiver related functions, and when the TCP transceiver related functions are called, the eBPF program is triggered to perform performance measurement. In the embodiment of the present application, since the second timestamp of the NIC layer in the network protocol stack receiving the TCP message, or the first timestamp of the socket layer sending the first TCP response message can be obtained, and the NIC layer is below the TCP / IP layer, the performance indicators of the application under test at the layer below the TCP / IP layer can be measured, so that the performance indicators of the application under test can be measured more accurately. Thus, the problem of inaccurate measurement of the performance indicators of the application is solved.

[0153] In one embodiment of the present application, when a TCP message includes a first TCP response message and at least two timestamps include a first timestamp, the TCP message also includes a TCP confirmation message corresponding to the TCP request message, and at least the two timestamps also include a third timestamp, which is the timestamp when the TCP / Internet Protocol IP layer in the network protocol stack receives the TCP confirmation message; the performance indicator of the application under test includes a first segment delay of the application under test, and the first segment delay is the difference between the third timestamp and the first timestamp.

[0154] In an embodiment of the present application, the timestamp of the TCP confirmation message received by the TCP / IP layer in the network protocol stack is subtracted from the timestamp of the first TCP response message sent by the socket layer, and the difference is used as the first segment delay, so that the delay between the transmission path from the socket layer sending the first TCP response message, the client responding to the first TCP response message and generating a TCP confirmation message, and the client returning the TCP confirmation message to the TCP / IP layer of the server can be accurately measured. In other words, the first segment delay can reflect the delay of the first TCP response message in the sending direction. Since the first TCP response message needs to pass through the basic network during the process of being sent from the server to the client, and the TCP confirmation message also passes through the basic network during the process of being sent from the client to the server, the first segment delay can reflect the impact of the basic network delay on the round-trip delay of the application under test.

[0155] In one embodiment of the present application, when a TCP message includes a TCP request message and at least two timestamps include a second timestamp, the TCP message also includes a TCP confirmation message corresponding to the TCP request message, and at least two timestamps also include a third timestamp, which is the timestamp when the TCP / IP layer in the network protocol stack receives the TCP confirmation message; the performance indicator of the application under test includes the total delay of the application under test, and the total delay is the difference between the third timestamp and the second timestamp.

[0156] In an embodiment of the present application, the timestamp when the TCP / IP layer in the network protocol stack receives the TCP acknowledgment message is subtracted from the timestamp when the NIC layer receives the TCP request message, and the difference is used as the total delay of the application under test. The total delay of the application under test in the entire transmission path can be accurately measured, from the time when the server receives the TCP request message, the server generates a first TCP response message based on the TCP request message, and sends the first TCP response message to the client, and after the client receives the first TCP response message, it generates a TCP acknowledgment message and sends a TCP acknowledgment message to the server, and the server receives the TCP acknowledgment message. In other words, the delay of the entire transmission path from the user's actual request to the completion of the confirmation request response can be accurately measured on the server.

[0157] In one embodiment of the present application, when a TCP message includes a TCP request message and at least two timestamps include a second timestamp, at least two timestamps also include a fourth timestamp, and the fourth timestamp is the timestamp when the socket layer in the network protocol stack receives the TCP request message; the performance indicator of the application under test includes the second segment delay of the application under test, and the second segment delay of the application under test is the difference between the fourth timestamp and the second timestamp.

[0158] In an embodiment of the present application, the timestamp of the TCP request message received by the socket layer in the network protocol stack is subtracted from the timestamp of the TCP request message received by the NIC layer to obtain the second segment delay, which can accurately measure the delay between the transmission path from the NIC layer receiving the TCP request message to the socket layer receiving the TCP request message. During the transmission of the TCP request message from the NIC layer to the socket layer, the operating system of the server calls the application of the application layer. Therefore, the second segment delay can reflect the scheduling delay of the operating system scheduling the application.

[0159] In one embodiment of the present application, when a TCP message includes a TCP request message and a first TCP response message, and at least two timestamps include a first timestamp, at least two timestamps also include a fourth timestamp, and the fourth timestamp is the timestamp when the socket layer in the network protocol stack receives the TCP request message; the performance indicator of the application under test includes the third segment delay of the application under test, and the third segment delay is the difference between the first timestamp and the fourth timestamp.

[0160] In the embodiment of the present application, the timestamp of the first TCP response message sent by the socket layer in the network protocol stack is subtracted from the timestamp of the TCP request message received by the socket layer, and the difference is used as the third segment delay, which can accurately measure the delay between the transmission path from the socket layer receiving the TCP request message, to the APP layer performing business processing on the TCP request message to obtain the first TCP response message, the APP layer sending the first TCP response message to the socket layer, and the socket layer receiving the first TCP response message. In other words, the third segment delay can reflect the delay of the application in the APP layer processing the TCP request message.

[0161] In one embodiment of the present application, when a TCP message includes a first TCP response message and at least two timestamps include a first timestamp, the TCP message also includes a second TCP response message, and at least the two timestamps also include a fifth timestamp, which is the timestamp when the socket layer in the network protocol stack sends the second TCP response message; the performance indicators of the application under test include transactions per second TPS, which is the ratio of the sequence number difference to the time difference, wherein the sequence number difference is the difference between the second sequence number and the first sequence number, the time difference is the difference between the fifth timestamp and the first timestamp, the first sequence number is the sequence number corresponding to the first TCP response message, the second sequence number is the sequence number corresponding to the second TCP response message, and the sixth timestamp is the timestamp corresponding to the second TCP response message.

[0162] In the embodiment of the present application, since the timestamp represents the time node of the TCP response message in the network protocol stack, the TPS of the application under test is determined according to the change of the sequence number of the TCP response message over a period of time. It is not necessary to calculate the TPS during the TCP connection handshake process. Therefore, the TPS index can be measured in both long connection scenarios and short connection scenarios, and there is no need to manually specify the service port, and fully automated measurement can be achieved.

[0163] It should be understood that the above Fig.15 When the device provided realizes its functions, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0164] The specific hardware structure of the server in the above embodiment is as follows Fig.16 The network device 1600 shown includes a transceiver 1601, a processor 1602 and a memory 1603. The transceiver 1601, the processor 1602 and the memory 1603 are connected via a bus 1604. The transceiver 1601 is used to receive messages, the memory 1603 is used to store instructions or program codes, and the processor 1602 is used to call the instructions or program codes in the memory 1603 so that the server performs the relevant processing steps of the application performance measurement in the above method embodiment. In a specific embodiment, the network device 1600 of the embodiment of the present application may correspond to the server in each of the above method embodiments. The processor 1602 in the network device 1600 reads the instructions or program codes in the memory 1603 so that Fig.16 The network device 1600 shown is capable of performing all or part of the operations performed by the server.

[0165] The network device 1600 may also correspond to the above Fig.15 The device shown, for example, Fig.15 The acquisition module 151 and the determination module 152 are equivalent to the processor 1602.

[0166] See also Fig.17 , Fig.17 A schematic diagram of the structure of a network device 1700 provided by an exemplary embodiment of the present application is shown. Fig.17 The network device 1700 shown is used to perform the operations involved in the performance measurement method of the application program in the above method embodiment. Fig.17 As shown, the network device 1700 includes at least one processor 1701 , a memory 1703 , and at least one communication interface 1704 .

[0167] Processor 1701 is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing units (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solution of the present application. For example, processor 1701 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute various logic blocks, modules, and circuits described in conjunction with the disclosure of the embodiments of the present application. The processor can also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0168] Optionally, the network device 1700 further includes a bus. The bus is used to transmit information between the components of the network device 1700. The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.17 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus. Fig.17 In addition to being connected by a bus, the components of the network device 1700 may also be connected by other means, and the embodiment of the present application does not limit the connection method of the components.

[0169] The memory 1703 is, for example, a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, or a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1703 is, for example, independent and connected to the processor 1701 through a bus. The memory 1703 can also be integrated with the processor 1701.

[0170] The communication interface 1704 uses any transceiver-like device for communicating with other devices or communication networks, and the communication network can be Ethernet, a radio access network (RAN) or a wireless local area network (WLAN), etc. The communication interface 1704 may include a wired communication interface and may also include a wireless communication interface. Exemplarily, the communication interface 1704 may be an Ethernet interface, a fast Ethernet (FE) interface, a gigabit Ethernet (GE) interface, an asynchronous transfer mode (ATM) interface, a wireless local area network (WLAN) interface, a cellular network communication interface or a combination thereof. The Ethernet interface may be an optical interface, an electrical interface or a combination thereof. In an embodiment of the present application, the communication interface 1704 may be used for the network device 1700 to communicate with other devices.

[0171] In a specific implementation, as an embodiment, the processor 1701 may include one or more CPUs, such as Fig.17 0 and CPU1 shown in FIG. Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0172] In a specific implementation, as an embodiment, the network device 1700 may include multiple processors, such as Fig.17 1701 and 1705 are shown in FIG. Each of these processors may be a single-CPU or a multi-CPU. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0173] In a specific implementation, as an embodiment, the network device 1700 may also include an output device and an input device. The output device communicates with the processor 1701 and can display information in a variety of ways. For example, the output device may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device communicates with the processor 1701 and can receive user input in a variety of ways. For example, the input device may be a mouse, a keyboard, a touch screen device, or a sensor device.

[0174] In some embodiments, the memory 1703 is used to store the program code 1702 for executing the solution of the present application, and the processor 1701 can execute the program code 1702 stored in the memory 1703. That is, the network device 1700 can implement the performance measurement method of the application provided by the method embodiment through the processor 1701 and the program code 1702 in the memory 1703. The program code 1702 may include one or more software modules. Optionally, the processor 1701 itself can also store the program code or instruction for executing the solution of the present application.

[0175] In a specific embodiment, the network device 1700 of the embodiment of the present application may correspond to the first edge network device in each of the above-mentioned method embodiments, and the processor 1701 in the network device 1700 reads the program code 1702 in the memory 1703 or the program code or instruction stored in the processor 1701 itself, so that Fig.17 The network device 1700 shown is capable of performing all or part of the operations performed by the server.

[0176] The network device 1700 may also correspond to the above Fig.15 The device shown, Fig.15 Each functional module in the apparatus shown is implemented using software of the network device 1700. In other words, Fig.15The determination module included in the apparatus shown is generated after the processor 1701 of the network device 1700 reads the program code 1702 stored in the memory 1703. For example, Fig.15 The acquisition module 151 and the determination module 152 involved are equivalent to the processor 1701 and / or the processor 1705.

[0177] Among them, each step of the performance measurement method of the above-mentioned application is completed by the hardware integrated logic circuit or software instructions in the processor of the network device 1700. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above-mentioned method in conjunction with its hardware. To avoid repetition, it is not described in detail here.

[0178] See also Fig.18 , Fig.18 A schematic diagram showing the structure of a network device 1800 provided by another exemplary embodiment of the present application is shown. Fig.18 The network device 1800 shown is used to execute all or part of the operations involved in the performance measurement method of the application program in the above method embodiment. The network device 1800 is, for example, a switch, a router, etc. The network device 1800 can be implemented by a general bus architecture.

[0179] like Fig.18 As shown, the network device 1800 includes: a main control board 1810 and an interface board 1830 .

[0180] The main control board is also called a main processing unit (MPU) or a route processor card. The main control board 1810 is used to control and manage various components in the network device 1800, including routing calculation, device management, device maintenance, and protocol processing functions. The main control board 1810 includes: a central processing unit 1811 and a memory 1812.

[0181] The interface board 1830 is also called a line processing unit (LPU), a line card or a service board. The interface board 1830 is used to provide various service interfaces and realize the forwarding of data packets. The service interface includes but is not limited to an Ethernet interface, a POS (Packet over SONET / SDH) interface, etc., and the Ethernet interface is, for example, a Flexible Ethernet Clients (FlexE Clients) service interface. The interface board 1830 includes: a central processor 1831, a network processor 1832, a forwarding table entry memory 1834 and a physical interface card (PIC) 1833.

[0182] The central processing unit 1831 on the interface board 1830 is used to control and manage the interface board 1830 and communicate with the central processing unit 1811 on the main control board 1810 .

[0183] The network processor 1832 is used to implement the message sending process. The network processor 1832 can be in the form of a forwarding chip. The forwarding chip can be a network processor (NP). In some embodiments, the forwarding chip can be implemented by an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA). Specifically, the network processor 1832 is used to forward the received message based on the forwarding table stored in the forwarding table entry memory 1834. If the destination address of the message is the address of the network device 1800, the message is sent to the CPU (such as the central processor 1831) for processing; if the destination address of the message is not the address of the network device 1800, the next hop and the output interface corresponding to the destination address are found from the forwarding table according to the destination address, and the message is forwarded to the output interface corresponding to the destination address. Among them, the processing of the uplink message may include: processing of the message input interface, forwarding table search; the processing of the downlink message may include: forwarding table search, etc. In some embodiments, the central processor can also perform the function of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, so that the forwarding chip is not required in the interface board.

[0184] The physical interface card 1833 is used to implement the docking function of the NIC layer, and the original traffic enters the interface board 1830 from it, and the processed message is sent from the physical interface card 1833. The physical interface card 1833 is also called a daughter card, which can be installed on the interface board 1830 and is responsible for converting the optical signal into a message and forwarding the message to the network processor 1832 for processing after checking the legitimacy of the message. In some embodiments, the central processor 1831 can also perform the functions of the network processor 1832, such as implementing software forwarding based on a general-purpose CPU, so that the network processor 1832 is not required in the physical interface card 1833.

[0185] Optionally, the network device 1800 includes multiple interface boards, for example, the network device 1800 further includes an interface board 1840, and the interface board 1840 includes a central processor 1841, a network processor 1842, a forwarding table entry memory 1844, and a physical interface card 1843. The functions and implementation methods of the components in the interface board 1840 are the same or similar to those of the interface board 1830, and are not described in detail here.

[0186] Optionally, the network device 1800 further includes a switching fabric board 1820. The switching fabric board 1820 may also be referred to as a switch fabric unit (SFU). When the network device has multiple interface boards, the switching fabric board 1820 is used to complete data exchange between the interface boards. For example, the interface board 1830 and the interface board 1840 may communicate via the switching fabric board 1820.

[0187] The main control board 1810 is coupled to the interface board. For example, the main control board 1810, the interface board 1830, the interface board 1840, and the switching network board 1820 are connected to the system backplane through the system bus to achieve intercommunication. In a possible implementation, an inter-process communication (IPC) channel is established between the main control board 1810 and the interface board 1830 and the interface board 1840, and the main control board 1810 and the interface board 1830 and the interface board 1840 communicate through the IPC channel.

[0188] Logically, the network device 1800 includes a control plane and a forwarding plane. The control plane includes a main control board 1810 and a central processing unit 1811. The forwarding plane includes various components for performing forwarding, such as a forwarding table entry memory 1834, a physical interface card 1833, and a network processor 1832. The control plane performs functions such as a router, generating a forwarding table, processing signaling and protocol messages, and configuring and maintaining the status of the network device. The control plane sends the generated forwarding table to the forwarding plane. On the forwarding plane, the network processor 1832 forwards the message received by the physical interface card 1833 based on the forwarding table sent by the control plane. The forwarding table sent by the control plane can be stored in the forwarding table entry memory 1834. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same network device.

[0189] It is worth noting that there may be one or more main control boards, and when there are multiple boards, they may include a primary main control board and a backup main control board. There may be one or more interface boards. The stronger the data processing capability of the network device, the more interface boards are provided. There may also be one or more physical interface cards on the interface board. There may be no switching network board, or there may be one or more switching network boards. When there are multiple switching network boards, they can jointly realize load sharing and redundant backup. In a centralized forwarding architecture, network devices may not need switching network boards, and the interface board is responsible for processing the service data of the entire system. In a distributed forwarding architecture, network devices may have at least one switching network board, and data exchange between multiple interface boards is realized through the switching network board, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of network devices with distributed architectures are greater than those of network devices with centralized architectures. Optionally, the network device may have only one board, that is, no switching board, and the functions of the interface board and the main control board are integrated on the board. In this case, the central processor on the interface board and the central processor on the main control board can be combined into one central processor on the board to perform the functions of the two superimposed. This type of network device has low data exchange and processing capabilities (for example, low-end switches or routers and other network devices). The specific architecture to be adopted depends on the exemplary networking deployment scenario, and no limitation is made here.

[0190] In a specific embodiment, the network device 1800 corresponds to the above Fig.15 The performance measurement device of the application program configured on the server side is shown. In some embodiments, Fig.15 The acquisition module 151 and the determination module 152 in the application performance measurement device shown are equivalent to at least one of the central processor 1811 , the network processor 1832 and the network processor 1842 in the network device 1800 .

[0191] Based on the above Fig.16 , Fig.17 and Fig.18The network device shown in the embodiment of the present application also provides a performance measurement system for an application program, the system comprising: a client and a server. Optionally, the server is Fig.16 The network device 1600 or Fig.17 The network device 1700 or Fig.18 Network device 1800 is shown.

[0192] The method executed by the server can refer to the relevant description in the above method embodiment, which will not be repeated here.

[0193] It should be understood that the above processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the advanced RISC machines (ARM) architecture.

[0194] Further, in an optional embodiment, the memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0195] The memory may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM) and direct memory bus random access memory (DR RAM).

[0196] A computer-readable storage medium is also provided, in which at least one program instruction or code is stored. When the program instruction or code is loaded and executed by a processor, the computer implements a performance measurement method for an application program as in any of the above method embodiments.

[0197] The present application provides a computer program. When the computer program is executed by a computer, a processor or a computer can be enabled to execute the corresponding steps and / or processes in the above method embodiments.

[0198] A chip is provided, comprising a processor, for calling and executing instructions stored in a memory from the memory, so that a communication device equipped with the chip executes the methods in the above aspects.

[0199] Another chip is provided, comprising: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, the processor is used to execute the code in the memory, and when the code is executed, the processor is used to execute the methods in the above aspects.

[0200] 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 the computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can 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 can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integration. The available medium can 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 hard disk Solid State Disk), etc.

[0201] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above are only specific implementation methods of the present application and are not used to limit the protection scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the protection scope of the present application.

[0202] Those of ordinary skill in the art will appreciate that, in conjunction with the various method steps and modules described in the embodiments disclosed herein, they can be implemented in software, hardware, firmware, or any combination thereof. In order to clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0203] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0204] When software is used for implementation, 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 program instructions. As an example, the method of the embodiment of the present application can be described in the context of a machine executable instruction, and the machine executable instruction is such as included in the program module executed in the device on the real or virtual processor of the target. Generally speaking, a program module includes a routine, a program, a library, an object, a class, a component, a data structure, etc., which performs a specific task or realizes a specific abstract data structure. In various embodiments, the function of the program module can be merged or divided between the described program modules. The machine executable instruction for the program module can be executed in a local or distributed device. In a distributed device, the program module can be located in both a local and a remote storage medium.

[0205] The computer program code for realizing the method for the embodiment of the present application can be written in one or more programming languages. These computer program codes can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by a computer or other programmable data processing device, causes the function / operation specified in the flow chart and / or block diagram to be implemented. The program code can be executed completely on a computer, partially on a computer, as an independent software package, partially on a computer and partially on a remote computer or completely on a remote computer or server.

[0206] In the context of the embodiments of the present application, computer program codes or related data may be carried by any appropriate carrier to enable a device, apparatus or processor to perform the various processes and operations described above. Examples of carriers include signals, computer readable media, and the like.

[0207] Examples of signals may include electrical, optical, radio, acoustic or other forms of propagated signals, such as carrier waves, infrared signals, etc.

[0208] A machine-readable medium may be any tangible medium that contains or stores a program for or related to an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. More detailed examples of machine-readable storage media include 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 storage device, a magnetic storage device, or any suitable combination thereof.

[0209] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0210] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module 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. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, or it can be an electrical, mechanical or other form of connection.

[0211] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0212] In addition, each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0213] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0214] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limitation on quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the various examples, a first edge network device may be referred to as a second edge network device, and similarly, a second edge network device may be referred to as a first edge network device. Both the first edge network and device and the second edge network device may be edge network devices, and in some cases, may be separate and different edge network devices.

[0215] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0216] The term "at least one" in this application means one or more, and the term "multiple" in this application means two or more, for example, multiple second messages means two or more second messages. The terms "system" and "network" are often used interchangeably herein.

[0217] It should be understood that the terms used in the description of various examples herein are only for describing specific examples and are not intended to be limiting. As used in the description of various examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0218] It should also be understood that the term “comprise” (also known as “includes,” “including,” “comprises” and / or “comprising”) when used in this specification specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0219] It should also be understood that the terms "if" and "if" may be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, the phrases "if it is determined that ..." or "if [a stated condition or event] is detected" may be interpreted to mean "upon determining that ..." or "in response to determining that ..." or "upon detecting [a stated condition or event]" or "in response to detecting [a stated condition or event]," depending on the context.

[0220] It should be understood that determining B based on A does not mean determining B only based on A. B can also be determined based on A and / or other information.

[0221] It should also be understood that the references to "one embodiment", "an embodiment", or "a possible implementation" throughout the specification mean that specific features, structures, or characteristics related to the embodiment or implementation are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment", or "a possible implementation" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

Claims

1. A method for measuring the performance of an application, characterized in that: The method is applied to the server, and the method includes: Obtain at least two timestamps of a transmission control protocol TCP message on a transmission path of a network protocol stack, wherein the TCP message includes at least one of a TCP request message sent by a client of a tested application or a first TCP response message corresponding to the TCP request message, and the at least two timestamps include a first timestamp when a socket layer in the network protocol stack sends the first TCP response message or a second timestamp when a network interface card NIC layer in the network protocol stack receives the TCP request message; Based on the at least two timestamps, a performance indicator of the application under test is determined.

2. The method according to claim 1, characterized in that In a case where the TCP message includes the first TCP response message and the at least two timestamps include the first timestamp, the TCP message also includes a TCP confirmation message corresponding to the TCP request message, and the at least two timestamps also include a third timestamp, and the third timestamp is a timestamp when the TCP / Internet Protocol IP layer in the network protocol stack receives the TCP confirmation message; The performance indicator of the application under test includes a first segment delay of the application under test, where the first segment delay is a difference between the third timestamp and the first timestamp.

3. The method according to claim 1, characterized in that In the case where the TCP message includes the TCP request message and the at least two timestamps include the second timestamp, the TCP message also includes a TCP confirmation message corresponding to the TCP request message, and the at least two timestamps also include a third timestamp, and the third timestamp is a timestamp when the TCP / IP layer in the network protocol stack receives the TCP confirmation message; The performance indicator of the application under test includes a total delay of the application under test, and the total delay is a difference between the third timestamp and the second timestamp.

4. The method according to claim 1, characterized in that: In the case where the TCP message includes the TCP request message and the at least two timestamps include the second timestamp, the at least two timestamps also include a fourth timestamp, and the fourth timestamp is a timestamp when the socket layer in the network protocol stack receives the TCP request message; The performance indicator of the application under test includes a second segment delay of the application under test, and the second segment delay of the application under test is a difference between the fourth timestamp and the second timestamp.

5. The method according to claim 1, characterized in that In a case where the TCP message includes the TCP request message and the first TCP response message, and the at least two timestamps include the first timestamp, the at least two timestamps also include a fourth timestamp, and the fourth timestamp is a timestamp when the socket layer in the network protocol stack receives the TCP request message; The performance indicator of the application under test includes a third segment delay of the application under test, and the third segment delay is a difference between the first timestamp and the fourth timestamp.

6. The method according to claim 1, characterized in that In a case where the TCP message includes the first TCP response message and the at least two timestamps include the first timestamp, the TCP message also includes a second TCP response message, and the at least two timestamps also include a fifth timestamp, where the fifth timestamp is a timestamp at which the socket layer in the network protocol stack sends the second TCP response message; The performance indicators of the application under test include transactions per second TPS, where the TPS is a ratio of a sequence number difference to a time difference, wherein the sequence number difference is a difference between a second sequence number and a first sequence number, the time difference is a difference between a fifth timestamp and the first timestamp, the first sequence number is a sequence number corresponding to the first TCP response message, and the second sequence number is a sequence number corresponding to the second TCP response message.

7. A performance measurement device for an application, characterized in that: The device is configured at the server end, and the device includes: An acquisition module is used to acquire at least two timestamps of a transmission control protocol TCP message on a transmission path of a network protocol stack, wherein the TCP message includes at least one of a TCP request message sent by a client of a tested application or a first TCP response message corresponding to the TCP request message, and the at least two timestamps include a first timestamp when a socket layer in the network protocol stack sends the first TCP response message or a second timestamp when a network interface card NIC layer in the network protocol stack receives the TCP request message; A determination module is used to determine the performance indicator of the application under test based on the at least two timestamps.

8. The device according to claim 7, characterized in that In a case where the TCP message includes the first TCP response message and the at least two timestamps include the first timestamp, the TCP message also includes a TCP confirmation message corresponding to the TCP request message, and the at least two timestamps also include a third timestamp, and the third timestamp is a timestamp when the TCP / Internet Protocol IP layer in the network protocol stack receives the TCP confirmation message; The performance indicator of the application under test includes a first segment delay of the application under test, where the first segment delay is a difference between the third timestamp and the first timestamp.

9. The device according to claim 7, characterized in that In the case where the TCP message includes the TCP request message and the at least two timestamps include the second timestamp, the TCP message also includes a TCP confirmation message corresponding to the TCP request message, and the at least two timestamps also include a third timestamp, and the third timestamp is a timestamp when the TCP / IP layer in the network protocol stack receives the TCP confirmation message; The performance indicator of the application under test includes a total delay of the application under test, and the total delay is a difference between the third timestamp and the second timestamp.

10. The device according to claim 7, characterized in that In the case where the TCP message includes the TCP request message and the at least two timestamps include the second timestamp, the at least two timestamps also include a fourth timestamp, and the fourth timestamp is a timestamp when the socket layer in the network protocol stack receives the TCP request message; The performance indicator of the application under test includes a second segment delay of the application under test, and the second segment delay of the application under test is a difference between the fourth timestamp and the second timestamp.

11. The device according to claim 7, characterized in that In a case where the TCP message includes the TCP request message and the first TCP response message, and the at least two timestamps include the first timestamp, the at least two timestamps also include a fourth timestamp, and the fourth timestamp is a timestamp when the socket layer in the network protocol stack receives the TCP request message; The performance indicator of the application under test includes a third segment delay of the application under test, and the third segment delay is a difference between the first timestamp and the fourth timestamp.

12. The device according to claim 7, characterized in that In a case where the TCP message includes the first TCP response message and the at least two timestamps include the first timestamp, the TCP message also includes a second TCP response message, and the at least two timestamps also include a fifth timestamp, where the fifth timestamp is a timestamp at which the socket layer in the network protocol stack sends the second TCP response message; The performance indicators of the application under test include transactions per second TPS, where the TPS is a ratio of a sequence number difference to a time difference, wherein the sequence number difference is a difference between a second sequence number and a first sequence number, the time difference is a difference between a fifth timestamp and the first timestamp, the first sequence number is a sequence number corresponding to the first TCP response message, the second sequence number is a sequence number corresponding to the second TCP response message, and the sixth timestamp is a timestamp corresponding to the second TCP response message.

13. A network device, characterized in that: The network device includes: a processor, the processor is coupled to a memory, the memory stores at least one program instruction or code, and the at least one program instruction or code is loaded and executed by the processor to enable the network device to implement the method for measuring the performance of an application program described in any one of claims 1-6.

14. A system for measuring the performance of a response program, characterized in that: The system comprises a client and a server of the application under test, wherein the client is used to send a TCP request message, and the server is used to execute the performance measurement method of the application program described in any one of claims 1-6.

15. A computer-readable storage medium, characterized in that: The storage medium stores at least one program instruction or code, and when the program instruction or code is loaded and executed by the processor, the computer implements the performance measurement method of the application program according to any one of claims 1 to 6.

Citation Information

Cited By

  • Method and system for calculating multi-layer response time of network application

    CN120434156A

  • A TCP short connection management method, device and medium

    CN122718346A