An information processing method, device and storage medium
By instrumenting server processes for monitoring, the problem of existing tools being unable to comprehensively test game server stress is solved. Comprehensive monitoring of the central processing unit and memory is achieved, improving the accuracy and optimization efficiency of stress testing and reducing server load.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECH SHANGHAI
- Filing Date
- 2020-06-05
- Publication Date
- 2026-06-26
Smart Images

Figure CN113760518B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to an information processing method, apparatus and storage medium. Background Technology
[0002] In recent years, with the continuous expansion of the game industry, the computational complexity and network load of game servers have gradually increased. There is a need to implement automated tools to assess the upper limit of a game server's capabilities, explore resource usage hotspots, and thus optimize game server performance, improve its carrying capacity, and reduce the probability of game server failure under high load conditions.
[0003] Currently, there are various stress testing tools used in the industry. Most of them are concurrent robot packet sending tools written in system programming languages such as C++ or scripting languages such as Python, mainly used to test network I / O capacity. These concurrent robot tools mainly monitor the load on devices by simulating robot packet sending in parallel.
[0004] There are also stress testing tools, mainly used for servers of specific application types or specific production test environments. These environments differ somewhat from the production environment of game servers. For example, streaming media servers are primarily I / O intensive, while game server production environments combine UI-intensive and CPU-intensive stress models.
[0005] Therefore, it is necessary to provide a universal method for comprehensive stress testing of servers, and to quickly identify the function call paths that consume the most CPU or memory, so as to optimize the corresponding functions and reduce the server load. Summary of the Invention
[0006] This application provides an information processing method, apparatus, and storage medium that can perform comprehensive stress tests on servers and quickly identify the function call paths that consume the most CPU or memory, facilitating the optimization of the corresponding functions and thus reducing the server load.
[0007] On the one hand, this application provides an information processing method, the method comprising:
[0008] Obtain the source code of the process;
[0009] The CPU instrumentation, memory instrumentation, and session count instrumentation per unit time are performed in the source code of the process to obtain the instrumented process.
[0010] Receive the application data packet sent by the stress testing robot in response to the stress test request;
[0011] After instrumentation, the process executes function calls to process the application data packets, thereby obtaining the monitoring results of CPU overall utilization, memory overall utilization, and the overall number of sessions per unit time.
[0012] Based on the monitoring results of the overall CPU utilization, the overall memory utilization, and the overall number of sessions per unit time, the stress test results of the local server are determined.
[0013] When the local server is under overload, the target call path is determined based on the function call relationship in the process after instrumentation.
[0014] On the other hand, an information processing apparatus is provided, the apparatus comprising:
[0015] The source code acquisition module is used to obtain the source code of the process;
[0016] The instrumentation module is used to perform CPU instrumentation, memory instrumentation, and instrumentation of the number of sessions per unit time in the source code of the process to obtain the instrumented process.
[0017] The application data packet receiving module is used to receive application data packets sent by the stress testing robot in response to the stress test request;
[0018] The monitoring result determination module is used to process the application data packet by executing function calls after instrumentation, and obtain the monitoring results of the overall CPU utilization, the overall memory utilization, and the overall number of sessions per unit time.
[0019] The stress test result determination module is used to determine the stress test result of the local server based on the monitoring results of the overall CPU utilization, the overall memory utilization, and the overall session count per unit time.
[0020] The target call path determination module is used to determine the target call path based on the function call relationship in the instrumented process when the local server is under overload.
[0021] On the other hand, a computer storage medium is provided, which stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the information processing method described above.
[0022] The information processing method, apparatus, and storage medium provided in this application have the following technical advantages:
[0023] This application obtains a post-instrumented process by instrumenting the CPU, memory, and number of sessions per unit time within the server process. This post-instrumented process then processes the application data packets sent by the stress testing robot to obtain monitoring results for CPU utilization, memory utilization, and the number of sessions per unit time. This allows for the generation of comprehensive stress test results for the server based on multiple monitoring results, improving the accuracy of the stress test. When the server is under overload, the target call path can be determined based on the function call relationships within the post-instrumented process, facilitating optimization of functions within that path and thus reducing server load. Attached Figure Description
[0024] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram of an information processing system provided in an embodiment of this application;
[0026] Figure 2 This is a flowchart illustrating an information processing method provided in an embodiment of this application;
[0027] Figure 3 This is a flowchart illustrating a method provided in this application embodiment for processing application data packets by executing function calls after instrumentation, thereby obtaining monitoring results of CPU overall utilization, memory overall utilization, and the number of sessions per unit time.
[0028] Figure 4 This is a schematic diagram of the structure of a blockchain system provided in an embodiment of this application;
[0029] Figure 5 This is a schematic diagram of the block structure provided in the embodiments of this application;
[0030] Figure 6 This is a schematic diagram of the smoke test process provided in the embodiments of this application;
[0031] Figure 7 This is a schematic diagram of the structure of the information processing system provided in the embodiments of this application;
[0032] Figure 8 This is a flowchart of a collaborative testing process using multiple stress testing robots provided in an embodiment of this application;
[0033] Figure 9 This is a heat map of stress test performance provided in an embodiment of this application;
[0034] Figure 10 This is a schematic diagram of the target call path provided in the embodiments of this application;
[0035] Figure 11 This is a schematic diagram of the structure of an information processing device provided in an embodiment of this application;
[0036] Figure 12 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0037] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0038] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0039] Please see Figure 1 , Figure 1 This is a schematic diagram of an information processing system provided in an embodiment of this application, such as... Figure 1 As shown, the information processing system may include at least a server 01 and a stress testing robot 02.
[0040] Specifically, in the embodiments of this specification, server 01 may include a standalone server, a distributed server, or a server cluster composed of multiple servers. Server 01 may include a network communication unit, a processor, and memory, etc. Specifically, server 01 can be used to perform stress testing.
[0041] Specifically, in the embodiments of this specification, the load testing robot 02 can be controlled by code logic such as load testing scripts, enabling it to log in to a remote application server and simulate user behavior. For example, for game server stress testing, the load testing robot is a robot that logs in and simulates the behavior of game players to provide "stress" to the game server. Compared to stress testing with real players, a large number of load testing robots can be implemented on the same load testing device. Therefore, using load testing robots for stress testing can significantly shorten the cycle and cost of server stress testing. Generally, to simplify stress testing scenarios, load testing robots typically adopt a packet sender mode, that is, the load testing robot sends a large number of data packets to the server in the same time period without performing complex processing on the response data packets returned by the server, thereby saving testing time and costs.
[0042] The following describes one information processing method of this application. Figure 2 This is a flowchart illustrating an information processing method provided in an embodiment of this application. This specification provides the operational steps of the method described in the embodiments or flowcharts, but based on conventional or non-inventive methods, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or server product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown in the attached drawings... Figure 2 As shown, the method can be applied to a server, and the method may include:
[0043] S201: Obtain the source code of the process.
[0044] In the embodiments described in this specification, the process can be a process in a server.
[0045] In some embodiments, when the server is a game server, the process may include: (1) connd: an independent server process for establishing and maintaining the connection between the game client and the game service process, responsible for establishing and managing the client connection; (2) roomsvr: carrying the main game business logic, roomsvr communicates with the client through connd; (3) other non-client direct connection service processes: mainly responsible for communicating with third-party platforms, as well as data storage and other functions.
[0046] S203: Perform CPU instrumentation, memory instrumentation, and session number instrumentation per unit time in the source code of the process to obtain the instrumented process.
[0047] In the embodiments of this specification, CPU instrumentation, MEM instrumentation, and sessions per second (TPS) instrumentation can be performed by encapsulating the corresponding code into instrumentation modules. Instrumentation can be done in an intrusive manner, injecting modular instrumentation functionality into the process's source code. Specifically, CPU instrumentation monitors the process's CPU usage; MEM instrumentation monitors the process's memory usage; and TPS instrumentation monitors the number of sessions processed per second. Instrumentation modules can be encapsulated through code editing and can also be controlled by parameters. For example, instrumentation can be performed by setting parameters, and after a configured time period, the instrumentation monitoring results can be output.
[0048] S205: Receive the application data packet sent by the stress testing robot in response to the stress test request.
[0049] In the embodiments described in this specification, the tester can issue a stress test request command to the stress testing robot, and the stress testing robot responds to the stress test request by sending an application data packet to the server.
[0050] In the embodiments described in this specification, the pressure testing robot may be one or more, and the method further includes:
[0051] The system receives error reports sent by the load testing robot when it generates target results during operation; the load testing robot performs network communication and transaction verification during operation.
[0052] In the embodiments described in this specification, when the stress testing robot generates the target result during operation, it sends an error report to the server and stops running.
[0053] In the embodiments of this specification, the target result is an unexpected result, which may include, but is not limited to, logical errors, verification failures, communication volume, and memory usage reaching a preset threshold.
[0054] In the embodiments described in this specification, the load testing robot primarily provides the function of sending robot packets to simulate a client. It operates in two forms: single-robot mode and multi-robot collaborative mode. Robots are uniformly assigned robot IDs by a global ID generator, and then individual goroutines are started, each handling one (or a group of) robots. Goroutines are lightweight threads in the Golang language, a parallel programming language used for server implementations. Robots customize their behavior as needed, cyclically executing packet sending-receiving-verification tasks to simulate concurrent client behavior. In the multi-robot scenario, in addition to processing its own messages, it also manages and coordinates the states of multiple robots, performing network communication and transaction verification. If unexpected results occur, the task will stop and an error report will be submitted. For example, when a robot encounters a logical error, fails verification, or the number of communications or memory usage reaches a preset threshold, the robot stops its current task and submits an error report.
[0055] S207: After instrumentation, the process execution function call is used to process the application data packet to obtain the monitoring results of the overall CPU utilization, the overall memory utilization, and the overall session count per unit time.
[0056] In the embodiments described in this specification, each monitoring result may include a monitoring type, a monitoring time, and a target monitoring result file. The monitoring results may be displayed in a visual manner.
[0057] In the embodiments described in this specification, such as Figure 3 As shown, the process of executing function calls after instrumentation to process the application data packets and obtain monitoring results for CPU utilization, memory utilization, and the number of sessions per unit time may include:
[0058] S2071: Determine the CPU utilization rate, memory utilization rate monitoring results, and session count monitoring results for each called function in the instrumented process;
[0059] S2073: Determine the overall CPU utilization monitoring result based on the CPU utilization rate corresponding to each called function;
[0060] S2075: Determine the overall memory utilization monitoring result based on the memory utilization rate corresponding to each called function;
[0061] S2077: Determine the overall session count monitoring result per unit time based on the number of sessions corresponding to each called function.
[0062] In the embodiments of this specification, the CPU utilization rate, memory utilization rate monitoring results, and session count monitoring results corresponding to each called function in the process can be determined based on the instrumented process; and based on the monitoring results, the CPU overall utilization rate monitoring results, memory overall utilization rate monitoring results, and session count monitoring results corresponding to each process can be determined, thereby determining the comprehensive stress test results of the server based on the monitoring results of each process in the server.
[0063] S209: Determine the stress test results of the local server based on the monitoring results of the overall utilization of the central processing unit, the overall utilization of memory, and the overall number of sessions per unit time.
[0064] Specifically, in the embodiments of this specification, determining the stress test results of the local server based on the overall CPU utilization monitoring results, the overall memory utilization monitoring results, and the overall session count monitoring results per unit time may include:
[0065] Based on the monitoring results of the overall utilization rate of the central processing unit and the monitoring results of the overall number of sessions per unit time, the stress monitoring results of the central processing unit are determined.
[0066] The stress test results of the local server are determined based on the stress monitoring results of the central processing unit and the overall memory utilization monitoring results.
[0067] Specifically, in the embodiments of this specification, under the same overall CPU utilization, the higher the TPS, the better, which means the higher the utilization of the unit CPU; for two different processes, if the overall CPU utilization of the two processes is the same, it is determined that the process with lower TPS has greater pressure on the central processing unit and needs to be optimized.
[0068] Specifically, in the embodiments of this specification, determining the CPU stress monitoring result based on the CPU overall utilization monitoring result and the overall session count monitoring result per unit time may include:
[0069] When the overall utilization rate of the central processing unit is greater than a preset utilization rate threshold and the overall number of sessions per unit time is greater than a preset number threshold, the central processing unit is determined to be in a state of stress overload.
[0070] In the embodiments described in this specification, the method may further include:
[0071] When the central processing unit is under stress overload and / or the overall memory utilization rate exceeds a preset threshold, the local server is determined to be under stress overload.
[0072] Specifically, in the embodiments of this specification, the method may further include:
[0073] When the central processing unit is in normal condition and the overall memory utilization rate does not exceed a preset threshold, the local server is determined to be in normal condition.
[0074] In the embodiments of this specification, the monitoring results of the central processing unit, memory usage, and number of sessions per unit time can be combined to comprehensively determine the stress test results of the local server, thereby improving the accuracy of the server stress test results.
[0075] S2011: When the local server is under overload, the target call path is determined based on the function call relationship in the process after instrumentation.
[0076] Specifically, in the embodiments of this specification, each instrumented process can call one or more functions, and multiple call paths can be determined based on the function call relationships.
[0077] In this embodiment of the specification, determining the target call path based on the function call relationship in the process after instrumentation includes:
[0078] Based on the function call relationships in the process after instrumentation, at least two function call paths are determined;
[0079] Determine the target call path based on the at least two function call paths.
[0080] In the embodiments of this specification, the target call path is the path with the highest CPU or memory consumption. After determining the path, the functions in the path can be optimized, such as reducing the calls to unnecessary functions or improving the calling functions.
[0081] In this embodiment of the specification, determining the target call path based on the at least two function call paths may include:
[0082] Calculate the CPU utilization rate for each function call path based on the CPU utilization rate of the functions called in each function call path;
[0083] The at least two function call paths are sorted in ascending order of CPU usage.
[0084] The function call path corresponding to the utilization rate of the last-ranked central processing unit is determined as the target call path.
[0085] In the embodiments described in this specification, the method may further include:
[0086] Based on the CPU usage of each function call path, different identification information is set for functions in each function call path, and the same identification information is set for functions in the same function call path. The identification information can be color. For example, functions in paths with higher CPU usage can be set to a darker color, and functions in paths with lower CPU usage can be set to a lighter color.
[0087] In the embodiments of this specification, the CPU utilization rate of each function in each function call path can be calculated to determine the CPU utilization rate of each function call path, thereby identifying the target call path with the highest CPU consumption. This facilitates the effective reduction of server load based on the target call path.
[0088] In the embodiments of this specification, the CPU usage rate corresponding to each function and the calling relationship between functions can be displayed; and the identification information of the target call path can be set to distinguish it from other function call paths, so that users can intuitively know the path with the highest CPU consumption.
[0089] In this embodiment of the specification, determining the target call path based on the at least two function call paths may include:
[0090] Calculate the memory usage rate for each function call path based on the memory usage rate of the functions called in each function call path;
[0091] Sort the at least two function call paths in ascending order of memory usage.
[0092] The function call path corresponding to the last ranked memory usage is determined as the target call path.
[0093] In the embodiments described in this specification, the method may further include:
[0094] Based on the memory usage of each function call path, different identification information is set for functions in each function call path. Functions in the same function call path are set with the same identification information. The identification information can be a color. For example, functions in paths with higher memory usage can be set with a darker color, and functions in paths with lower memory usage can be set with a lighter color.
[0095] In the embodiments of this specification, the memory usage rate of each function in each function call path can be calculated to determine the memory usage rate of each function call path, thereby identifying the target call path with the highest memory consumption. This facilitates the effective reduction of server load based on the target call path.
[0096] In the embodiments of this specification, the memory usage rate of each function and the calling relationship between functions can be displayed; and the identification information of the target call path can be set to distinguish it from other function call paths, so that users can intuitively know the path with the highest memory consumption.
[0097] In the embodiments described in this specification, the method may further include:
[0098] The blockchain system stores the CPU usage and memory usage corresponding to each called function. The blockchain system includes multiple nodes, which form a peer-to-peer network.
[0099] In some embodiments, the blockchain system can be Figure 4 The structure shown depicts a peer-to-peer (P2P) network formed by multiple nodes. The P2P protocol is an application layer protocol that runs on top of the Transmission Control Protocol (TCP). In a blockchain system, any machine, such as a server or terminal, can join and become a node. A node comprises a hardware layer, a middleware layer, an operating system layer, and an application layer.
[0100] Figure 4 The functions of each node in the blockchain system shown include:
[0101] 1) Routing: A basic function of nodes used to support communication between nodes.
[0102] In addition to routing capabilities, nodes can also have the following functions:
[0103] 2) Applications are deployed in the blockchain to implement specific business needs. They record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system. When other nodes successfully verify the source and integrity of the record data, they add the record data to a temporary block.
[0104] 3) A blockchain consists of a series of blocks that are sequentially generated. Once a new block is added to the blockchain, it will not be removed. The blocks contain the data submitted by the nodes in the blockchain system.
[0105] In some embodiments, the block structure can be Figure 5The structure shown includes a hash value for each block containing the transaction records stored in that block (the hash value of this block) and the hash value of the previous block. These blocks are linked together to form the blockchain. Additionally, blocks may include information such as a timestamp when they were generated. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains relevant information used to verify the validity of the information (anti-counterfeiting) and to generate the next block.
[0106] In this embodiment of the specification, after the step of determining the target call path based on the function call relationship in the instrumented process, the method may further include:
[0107] The functions in the target call path are optimized.
[0108] In this embodiment of the specification, the target call path includes at least two functions, and the optimization process for the functions in the target call path includes:
[0109] Determine the priority of each function in the target call path;
[0110] Functions with a priority lower than the preset level are identified as target functions, and calls to these target functions are prohibited.
[0111] In the embodiments described in this specification, the call to unnecessary functions can be prohibited by setting the priority level of functions, thereby reducing the pressure on the server.
[0112] In the embodiments described in this specification, the method may further include:
[0113] Based on the CPU utilization rate corresponding to each called function in the process, determine the attribute information of the first display diagram of each called function;
[0114] Based on the calling relationships between functions and the attribute information of the first display block of each calling function, a CPU performance heatmap is displayed.
[0115] In the embodiments described in this specification, the method may further include:
[0116] Based on the monitoring code of the central processing unit, the monitoring time, sampling duration, and sampling rate of the central processing unit are determined.
[0117] In the embodiments of this specification, the utilization rate of the central processing unit and the monitoring code of the central processing unit can be obtained at first preset time intervals.
[0118] Accordingly, displaying the CPU performance heatmap based on the call relationships between functions and the attribute information of the first display block diagram for each called function includes:
[0119] Based on the monitoring time, sampling duration, sampling rate of the central processing unit, the calling relationship between functions, and the attribute information of the first display block diagram of each calling function, a performance heatmap of the central processing unit is displayed.
[0120] In the embodiments described in this specification, the method further includes:
[0121] The performance heatmap of the central processing unit is updated at each first preset time interval.
[0122] In embodiments of this specification, prior to the step of displaying the CPU performance heatmap, the method may further include:
[0123] Generate the performance heatmap of the central processing unit.
[0124] In the embodiments of this specification, the attribute information of the first display block diagram may include the area and color information of the first display block diagram. This application can obtain a CPU performance heatmap through CPU instrumentation, thereby intuitively displaying the CPU utilization rate corresponding to each called function to the user.
[0125] In the embodiments described in this specification, the method may further include:
[0126] Based on the memory usage rate of each called function in the process, determine the attribute information of the second display diagram of each called function;
[0127] Based on the calling relationships between functions and the attribute information of the second display box of each calling function, a memory performance hotspot map is displayed;
[0128] In the embodiments described in this specification, the method may further include:
[0129] Based on the memory monitoring code, determine the memory monitoring time, sampling duration, and sampling rate.
[0130] In the embodiments described in this specification, the memory usage rate and memory monitoring code corresponding to each called function can be obtained at second preset time intervals. The second preset time may be the same as or different from the first preset time.
[0131] Accordingly, displaying the memory performance heatmap based on the call relationships between functions and the attribute information of the second display diagram for each called function includes:
[0132] Based on the memory monitoring time, sampling duration, sampling rate, the call relationship between functions, and the attribute information of the second display block diagram of each called function, a memory performance heatmap is displayed.
[0133] In the embodiments described in this specification, the method further includes:
[0134] The memory performance heatmap is updated every second preset time interval.
[0135] In the embodiments of this specification, prior to the step of displaying the memory performance heatmap, the method may further include:
[0136] Generate the memory performance heatmap.
[0137] In the embodiments of this specification, the attribute information of the second display block diagram may include the area and color information of the second display block diagram. This application can obtain a memory performance heatmap through memory instrumentation, thereby intuitively displaying the memory usage corresponding to each called function to the user.
[0138] In the embodiments described in this specification, the method may further include:
[0139] The server sends a response data packet to the stress testing robot.
[0140] In the embodiments of this specification, before the step of obtaining the source code of the process, the method further includes:
[0141] Perform a smoke test on the local server.
[0142] Specifically, performing smoke tests on local servers includes:
[0143] Set a preset number of load testing robots;
[0144] Receive data packets sent by a preset number of load testing robots;
[0145] Send feedback information to a preset number of stress testing robots.
[0146] In a specific embodiment, such as Figure 6 As shown, the load testing tool simulates generating multiple packet-sending bots and establishing WebSocket connections with the game server. Then, it sequentially creates rooms (…). Figure 6 In Cretea Room) -> Join Room ( Figure 6 Join Room -> Game Preparation Figure 6 In the Prepare Room, go to Start Hero Selection. Figure 6 StartPick in the middle --> Select hero to complete ( Figure 6In the game, go to Set Hero and enter battle. Figure 6 Start Battle -> Battle Process Figure 6 In Run Battle, 100Frame means the battle lasts for 100 frames) -> Set character death ( Figure 6 (Crutial State Chg) --> Leave battle ( Figure 6 Quit Battle in the game) -> Battle ends ( Figure 6 The `GameEndNtf` function is used to verify the integrity of the game server functionality.
[0147] In some embodiments, the connection between the robot and the server can be not only the WebSocket protocol, but also the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP).
[0148] In some embodiments, multiple robots can be distributed across multiple machines (e.g., one robot per machine) to increase concurrency and expand the upper limit of robot usage.
[0149] In the embodiments of this specification, a robot is used to simulate the client's packet sending and receiving behavior to verify the complete main process of the server. After confirming that the process is complete, that is, after the server's smoke test is passed, the source code of the process in the server is obtained.
[0150] In some embodiments, for game servers whose source code is unavailable, stress testing requires the use of other tools (such as perf) instead of direct code instrumentation. The advantage is that source code intrusion is not required, but it is impossible to accurately test the specific problematic code module.
[0151] In a specific embodiment, a schematic diagram of the information processing system is shown below. Figure 7As shown, the server is a game server, which includes background business processes and background server processes. The background business processes include roomsvr1, roomsvr2, and roomsvr3. roomsvr communicates with the load testing robot through connd. Each process is equipped with an instrumentation module, which includes CPU instrumentation, MEM instrumentation, and TPS instrumentation. The load testing robot can be a single robot or multiple robots, each executed by an independent goroutine thread and concurrently connected to the connd process. Each robot logs in in response to the load test request. When there is only one load testing robot, after successful login, the robot sends a data packet to the game server. The game server processes the data packet based on the instrumented process and sends a receipt message to the robot, which verifies the correctness of the receipt.
[0152] When there are multiple load testing robots, for example, three robots, robot 1.1 and robot 1.2 share a set of threads, while robot 2.1 uses its own set of threads. Each robot sends a data packet to the server after successful login. The server processes multiple data packets based on the instrumented process and sends an acknowledgment message to each robot. Then, each robot waits for cooperation from the other robots; once cooperation is complete, it proceeds to the next step. In a specific embodiment, such as... Figure 8 As shown, a multi-bot collaborative stress test case was implemented to simulate complex client usage scenarios through a collaborative process. Based on the multi-bot packet sending and receiving interface, a multi-player collaborative stress test case was implemented: the host creates a room, other players obtain the room list, everyone enters the room to prepare, then chooses a hero, the host starts the battle, and after the battle is successfully created, the battle process begins, and the process continues until it ends, with the test looping. In this example, a large number of test bots can be generated at a relatively low cost to stress test the server under high load. The stress test results are monitored and output through instrumentation, and the game server is optimized based on the stress test results. This process is iterated repeatedly until the server stress indicators reach the target.
[0153] In one embodiment, the stress test results are as follows: Figure 9As shown in the figure, the double-lined box 03 marks the detailed information of this instrumentation monitoring, including instrumentation type, time, total sampling time, sampling rate, etc. File is the filename, Build ID is the hash value or version number, Type is the test metric, Time is the test time, Duration is the test duration, and Showingnodes accounting for 231.81s, 87.07% of 266.24s total, with a total sampling rate of 87.07%. Dropped 262nodes and Dropped 21edges are denoised. In the figure, a box 04 represents a node, and an arrow represents an edge; each box represents a function, and the English name in the box is the function name. The larger the area of the box, the more CPU the function uses; Showing top 80nodes out of 109 are the nodes with the largest sample size (the top 80 out of 109).
[0154] In one embodiment, the resulting target call path diagram is as follows: Figure 10 As shown, the path corresponding to ellipse 05 is the target call path. For the data set 36.90s (13.86%) of 87.27s (32.78%), the meanings are: 36.90s and 87.27s are the runtimes; 13.86% is the percentage of the current function and all its child functions; and 32.78% is the percentage of the current function and all its child functions in the total number of functions. In target call paths with excessive load, the load is too high when the logging module calls the caller function. To address this, the implementation of the logging module was improved by introducing logging levels and setting level information for each function. During function calls, higher-level functions are called, controlling calls to lower-level (unnecessary) caller functions. With the connd process fully loaded (TPS reaching 165,000), the CPU usage of the roomsvr process decreased from 110% to 60%, demonstrating significant optimization.
[0155] As can be seen from the technical solutions provided in the embodiments of this specification above, the embodiments of this specification obtain the instrumented process by instrumenting the CPU, memory, and number of sessions per unit time in the server process; and by processing the application data packets sent by the stress testing robot through the instrumented process, the comprehensive CPU utilization monitoring results, comprehensive memory utilization monitoring results, and comprehensive number of sessions per unit time monitoring results are obtained; thus, the comprehensive stress test results of the server can be obtained based on multiple monitoring results, improving the accuracy of the stress test results; when the server is under stress overload, the target call path can be determined according to the function call relationship in the instrumented process, which facilitates the optimization of functions in the target call path, thereby reducing the server pressure.
[0156] This application also provides an information processing device, such as... Figure 11 As shown, the device includes:
[0157] The source code acquisition module 1110 is used to acquire the source code of the process;
[0158] Instrumentation module 1120 is used to perform CPU instrumentation, memory instrumentation, and session number instrumentation per unit time in the source code of the process to obtain the instrumented process.
[0159] The application data packet receiving module 1130 is used to receive the application data packet sent by the stress testing robot in response to the stress testing request;
[0160] The monitoring result determination module 1140 is used to process the application data packet by executing the function call of the instrumented process to obtain the monitoring results of the overall utilization rate of the central processing unit, the overall utilization rate of memory, and the overall number of sessions per unit time.
[0161] The stress test result determination module 1150 is used to determine the stress test result of the local server based on the monitoring results of the overall utilization rate of the central processing unit, the monitoring results of the overall utilization rate of memory, and the monitoring results of the overall number of sessions per unit time.
[0162] The target call path determination module 1160 is used to determine the target call path based on the function call relationship in the instrumented process when the local server is under overload.
[0163] In some embodiments, the stress test result determination module may include:
[0164] The stress monitoring result determination submodule is used to determine the stress monitoring result of the central processing unit based on the overall utilization monitoring result of the central processing unit and the overall session count monitoring result per unit time.
[0165] The stress test result determination submodule is used to determine the stress test result of the local server based on the stress monitoring results of the central processing unit and the overall memory utilization monitoring results.
[0166] In some embodiments, the pressure monitoring result determination submodule may include:
[0167] The pressure overload state determination unit is used to determine that the central processing unit is in a pressure overload state when the overall utilization rate of the central processing unit is greater than a preset utilization rate threshold and the overall number of sessions per unit time is greater than a preset number threshold.
[0168] In some embodiments, the apparatus may further include:
[0169] The stress overload state determination module is used to determine that the local server is under stress overload when the central processing unit is under stress overload and / or the overall memory utilization rate exceeds a preset threshold.
[0170] In some embodiments, the monitoring result determination module may include:
[0171] The first monitoring result determination submodule is used to determine the CPU utilization rate, memory utilization rate monitoring results, and session count monitoring results for each called function in the instrumented process;
[0172] The second monitoring result determination submodule is used to determine the overall utilization monitoring result of the central processing unit based on the utilization rate of the central processing unit corresponding to each called function.
[0173] The third monitoring result determination submodule is used to determine the overall memory utilization monitoring result based on the memory utilization rate corresponding to each called function.
[0174] The fourth monitoring result determination submodule is used to determine the comprehensive session count monitoring result per unit time based on the session count corresponding to each called function.
[0175] In some embodiments, the target call path determination module may include:
[0176] The function call path determination submodule is used to determine at least two function call paths based on the function call relationships in the process after instrumentation.
[0177] The target call path determination submodule is used to determine the target call path based on the at least two function call paths.
[0178] In some embodiments, the target call path determination submodule may include:
[0179] The CPU utilization calculation unit is used to calculate the CPU utilization of each function call path based on the CPU utilization of the functions called in each function call path.
[0180] The first sorting unit is used to sort the at least two function call paths in ascending order of CPU utilization.
[0181] The first target call path determination unit is used to determine the function call path corresponding to the utilization rate of the last-ranked central processing unit as the target call path.
[0182] In some embodiments, the apparatus may further include:
[0183] The first display block diagram attribute information determination module is used to determine the attribute information of the first display block diagram of each called function based on the utilization rate of the central processing unit corresponding to each called function in the process.
[0184] The CPU performance heatmap display module is used to display the CPU performance heatmap based on the call relationships between functions and the attribute information of the first display box of each calling function.
[0185] In some embodiments, the target call path determination submodule may include:
[0186] The memory utilization calculation unit is used to calculate the memory utilization of each function call path based on the memory utilization of the functions called in each function call path.
[0187] The second sorting unit is used to sort the at least two function call paths in ascending order of memory usage.
[0188] The second target call path determination unit is used to determine the function call path corresponding to the last ranked memory usage rate as the target call path.
[0189] In some embodiments, the apparatus may further include:
[0190] The second display diagram attribute information determination module is used to determine the attribute information of the second display diagram of each called function based on the memory usage rate of each called function in the process.
[0191] The memory performance heatmap display module is used to display memory performance heatmaps based on the call relationships between functions and the attribute information of the second display box of each called function.
[0192] In some embodiments, the apparatus may further include:
[0193] The error report receiving module is used to receive error reports sent by the load testing robot when it generates target results during operation; the load testing robot performs network communication and transaction verification during operation.
[0194] In some embodiments, the apparatus may further include:
[0195] An optimization processing module is used to optimize the functions in the target call path.
[0196] The apparatus and method embodiments described herein are based on the same inventive concept.
[0197] This application provides an information processing device, which includes a processor and a memory. The memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement the information processing method provided in the above method embodiments.
[0198] Embodiments of this application also provide a computer storage medium that can be used to implement at least one instruction or at least one program related to an information processing method in the method embodiments. The at least one instruction or at least one program is loaded and executed by the processor to implement the information processing method provided in the above method embodiments.
[0199] Optionally, in the embodiments of this specification, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0200] The memory described in the embodiments of this specification can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for the functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.
[0201] The information processing method embodiments provided in this application can be executed on a mobile terminal, computer terminal, server, or similar computing device. Taking running on a server as an example, Figure 12 This is a hardware structure block diagram of a server for an information processing method provided in an embodiment of this application. For example... Figure 12As shown, the server 1200 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1210 (CPUs 1210 may include, but are not limited to, microprocessors (MCUs) or programmable logic devices (FPGAs), a memory 1230 for storing data, and one or more storage media 1220 (e.g., one or more mass storage devices) for storing application programs 1223 or data 1222. The memory 1230 and storage media 1220 may be temporary or persistent storage. The program stored in the storage media 1220 may include one or more modules, each module including a series of instruction operations on the server. Furthermore, the CPU 1210 may be configured to communicate with the storage media 1220 and execute the series of instruction operations stored in the storage media 1220 on the server 1200. Server 1200 may also include one or more power supplies 1260, one or more wired or wireless network interfaces 1250, one or more input / output interfaces 1240, and / or one or more operating systems 1221, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0202] The input / output interface 1240 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 1200. In one example, the input / output interface 1240 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 1240 may be a radio frequency (RF) module for wireless communication with the Internet.
[0203] Those skilled in the art will understand that Figure 12 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 1200 may also include... Figure 12 The more or fewer components shown, or having the same Figure 12 The different configurations shown.
[0204] As can be seen from the embodiments of the information processing method, apparatus, or storage medium provided in this application, this application obtains a tooled process by instrumenting the CPU, memory, and number of sessions per unit time in the server process; and processes the application data packets sent by the stress testing robot through the tooled process to obtain the CPU overall utilization monitoring results, memory overall utilization monitoring results, and number of sessions per unit time monitoring results; thereby, a comprehensive stress test result of the server can be obtained based on multiple monitoring results, improving the accuracy of the stress test results; when the server is under stress overload, the target call path can be determined based on the function call relationship in the tooled process, which facilitates the optimization of functions in the target call path, thereby reducing the server pressure.
[0205] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0206] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0207] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer storage medium, such as a read-only memory, a disk, or an optical disk.
[0208] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. An information processing method, characterized in that, The method includes: Obtain the source code of the process; The CPU instrumentation, memory instrumentation, and session count instrumentation per unit time are performed in the source code of the process to obtain the instrumented process. Receive the application data packet sent by the stress testing robot in response to the stress test request; After instrumentation, the process executes function calls to process the application data packets, thereby obtaining the monitoring results of CPU overall utilization, memory overall utilization, and the overall number of sessions per unit time. Based on the monitoring results of the overall CPU utilization, the overall memory utilization, and the overall number of sessions per unit time, the stress test results of the local server are determined. When the local server is under overload, at least two function call paths are determined based on the function call relationships in the instrumented process; the CPU utilization rate corresponding to each function call path is calculated based on the CPU utilization rate of the functions called in each function call path; the at least two function call paths are sorted in ascending order of CPU utilization rate; or, the memory utilization rate corresponding to each function call path is calculated based on the memory utilization rate of the functions called in each function call path; the at least two function call paths are sorted in ascending order of memory utilization rate. The function call path corresponding to the CPU utilization rate at the bottom of the sort or the function call path corresponding to the memory utilization rate at the bottom of the sort is determined as the target call path.
2. The method according to claim 1, characterized in that, The determination of the local server's stress test results based on the overall CPU utilization monitoring results, the overall memory utilization monitoring results, and the overall session count monitoring results per unit time includes: Based on the monitoring results of the overall utilization rate of the central processing unit and the monitoring results of the overall number of sessions per unit time, the stress monitoring results of the central processing unit are determined. The stress test results of the local server are determined based on the stress monitoring results of the central processing unit and the overall memory utilization monitoring results.
3. The method according to claim 2, characterized in that, The determination of the CPU stress monitoring results based on the overall CPU utilization monitoring results and the overall session count monitoring results per unit time includes: When the overall utilization rate of the central processing unit is greater than a preset utilization rate threshold and the overall number of sessions per unit time is greater than a preset number threshold, it is determined that the central processing unit is in a state of stress overload. The method further includes: When the central processing unit is under stress overload and / or the overall memory utilization rate exceeds a preset threshold, the local server is determined to be under stress overload.
4. The method according to claim 1, characterized in that, The process of executing function calls after instrumentation to process the application data packets and obtain monitoring results for CPU utilization, memory utilization, and the number of sessions per unit time includes: After instrumentation, determine the CPU utilization, memory utilization monitoring results, and session count monitoring results for each called function in the process; Based on the CPU utilization rate corresponding to each called function, determine the overall CPU utilization monitoring result; Based on the memory usage rate corresponding to each called function, determine the overall memory usage monitoring result; Based on the number of sessions corresponding to each called function, determine the overall session count monitoring result per unit time.
5. The method according to claim 1, characterized in that, The method further includes: Based on the CPU utilization rate corresponding to each called function in the process, determine the attribute information of the first display diagram of each called function; Based on the calling relationships between functions and the attribute information of the first display block of each calling function, a CPU performance heatmap is displayed.
6. The method according to claim 1, characterized in that, The method further includes: Based on the memory usage rate of each called function in the process, determine the attribute information of the second display diagram of each called function; Based on the calling relationships between functions and the attribute information of the second display box of each calling function, a memory performance heatmap is displayed.
7. The method according to claim 1, characterized in that, The method further includes: The system receives error reports sent by the load testing robot when it generates target results during operation; the load testing robot performs network communication and transaction verification during operation.
8. An information processing device, characterized in that, The device includes: The source code acquisition module is used to obtain the source code of the process; The instrumentation module is used to perform CPU instrumentation, memory instrumentation, and instrumentation of the number of sessions per unit time in the source code of the process to obtain the instrumented process. The application data packet receiving module is used to receive application data packets sent by the stress testing robot in response to the stress test request; The monitoring result determination module is used to process the application data packet by executing function calls after instrumentation, and obtain the monitoring results of the overall CPU utilization, the overall memory utilization, and the overall number of sessions per unit time. The stress test result determination module is used to determine the stress test result of the local server based on the monitoring results of the overall CPU utilization, the overall memory utilization, and the overall session count per unit time. The target call path determination module is used to determine at least two function call paths based on the function call relationships in the instrumented process when the local server is under overload; calculate the CPU utilization rate corresponding to each function call path based on the CPU utilization rate of the functions called in each function call path; sort the at least two function call paths in ascending order of CPU utilization rate; or calculate the memory utilization rate corresponding to each function call path based on the memory utilization rate of the functions called in each function call path; sort the at least two function call paths in ascending order of memory utilization rate; and determine the function call path corresponding to the lowest CPU utilization rate or the lowest memory utilization rate as the target call path.
9. The apparatus according to claim 8, characterized in that, The stress test result determination module includes: The stress monitoring result determination submodule is used to determine the stress monitoring result of the central processing unit based on the overall utilization monitoring result of the central processing unit and the overall session count monitoring result per unit time. The stress test result determination submodule is used to determine the stress test result of the local server based on the stress monitoring results of the central processing unit and the overall memory utilization monitoring results.
10. The apparatus according to claim 9, characterized in that, The pressure monitoring result determination submodule includes a pressure overload state determination unit, used to determine that the central processing unit is in a pressure overload state when the overall utilization rate of the central processing unit is greater than a preset utilization rate threshold and the overall number of sessions per unit time is greater than a preset number threshold. The device further includes a pressure overload state determination module, used to determine that the local server is in a pressure overload state when the central processing unit is in a pressure overload state and / or the overall memory utilization rate exceeds a preset threshold.
11. The apparatus according to claim 8, characterized in that, The monitoring result determination module includes: The first monitoring result determination submodule is used to determine the CPU utilization rate, memory utilization rate monitoring results, and session count monitoring results for each called function in the instrumented process; The second monitoring result determination submodule is used to determine the overall utilization monitoring result of the central processing unit based on the utilization rate of the central processing unit corresponding to each called function. The third monitoring result determination submodule is used to determine the overall memory utilization monitoring result based on the memory utilization rate corresponding to each called function. The fourth monitoring result determination submodule is used to determine the comprehensive session count monitoring result per unit time based on the session count corresponding to each called function.
12. The apparatus according to claim 8, characterized in that, The device further includes: The first display block diagram attribute information determination module is used to determine the attribute information of the first display block diagram of each called function based on the utilization rate of the central processing unit corresponding to each called function in the process. The CPU performance heatmap display module is used to display the CPU performance heatmap based on the call relationships between functions and the attribute information of the first display box of each calling function.
13. The apparatus according to claim 8, characterized in that, The device further includes: The second display diagram attribute information determination module is used to determine the attribute information of the second display diagram of each called function based on the memory usage rate of each called function in the process. The memory performance heatmap display module is used to display memory performance heatmaps based on the call relationships between functions and the attribute information of the second display box of each called function.
14. The apparatus according to claim 8, characterized in that, The device further includes: The error report receiving module is used to receive error reports sent by the load testing robot when it generates target results during operation; the load testing robot performs network communication and transaction verification during operation. An optimization processing module is used to optimize the functions in the target call path.
15. A computer storage medium, characterized in that, The computer storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the information processing method as described in any one of claims 1-7.