Performance test method and device of business system, and readable storage medium

By collecting and replaying HTTP request and response data of the service system in the production environment, analyzing the performance monitoring data in the test environment, solving the problem of low security and reliability of the performance test of the service system, and realizing automated testing and efficient performance evaluation.

CN119135558APending Publication Date: 2024-12-13CHINA TOWER CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411141070.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Existing business system performance tests have low security and reliability in production environments, which may lead to risks such as network lag and unresponsive requests, making it difficult to accurately and effectively verify the performance of the business system after being transformed.

Method used

Collect HTTP request and response data in the production environment, store traffic back in the test environment for analysis, compare performance monitoring data and logs of the production environment and the test environment to obtain the transformed business system performance test results.

Benefits of technology

Without affecting the normal operation of the business system, automated testing is implemented, which reduces manual testing costs, improves testing efficiency and accuracy, and can accurately discover performance bottlenecks and guide resource allocation optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119135558A_ABST
    Figure CN119135558A_ABST
Patent Text Reader

Abstract

The invention discloses a performance testing method and device of a service system and a readable storage medium. The performance testing method comprises the steps of collecting an HTTP request when a target service system executes a target service in a production environment and a response, performance monitoring data and a log correspondingly generated by the HTTP request; performing flow playback on the transformed target service system in a test environment based on the HTTP request; acquiring response, performance monitoring data and logs correspondingly generated by the HTTP request in the flow playback process; and analyzing the response, the performance monitoring data and the log generated based on the HTTP request in the production environment and the response, the performance monitoring data and the log generated based on the HTTP request in the test environment to obtain a performance test result of the transformed target service system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to a performance testing method and device for a business system, and a readable storage medium. Background Art

[0002] Business systems can provide web services based on user-initiated requests. When hardware and software components, such as hosts, servers, and / or databases, are replaced in a business system, the operating environment changes. It is necessary to verify whether the corresponding business can operate normally under the new business system architecture. In other words, after the business system is adapted and restructured, performance testing is required to ensure that user experience is not affected. When conducting performance testing, testing is performed directly in the production environment—the actual operating environment that provides real services to users. This may introduce risks to users, such as network lag and unresponsive requests.

[0003] Therefore, a safe and reliable way is needed to simulate the production environment to accurately and effectively test the performance of the transformed business system. Summary of the Invention

[0004] The purpose of the embodiments of the present application is to provide a performance testing method and device for a business system, and a readable storage medium, so as to solve the problem of low security and reliability of performance testing of existing business systems.

[0005] In order to solve the above technical problems, this specification is implemented as follows:

[0006] In a first aspect, a performance testing method for a business system is provided, comprising:

[0007] Collect HTTP requests and responses, performance monitoring data, and logs generated by the target business system when executing the target business in a production environment;

[0008] Replaying traffic of the modified target business system in a test environment based on the HTTP request;

[0009] Collect responses, performance monitoring data, and logs generated by HTTP requests during traffic playback.

[0010] The responses, performance monitoring data and logs generated based on HTTP requests in the production environment, as well as the responses, performance monitoring data and logs generated based on HTTP requests in the test environment are analyzed to obtain the performance test results of the target business system after the transformation.

[0011] Optionally, collecting HTTP requests when the target business system executes the target business in a production environment includes:

[0012] Determine the optimal parameter combination for collecting the traffic data packets based on the completeness of the collection of HTTP request traffic data packets corresponding to different parameter combinations, the parameter combination including one or more of whether to configure HTTP protocol filtering, whether to collect only HTTP requests, the length of time it takes to collect, whether to limit the service port ownership during collection, and whether to use a high-speed storage device;

[0013] Based on the optimal parameter combination, traffic data packets of HTTP requests of the target business system when executing the target business in the production environment during business peak hours are collected.

[0014] Optionally, the determining of the optimal parameter combination for collecting the traffic data packets based on the collection completeness of the traffic data packets of the HTTP requests corresponding to different parameter combinations includes:

[0015] A data set including different parameter combinations and corresponding acquisition completeness is used as a sample input into a preset probability proxy function;

[0016] Taking the objective function as the optimal solution to achieve the highest acquisition completeness, the optimal parameter combination is determined in the parameter space of the probabilistic proxy function.

[0017] Optionally, after collecting HTTP requests and responses corresponding to the HTTP requests, performance monitoring data, and logs when the target business system executes the target business in the production environment, the method further includes:

[0018] Parse the collected HTTP requests from the data link layer protocol to the HTTP application layer protocol;

[0019] The request header and request body of the parsed HTTP request are stored separately in the target database, and the timestamp and the sequence of the HTTP request are recorded.

[0020] Optionally, replaying traffic of the transformed target business system in a test environment based on the HTTP request includes:

[0021] Obtain the original playback traffic source including each collected HTTP request;

[0022] Determine the original time interval corresponding to each HTTP request in the original playback traffic source;

[0023] Simultaneously start multiple independent service processes to load the original playback traffic source respectively;

[0024] Each HTTP request in the playback traffic source is played back to the transformed target business system according to the corresponding original time interval through the multiple independent service processes.

[0025] Optionally, based on the configuration requirements of the transformed target business system when performing traffic playback, the multiple independent service threads are allocated to the same node or different nodes of the target business system.

[0026] Optionally, replaying traffic of the transformed target business system in a test environment based on the HTTP request includes:

[0027] Obtain the original playback traffic source including each collected HTTP request;

[0028] Determine the original time interval corresponding to each HTTP request in the original playback traffic source;

[0029] Starting a single service process to load the original playback traffic source;

[0030] After each HTTP request in the playback traffic source is shortened by a predetermined multiple in proportion to the corresponding original time interval by the single service process, it is played back to the transformed target business system.

[0031] Optionally, analyzing responses, performance monitoring data, and logs generated based on HTTP requests in the production environment, and responses, performance monitoring data, and logs generated based on HTTP requests in the test environment to obtain performance test results of the modified target business system includes:

[0032] Comparing responses generated by HTTP requests in the production environment with responses generated by HTTP requests in the test environment to determine the time taken by the same HTTP request in the production environment and in the test environment;

[0033] Comparing application performance data generated by HTTP requests in the production environment with application performance data generated by HTTP requests in the test environment to determine the application performance of the target business system after transformation;

[0034] Comparing database performance data generated by HTTP requests in the production environment with database performance data generated by HTTP requests in the test environment to determine the database performance of the target business system after transformation;

[0035] Compare the logs generated by HTTP requests in the production environment with the logs generated by HTTP requests in the test environment, including log exceptions, request durations in middleware logs, and response status codes, to determine the operating status of the target business system after the transformation;

[0036] Based on a combination of one or more of the time consumption, application performance, database performance and operating status, a performance test result of the target business system after transformation is obtained.

[0037] In a second aspect, a performance testing device for a business system is provided, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0038] In a third aspect, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0039] In an embodiment of the present application, by collecting HTTP requests and responses, performance monitoring data and logs generated by the target business system when executing the target business in the production environment; replaying the traffic of the modified target business system in the test environment based on the HTTP requests; collecting responses, performance monitoring data and logs generated by the HTTP requests in the traffic playback process; analyzing the responses, performance monitoring data and logs generated based on the HTTP requests in the production environment, and the responses, performance monitoring data and logs generated based on the HTTP requests in the test environment to obtain the performance test results of the modified target business system, thereby capturing the traffic data packets of the production environment without affecting the normal operation of the business system, using the real access requests of users in the production environment to realize automated testing of the modified business system, simulating the production environment load in the test environment, reducing a lot of manual testing costs, greatly improving testing efficiency and test accuracy, effectively and accurately discovering the performance bottlenecks of the target business system after the transformation and whether the server resource configuration meets business needs, and providing accurate guidance for the target business system to adapt to the performance optimization and resource configuration after the transformation. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0041] Figure 1 It is a flowchart of the performance testing method of the business system of an embodiment of the present application.

[0042] Figure 2 Schematic diagram of a machine learning algorithm for determining an optimal parameter combination in an embodiment of the present application.

[0043] Figure 3 This is a flow chart of the flow replay for the first embodiment of the present application.

[0044] Figure 4 This is a flow chart of the second embodiment of the present application for traffic playback.

[0045] Figure 5 This is an overall example flow chart of the performance testing method of the business system in an embodiment of the present application.

[0046] Figure 6 It is a structural block diagram of a performance testing device for a business system according to an embodiment of the present application. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. The figure numbers in this application are only used to distinguish the various steps in the scheme and are not used to limit the execution order of the various steps. The specific execution order is subject to the description in the specification.

[0048] In order to solve the problems existing in the prior art, the present invention provides a performance testing method for a business system. Figure 1 As shown, the process includes the following steps 102 to 108.

[0049] Step 102 : Collect HTTP requests, responses generated corresponding to the HTTP requests, performance monitoring data, and logs generated when the target business system executes the target business in a production environment.

[0050] The production environment is the actual operating environment that provides real services to users when the target business system performs normally; the test environment is the test operating environment that simulates the provision of services to users after the target business system has completed adaptation and transformation.

[0051] Before conducting performance testing of the target business system after transformation, it is necessary to collect traffic data packets of HTTP requests generated during normal operation from the production environment of the target business system before transformation, that is, HTTP requests for target business received by users of the target business, as well as responses, performance monitoring data and logs generated by the HTTP requests. HTTP requests for target business include multiple HTTP requests for target business from different users within a preset time period, such as login requests, search requests, traffic requests, etc.

[0052] Here, the target business system running in the production environment usually does not have performance issues, but when collecting traffic data packets corresponding to the HTTP requests generated by the target business system, there may be packet loss, resulting in incomplete data collected for the application layer.

[0053] In this regard, in order to improve the completeness of the collected traffic data packets of HTTP requests, optionally, the collection of HTTP requests when the target business system executes the target business in a production environment includes: based on the collection completeness of the traffic data packets of HTTP requests corresponding to different parameter combinations, determining the optimal parameter combination for collecting the traffic data packets, the parameter combination including whether to configure HTTP protocol filtering, whether to only collect HTTP requests, how long the collection takes, whether to limit the service port ownership during collection, and whether to use a high-speed storage device; based on the optimal parameter combination, collecting the traffic data packets of HTTP requests when the target business system executes the target business in the production environment during business peak hours.

[0054] When collecting traffic data packets, set the collection time node to the peak period of the target business system. Peak periods have higher HTTP request volumes, resulting in larger traffic data packets requiring storage. High traffic volumes also affect the integrity of collected data packets. Therefore, collecting traffic data packets during peak hours can better assess the performance of the target business system after transformation during testing.

[0055] Before collecting traffic data packets in the production environment of the target business system, the following preparations need to be performed: incorporate the production environment and test environment of the transformed target business system to be tested into the relevant performance monitoring system; ensure that the monitoring system can normally collect server performance data of the transformed target business system; confirm the number of service nodes where the production environment and test environment of the target business system are located, and ensure that all service nodes have deployed traffic data packet collection tools and can operate normally, and collect server network card information, application log path information, etc. of each service node; ensure that the storage device is ready and the available space meets the storage requirements for collected traffic data packets, use solid-state drives (SSDs) for storage, or map the memory to a high-speed I / O storage medium of the file system to store traffic data packet collection files, to avoid loss of buffer data due to untimely writes due to low disk I / O speed, and prepare for traffic data packet storage.

[0056] Users can set up traffic replay services through the test platform management terminal. The replay service initiates traffic collection tasks for the production environment of the connected target business system. The collection agent where the target business system is located in the production environment accepts the collection task and calls the traffic data packet collection tool on the server to collect data, generate offline traffic files, and push the offline traffic files to the corresponding file storage path after the specified collection cycle ends, completing the traffic data packet collection in the production environment.

[0057] When collecting data, factors such as performance, security, and privacy need to be considered. Filters are set to capture HTTP requests and responses for specific services. The collected information includes the HTTP request start timestamp, the original IP address and port number of the transport layer, the target IP address and port number, the application layer request type, request header, request body, and other network traffic information. To ensure the completeness of HTTP request traffic data packet collection, machine learning algorithms are used to obtain the optimal parameters for collecting traffic data packets, including whether HTTP protocol filtering is configured, whether only HTTP requests are collected, the length of time it takes to collect data, whether service port ownership is limited during collection, and whether high-speed storage devices are used.

[0058] Based on the collection completeness of traffic data packets corresponding to different parameter combinations, the parameter combination with the highest collection completeness is determined as the optimal parameter value. Collecting traffic data packets from the target business system's production environment based on the optimal parameter combination can reduce packet loss. The high collection completeness of traffic data packets allows high-integrity, high-quality test traffic to be input to the modified target business system during subsequent traffic playback. This avoids incomplete collection data that could result in performance test results for the modified target business system not reflecting the system's true performance, thereby providing accurate and effective performance test results.

[0059] Specifically, the collection completeness of the traffic data packets corresponding to the HTTP requests based on different parameter combinations determines the optimal parameter combination for collecting the traffic data packets, including: using the data sets including different parameter combinations and corresponding collection completeness as samples to input a preset probability proxy function; taking the objective function as the optimal solution to achieve the highest collection completeness, and determining the optimal parameter combination in the parameter space of the probability proxy function.

[0060] Considering the correlation between the parameters used for traffic data packet collection, and the uncertainty of the impact of different parameters on the traffic data packet collection results and resource occupancy, as well as the objective situation of the number of parameters and the complexity of calculation, combined with Figure 2 A Gaussian process is selected as the probabilistic proxy function 20. The region in the parameter space of this probabilistic proxy function 20 is found, and within this region, configuration points are selected that are conducive to optimizing the optimal range of acquisition parameters. Actual traffic data packet collection tests are conducted to verify and evaluate the collection completeness and resource consumption under the specified parameter combination, and the new data points and results 40 are updated to the dataset 10. After obtaining the objective function 30, continuous iterative optimization is performed based on the new dataset 10 to obtain the optimal value of the parameter combination. This method can significantly improve the collection completeness from 95% to over 99.9%.

[0061] In addition to collecting traffic packets for HTTP requests and their corresponding responses, the system also collects the corresponding monitoring data. Specifically, it collects performance monitoring data from the target business system's production environment for a preset period of time for subsequent comparative analysis with monitoring data during playback. Based on the characteristics of the collection target, data collection formats are customized to collect monitoring data for specific applications or components.

[0062] The replay service directly accesses the performance monitoring system database to query the production environment performance data during the collection period of the collection system, including the CPU performance, memory usage, database TPS, number of active sessions, number of active threads, top 10 slow SQL statements, etc. of the hosts where the application and database are located, and records them in the replay service database to prepare for the subsequent output of the performance comparison analysis report.

[0063] At the same time, application logs are also collected, specifically logs of the target business system production environment during a preset period of time, including request logs, exception logs, middleware logs and other information, to prepare for performance analysis and comparison after playback.

[0064] In one embodiment, if the captured traffic data packets are saved in PCAP format using a collection tool, only a single playback tool is supported. If the PCAP format is converted to an HTTP request file format for traffic playback, the HTTP request body may be lost.

[0065] In this regard, after collecting the HTTP requests and the responses, performance monitoring data and logs corresponding to the HTTP requests when the target business system executes the target business in the production environment, it also includes: parsing the collected HTTP requests from the data link layer protocol to the HTTP application layer protocol; storing the request header and request body of the parsed HTTP request in the target database in a separate storage manner, and recording the timestamp and the sequence order of the HTTP request.

[0066] The PCAP file parsing program is called to parse the collected offline traffic files into PCAP packets. The PCAP is parsed layer by layer from the data link layer protocol to the HTTP application layer protocol layer, and stored in the database in the form of request headers and request bodies, and basic request information is recorded, including timestamps, and the order of the sequence before and after the request. This method allows for more convenient and flexible data analysis without the need to manage large files separately, significantly improving the applicability of the playback tool. During playback, the request parameters can be dynamically adjusted based on the stored HTTP request information during reading, greatly improving the flexibility of playback and resolving playback issues caused by parameter differences between different environments. Traffic data from multiple collection periods can be used continuously, ensuring both playback simulation and operational convenience.

[0067] Step 104: replay traffic of the modified target business system in a test environment based on the HTTP request.

[0068] Traffic replay of the modified application system is performed in a test environment. After all data has been collected and stored, the replay time is determined and traffic replay is performed in the test environment. The replay service calls the agent on the server where the target business system resides, loads the replay policy, the replay traffic input source, the replay target service, sets the replay time, and starts the traffic replay at the specified time.

[0069] In order to better verify the performance of the target business application system after the transformation, two playback strategies are proposed in the embodiment of this application. Based on the original traffic of the production environment, multiple playback is performed to increase the pressure of the service in the test environment, and the processing capacity of the service under higher concurrency is verified through real user requests. This provides strong support and verification for evaluating the performance of the target business system after the transformation, whether the server configuration meets the needs, and the system processing capacity under high concurrency.

[0070] In one embodiment, optionally, the traffic replay of the transformed target business system in a test environment based on the HTTP request includes: obtaining an original replay traffic source including each collected HTTP request; determining an original time interval corresponding to each HTTP request in the original replay traffic source; simultaneously starting multiple independent service processes to load the original replay traffic source respectively; and replaying each HTTP request in the replay traffic source to the transformed target business system according to the corresponding original time interval through the multiple independent service processes.

[0071] In this embodiment, traffic replay is to increase the number of HTTP requests during playback, that is, while the playback time and request frequency of a single playback service remain unchanged, the number of playback services is increased, and the number can be configured. For example, if n is configured, n times of playback will be performed, and the same original playback traffic source, that is, each HTTP request collected in a production environment, will be loaded through n times of services on the basis of the original 1:1.

[0072] Configure the multiplier value: The default is no multiplier playback, that is, 1:1 playback. In this case, the playback service loads a copy of the original playback traffic source.

[0073] Combine Figure 3 , described by configuring the playback magnification to be 2 times.

[0074] When the replay multiplier is set to 2, after loading the traffic source of original HTTP requests collected in the production environment, the original time intervals corresponding to each HTTP request are preserved. Specifically, HTTP request req1 is issued at time node T1, HTTP request req2 at time node T2, HTTP request req3 at time node T3, HTTP request req4 at time node T4, and so on. The number of original HTTP requests in the traffic source input for traffic replay remains unchanged. Then, two replay service processes are launched according to the replay multiplier. Replay service process process 1 processes a request sequence corresponding to the original replay traffic source, while replay service process process 2 is added to process a copy of the original request sequence. In this copy, each HTTP request in the request sequence corresponds to the original time interval. Both replay service processes process 1 and process 2 point to the modified target business system in the same test environment. This double-multiple replay allows the cumulative number of requests to be doubled while maintaining the same replay time and request frequency.

[0075] The two playback service processes, process1 and process2, are independent of each other. HTTP-related session, token, and other authentication parameters are independent of each other, ensuring session isolation between different playback service processes. Sessions within the same playback service process are conducted in an orderly time series, avoiding business logic problems caused by repeated multiple requests under the same transaction.

[0076] After the test environment is modified, when the target business system receives multiple HTTP requests initiated by the playback service, it will establish transaction scopes for logical processing based on the session and token status of the HTTP requests.

[0077] The playback service will dynamically create an appropriate number of playback service processes based on the configured multiple playback times. Optionally, based on the configuration requirements of the modified target business system when performing traffic playback, the multiple independent service threads are allocated to the same node or different nodes of the target business system.

[0078] When a host does not meet the number of playback service processes, it automatically increases the number of processes on other nodes to ensure that the playback service meets the configuration requirements.

[0079] By configuring the replay multiple separately, you can increase the number of replay services while replaying traffic to the transformed target business system in a test environment, while maintaining the same single replay service, replay time, and request frequency. The replay service dynamically creates the appropriate number of processes based on the configured replay multiple. Compared to traditional concurrency, this avoids transaction discontinuities, better simulates high concurrency using real user requests, and accurately identifies performance bottlenecks in the transformed target business system.

[0080] In another embodiment, optionally, the traffic replay of the transformed target business system in a test environment based on the HTTP request includes: obtaining an original replay traffic source including the collected HTTP requests; determining the original time interval corresponding to each HTTP request in the original replay traffic source; starting a single service process to load the original replay traffic source; and shortening each HTTP request in the replay traffic source by a predetermined multiple in proportion to the corresponding original time interval through the single service process, and then replaying it to the transformed target business system.

[0081] In this embodiment, traffic replay is to reduce the time interval between two requests during replay, that is, to increase the density of replay requests per unit time by doubling the frequency while keeping the total number of requests unchanged.

[0082] The multiplier value is configurable. For example, if you configure n, the time interval between two consecutive HTTP requests will be proportionally shortened by n times the playback interval. This increases the number of playback requests per unit time by n times, reducing the overall playback time to 1 / n of the original. Speed ​​playback cannot be increased indefinitely; that is, the multiplier value cannot be too large, for example, no more than 5, otherwise the playback effect cannot be accurately guaranteed at the time granularity.

[0083] Configure the multiplier value: By default, the time interval is not scaled proportionally, that is, 1:1 speed playback. After the playback service reads the original playback traffic source, it loads a copy of the original playback traffic source including each collected HTTP request at the original time interval.

[0084] Combine Figure 4 , described by configuring the multiplier value to be 2.

[0085] When the multiplier value is 2, after loading the original HTTP request traffic source collected in the production environment, the time intervals of multiple HTTP requests, such as req1, req2, etc., are calculated. The playback interval is proportionally shortened by 2 times according to the configured multiplier value, thereby increasing the number of playback requests per unit time by 2 times. For example, in the loaded original playback traffic source, there are four HTTP requests, req1-req4, between time nodes T1 and T4. If the multiplier value is 2 to shorten the playback interval, there will be eight HTTP requests, req1-req8, between time nodes T1 and T4. The overall playback time is now reduced to half.

[0086] By individually configuring the playback multiplier value for traffic replay in the test environment, you can reduce the time interval between HTTP requests during playback of traffic for the modified target business system. This means that while the total number of requests remains constant, the playback request density per unit time is increased by multiplying the frequency. This significantly reduces playback time, without compromising the integrity and orderly playback of traffic. This not only shortens overall testing time and improves test efficiency, but also increases server concurrency and stress, allowing for more efficient verification of the service processing capabilities of the modified target business system under high concurrency.

[0087] Step 106: Collect responses, performance monitoring data, and logs corresponding to HTTP requests during traffic playback.

[0088] When inputting the collected HTTP requests into the transformed target business system and performing traffic replay, the test environment performance monitoring data and application logs corresponding to the replayed traffic are collected synchronously, and the data is centrally stored according to the standards for collecting data in the production environment, in preparation for performance analysis after completing the traffic replay.

[0089] Step 108: Analyze the responses, performance monitoring data, and logs generated based on HTTP requests in the production environment, and the responses, performance monitoring data, and logs generated based on HTTP requests in the test environment to obtain performance test results of the target business system after transformation.

[0090] After the traffic replay is completed, by comparing the traffic data packets collected in the production environment before the target business system transformation with the traffic data packets collected in the test environment after the target business system transformation, the performance of the target business system after the transformation can be analyzed.

[0091] Specifically, the responses, performance monitoring data and logs generated based on HTTP requests in the production environment, and the responses, performance monitoring data and logs generated based on HTTP requests in the test environment are analyzed accordingly to obtain the performance test results of the target business system after the transformation, including: comparing the responses generated by HTTP requests in the production environment and the responses generated by HTTP requests in the test environment to determine the time consumed by the same HTTP request in the production environment and the test environment; comparing the application performance data generated by HTTP requests in the production environment and the application performance data generated by HTTP requests in the test environment to determine the application performance of the target business system after the transformation; comparing the database performance data generated by HTTP requests in the production environment and the database performance data generated by HTTP requests in the test environment to determine the database performance of the target business system after the transformation; comparing the logs generated by HTTP requests in the production environment and the logs including log exceptions, middleware logs, request time and response status codes generated by HTTP requests in the test environment to determine the operating status of the target business system after the transformation; obtaining the performance test results of the target business system after the transformation based on a combination of one or more of the time consumption, application performance, database performance and operating status.

[0092] Compare the original application performance data and database performance data of the target business system before the transformation with the application performance data and database performance data of the test environment during playback, as well as log abnormalities, request duration, response status code and other information in the middleware log during the comparison period, confirm the application service operation status of the business system in the test environment, obtain the performance test results of the target business system after the transformation, and output the traffic replay report.

[0093] This report provides the application service operation status, performance, performance bottlenecks under high concurrency conditions, and whether the current server configuration meets business requirements after the target business system completes adaptation and transformation, thereby providing strong support for performance optimization and resource allocation.

[0094] Next, combine Figure 5 , the performance testing method of the business system of the embodiment of the present application is generally described as follows: Figure 5 The following steps are shown:

[0095] Step 202: Prepare for playback, deploy traffic collection tools, and ensure that the target business system has been included in performance monitoring.

[0096] Step 204: Collect HTTP requests of the target business system during the peak business period (T1-T2) of the production environment, and collect performance monitoring data, application logs and other information during this period;

[0097] Step 206: Store the collected traffic data packets in a database, parse the collected PCAP data packet files into HTTP request information, and store them in an ES database;

[0098] Step 208: replay traffic during the T3-T4 period in the test environment and collect performance monitoring data, application logs, and other information during this period;

[0099] Step 210, by comparing and analyzing the data collected in step 204 and step 208, outputs a traffic replay report, which provides an analysis and comparison of the application service operation status, performance status, performance bottlenecks under high concurrency conditions, and whether the server configuration resources meet the needs after the target business system completes the adaptation and transformation.

[0100] In an embodiment of the present application, by collecting HTTP requests and responses, performance monitoring data and logs generated by the target business system when executing the target business in the production environment; replaying the traffic of the modified target business system in the test environment based on the HTTP requests; collecting responses, performance monitoring data and logs generated by the HTTP requests in the traffic playback process; analyzing the responses, performance monitoring data and logs generated based on the HTTP requests in the production environment, and the responses, performance monitoring data and logs generated based on the HTTP requests in the test environment to obtain the performance test results of the modified target business system, thereby capturing the traffic data packets of the production environment without affecting the normal operation of the business system, using the real access requests of users in the production environment to realize automated testing of the modified business system, simulating the production environment load in the test environment, reducing a lot of manual testing costs, greatly improving testing efficiency and test accuracy, effectively and accurately discovering the performance bottlenecks of the target business system after the transformation and whether the server resource configuration meets business needs, and providing accurate guidance for the target business system to adapt to the performance optimization and resource configuration after the transformation.

[0101] Alternatively, as Figure 6 As shown, an embodiment of the present application also provides a performance testing device 2000 for a business system, including a processor 2400 and a memory 2200. The memory 2200 stores programs or instructions that can be run on the processor 2400. When the program or instruction is executed by the processor 2400, the various steps of the performance testing method embodiment of the above-mentioned business system are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0102] The present application also provides a readable storage medium, which stores a program or instruction. When the program or instruction is executed by a processor, each process of any of the above-mentioned performance testing method embodiments of the business system is implemented, and the same technical effect is achieved. To avoid repetition, it is not described here. The readable storage medium includes a computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0103] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. The computer program can be operated to enable a computer to implement the various processes of any of the above-mentioned performance testing method embodiments of a business system when executed, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0104] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0106] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A performance testing method for a business system, characterized in that: include: Collect HTTP requests and responses, performance monitoring data and logs generated by the target business system when executing the target business in the production environment; Based on the HTTP request, traffic playback is performed on the modified target business system in a test environment; Collect responses, performance monitoring data, and logs generated by HTTP requests during traffic playback; The responses, performance monitoring data and logs generated based on HTTP requests in the production environment, as well as the responses, performance monitoring data and logs generated based on HTTP requests in the test environment are analyzed to obtain the performance test results of the modified target business system.

2. The method according to claim 1, characterized in that The HTTP request of the target business system when executing the target business in the production environment includes: Based on the collection completeness of the traffic data packets of the HTTP requests corresponding to different parameter combinations, determine the optimal parameter combination for collecting the traffic data packets, the parameter combination including one or more of whether to configure HTTP protocol filtering, whether to collect only HTTP requests, the length of time it takes to collect, whether to limit the service port ownership during collection, and whether to use a high-speed storage device; Based on the optimal parameter combination, traffic data packets of HTTP requests of the target business system when executing the target business in the production environment during the business peak period are collected.

3. The method according to claim 2, characterized in that The method of determining the optimal parameter combination for collecting the traffic data packets based on the collection completeness of the traffic data packets of the HTTP requests corresponding to different parameter combinations includes: A data set including different parameter combinations and corresponding acquisition completeness is used as a sample input into a preset probability proxy function; Taking the objective function as the optimal solution to achieve the highest collection completeness, the optimal parameter combination is determined in the parameter space of the probability proxy function.

4. The method according to claim 1, characterized in that: After collecting the HTTP request and the response, performance monitoring data and log generated by the HTTP request when the target business system executes the target business in the production environment, it also includes: Parse the collected HTTP requests from the data link layer protocol to the HTTP application layer protocol; The request header and request body of the parsed HTTP request are stored separately in the target database, and the timestamp and the sequence order of the HTTP request are recorded.

5. The method according to claim 1, characterized in that The replaying the traffic of the modified target business system in the test environment based on the HTTP request includes: Obtain the original playback traffic source including each collected HTTP request; Determine the original time interval corresponding to each HTTP request in the original playback traffic source; Simultaneously start multiple independent service processes to load the original playback traffic source respectively; Each HTTP request in the playback traffic source is played back to the transformed target business system according to the corresponding original time interval through the multiple independent service processes.

6. The method according to claim 5, characterized in that Based on the configuration requirements of the modified target business system when performing traffic playback, the multiple independent service threads are allocated to the same node or different nodes of the target business system.

7. The method according to claim 1, characterized in that The replaying the traffic of the modified target business system in the test environment based on the HTTP request includes: Obtain the original playback traffic source including each collected HTTP request; Determine the original time interval corresponding to each HTTP request in the original playback traffic source; Starting a single service process to load the original playback traffic source; After each HTTP request in the playback traffic source is shortened by a predetermined multiple in proportion to the corresponding original time interval by the single service process, it is played back to the transformed target business system.

8. The method according to claim 1, characterized in that The responses, performance monitoring data and logs generated based on HTTP requests in the production environment and the responses, performance monitoring data and logs generated based on HTTP requests in the test environment are analyzed accordingly to obtain the performance test results of the target business system after the transformation, including: Compare the response generated by the HTTP request in the production environment with the response generated by the HTTP request in the test environment to determine the time consumed by the same HTTP request in the production environment and in the test environment; Compare the application performance data generated by the HTTP request in the production environment with the application performance data generated by the HTTP request in the test environment to determine the application performance of the target business system after the transformation; Compare the database performance data generated by the HTTP request in the production environment with the database performance data generated by the HTTP request in the test environment to determine the database performance of the target business system after the transformation; Compare the logs generated by HTTP requests in the production environment with the logs generated by HTTP requests in the test environment, including log exceptions, request duration of middleware logs, and response status codes, to determine the operating status of the target business system after the transformation; Based on a combination of one or more of the time consumption, application performance, database performance and operating status, a performance test result of the target business system after transformation is obtained.

9. A performance testing device for a business system, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 8 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Method and device for determining performance bottleneck index of system and electronic equipment

    CN120407356A