[go: up one dir, main page]

CN119135558A - Performance testing method and device for business system, and readable storage medium - Google Patents

Performance testing method and device for business system, and readable storage medium Download PDF

Info

Publication number
CN119135558A
CN119135558A CN202411141070.9A CN202411141070A CN119135558A CN 119135558 A CN119135558 A CN 119135558A CN 202411141070 A CN202411141070 A CN 202411141070A CN 119135558 A CN119135558 A CN 119135558A
Authority
CN
China
Prior art keywords
http request
target service
playback
service system
performance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411141070.9A
Other languages
Chinese (zh)
Inventor
杨行波
张子浪
王梦媛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Tower Co Ltd
Original Assignee
China Tower Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Tower Co Ltd filed Critical China Tower Co Ltd
Priority to CN202411141070.9A priority Critical patent/CN119135558A/en
Publication of CN119135558A publication Critical patent/CN119135558A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/04Processing captured monitoring data, e.g. for logfile generation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a performance test method and device of a service system and a readable storage medium, wherein the performance test method and device comprises the steps of collecting HTTP requests and responses, performance monitoring data and logs generated by the HTTP requests when a target service system executes target service in a production environment, carrying out flow playback on the target service system after transformation based on the HTTP requests in a test environment, collecting responses, performance monitoring data and logs generated by the HTTP requests in a flow playback process, and analyzing the responses, the performance monitoring data and the logs generated by the HTTP requests in the production environment and the responses, the performance monitoring data and the logs generated by the HTTP requests in the test environment to obtain performance test results of the target service system after transformation.

Description

Performance test method and device of business system and readable storage medium
Technical Field
The present application relates to the field of testing technologies, and in particular, to a performance testing method and apparatus for a service system, and a readable storage medium.
Background
The business system can provide Web services based on requests initiated by users, and when software and hardware devices such as a host, a server and/or a database are replaced in the business system, the running environment is changed. It is necessary to verify whether the corresponding service under the new service system architecture can be normally operated. That is, after the service system is adapted, performance test is required to be performed to ensure that the use of the user is not affected, and when performance test is performed, the test is directly performed in a production environment, that is, an actual running environment for providing real service for the user, so that risks such as network blocking and no response to requests may be brought to the user.
Therefore, a safe and reliable manner is needed to simulate the production environment to accurately and effectively test the performance of the modified service system.
Disclosure of Invention
The embodiment of the application aims to provide a performance test method and device of a service system and a readable storage medium, which are used for solving the problem of low safety and reliability of the performance test of the existing service system.
In order to solve the technical problems, the present specification is implemented as follows:
In a first aspect, a performance testing method of a service system is provided, including:
Collecting response, performance monitoring data and logs generated by HTTP requests and HTTP requests when the target service system executes the target service in the production environment;
Performing flow playback on the modified target service system under a test environment based on the HTTP request;
collecting response, performance monitoring data and logs generated correspondingly by HTTP requests 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 target service system after modification.
Optionally, the collecting the HTTP request of the target service system when executing the target service in the production environment includes:
determining an optimal parameter combination used for acquiring the flow data packet based on the acquisition integrity of the flow data packet of the HTTP request corresponding to different parameter combinations, wherein the parameter combination comprises one or more of whether HTTP protocol filtering is configured, whether only HTTP request is acquired, whether the acquisition time is long, whether the attribution of a service port is limited during acquisition, and whether a high-speed storage device is adopted;
And collecting flow data packets of HTTP requests when the target service system executes the target service in the production environment in the service peak period based on the optimal parameter combination.
Optionally, the determining, based on the collection integrity of the traffic data packet of the HTTP request corresponding to the different parameter combinations, the optimal parameter combination for collecting the traffic data packet includes:
inputting a data set comprising different parameter combinations and corresponding acquisition integrity as a sample into a preset probability proxy function;
And taking the objective function as an optimal solution with the highest acquisition integrity, and determining the optimal parameter combination in a parameter space of the probability proxy function.
Optionally, after the collecting the response, the performance monitoring data and the log generated by the HTTP request and the HTTP request when the target service system executes the target service in the production environment, the method further includes:
Analyzing the acquired HTTP request from the data link layer protocol to an HTTP application layer protocol;
The request header and the request body of the HTTP request after analysis are stored in a target database in a mode of being respectively stored, and the time stamp and the sequence order of the HTTP request are recorded.
Optionally, the performing the flow playback on the modified target service system in the test environment based on the HTTP request includes:
acquiring an original playback flow source comprising each acquired HTTP request;
determining an original time interval corresponding to each HTTP request in the original playback flow source;
Simultaneously starting a plurality of independent service processes to load the original playback flow sources respectively;
And playing back each HTTP request in the playback flow source to the modified target service system according to the corresponding original time interval through the plurality of independent service processes.
Optionally, the multiple independent service threads are distributed at the same node or different nodes of the target service system based on the configuration requirement of the modified target service system when performing traffic playback.
Optionally, the performing the flow playback on the modified target service system in the test environment based on the HTTP request includes:
acquiring an original playback flow source comprising each acquired HTTP request;
determining an original time interval corresponding to each HTTP request in the original playback flow source;
starting a single service process to load the original playback traffic source;
And shortening each HTTP request in the playback flow source by a preset multiple in equal proportion according to the corresponding original time interval through the single service process, and playing back the HTTP request to the modified target service system.
Optionally, the 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 correspondingly to obtain the performance test result of the target service system after modification includes:
comparing the response generated by the HTTP request under the production environment with the response generated by the HTTP request under the test environment to determine the time consumption of the same HTTP request under the production environment and the test environment;
Comparing the application performance data generated by the HTTP request under the production environment with the application performance data generated by the HTTP request under the test environment to determine the application performance of the target service system after modification;
Comparing the database performance data generated by the HTTP request under the production environment with the database performance data generated by the HTTP request under the test environment to determine the database performance of the target service system after modification;
Comparing the log generated by the HTTP request in the production environment with the log comprising log abnormality, request time consumption of the middleware log and response state code generated by the HTTP request in the test environment to determine the running state of the target service system after modification;
And obtaining a performance test result of the target service system after modification based on the combination of one or more of the time consumption, the application performance, the database performance and the running state.
In a second aspect, there is provided a performance testing apparatus for a business system comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method as described in the first aspect.
In a third aspect, there is provided a readable storage medium having stored thereon a program or instructions which when executed by a processor implement the steps of the method according to the first aspect.
In the embodiment of the application, the response, performance monitoring data and log generated by HTTP request and HTTP request corresponding to target service are acquired when the target service system executes the target service in the production environment, the flow playback is carried out on the modified target service system in the test environment based on the HTTP request, the response, performance monitoring data and log generated by HTTP request corresponding to the HTTP request in the flow playback process are acquired, the response, performance monitoring data and log generated based on HTTP request in the production environment and the response, performance monitoring data and log generated based on HTTP request in the test environment are analyzed to obtain the performance test result of the modified target service system, so that the flow data packet of the production environment can be captured under the condition that the normal operation of the service system is not influenced, the automatic test of the service system after modification is realized by using the real access request of a user in the production environment, the load of the production environment is simulated in the test environment, the test environment is reduced, the test efficiency and the test accuracy are greatly improved, whether the performance bottleneck of the target service system after modification and the server resource configuration meet the service requirement or not is effectively and accurately found, and the performance guidance resource is provided for the target service system after the adaptation and the accurate configuration.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a flow chart of a performance testing method of a service system according to an embodiment of the present application.
FIG. 2 is a schematic diagram of a machine learning algorithm for determining an optimal parameter combination according to an embodiment of the present application.
Fig. 3 is a flow chart for playback of traffic in accordance with a first embodiment of the present application.
Fig. 4 is a flow chart for playback of traffic according to a second embodiment of the present application.
Fig. 5 is a flowchart of an overall example of a performance testing method of a service system according to an embodiment of the present application.
Fig. 6 is a block diagram showing the structure of a performance test apparatus of a service system according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application. The reference numerals in the present application are only used for distinguishing the steps in the scheme, and are not used for limiting the execution sequence of the steps, and the specific execution sequence controls the description in the specification.
In order to solve the problems in the prior art, an embodiment of the present application provides a performance testing method of a service system, as shown in fig. 1, including the following steps 102 to 108.
Step 102, collecting HTTP requests and responses, performance monitoring data and logs generated by the HTTP requests when the target service system executes the target service in the production environment.
The production environment is an actual operation environment for providing real service for users when the performance of the target service system is normal, and the test environment is a test operation environment for simulating the service provided for the users after the target service system is subjected to adaptation and transformation.
Before performance test of the target service system after modification is performed, traffic data packets of HTTP requests generated during normal operation, namely HTTP requests of users for target services, which are received by the target service system, are acquired from a production environment of the target service system before modification, and responses, performance monitoring data and logs generated corresponding to the HTTP requests are acquired, wherein the HTTP requests for the target services comprise a plurality of HTTP requests, such as login requests, search requests, traffic requests and the like, of different users for the target services within a preset time period.
Here, the target service system running in the production environment generally has no performance problem, but when collecting the traffic data packet of the HTTP request correspondingly generated by the target service system, there may be packet loss, which causes a problem of incomplete data collected towards the application layer.
In order to improve the integrity of the collected flow data packets of the HTTP request, optionally, the system for collecting the HTTP request when the target service system executes the target service in the production environment comprises determining an optimal parameter combination for collecting the flow data packets based on the collection integrity of the flow data packets of the HTTP request corresponding to different parameter combinations, wherein the parameter combination comprises one or more of the steps of HTTP protocol filtering, HTTP request collecting only, long collecting time consumption, service port attribution limiting during collecting and high-speed storage device adoption, and collecting the flow data packets of the HTTP request when the target service system executes the target service in the production environment in the service peak period based on the optimal parameter combination.
When collecting flow data packets, setting the collection time node at a peak period corresponding to the service operation of the target service system. The HTTP request access amount of the corresponding time period of the service peak period is more, the flow data packet which needs to be stored during collection is also larger, and the access amount is also one of factors influencing the integrity of the collected flow data packet. Therefore, the flow data packet of the service peak period is collected, and the performance of the target service system after modification can be better evaluated during testing.
Before the acquisition of the flow data packet of the production environment of the target service system is carried out, the following preparation work is needed to be carried out, namely the production environment and the test environment of the target service system after modification to be tested are brought into a related performance monitoring system, the monitoring system is ensured to normally acquire server performance data of the target service system after modification, the number of service nodes where the production environment and the test environment of the target service system are located is confirmed, all service nodes are ensured to be provided with flow data packet acquisition tools and can normally operate, server network card information, application log path information and the like of all the service nodes are collected, the storage equipment is ensured to be ready, available space meets the storage requirement of the acquired flow data packet, a Solid State Disk (SSD) is used for storage, or a memory is mapped into a high-speed I/O storage medium of a file system for storing flow data packet acquisition file, so that the data written in a buffer area is not timely and is lost due to the fact that the I/O speed of a disk is too low, and preparation is made for storing the flow data packet.
The user can set flow playback service through the test platform management end, the playback service initiates a flow collection task under the production environment of the accessed target service system, the collection agent where the target service system is located under the production environment accepts the collection task, the server calls a flow data packet collection tool to collect the flow data packet, an offline flow file is generated, and the offline flow file is pushed to a corresponding file storage path after a specified collection period is finished, so that flow data packet collection of the production environment is completed.
Performance, security, privacy, and other factors need to be considered in acquisition. HTTP requests and responses for specific traffic are captured by setting filters. The collection information comprises HTTP request start time stamp, original IP of transmission layer, original port, target IP, target port, request type of application layer, request head, request body and other network flow information. In order to ensure the integrity of the collection of the HTTP request flow data packet, parameters when the flow data packet is collected are obtained through a machine learning algorithm, wherein the parameters comprise optimal values of whether HTTP protocol filtering is configured, whether the HTTP request is only collected, the collection time is long, whether the service port attribution is limited during collection, whether high-speed storage equipment is adopted or not, and the like.
And determining the parameter combination corresponding to the highest acquisition integrity as a parameter optimal value based on the acquisition integrity of the flow data packet corresponding to the different parameter combinations. The method has the advantages that the flow data packet of the production environment of the target service system is collected based on the optimal parameter combination, the packet loss condition of the collected flow data packet can be reduced, the collection integrity of the flow data packet is high, and when the flow data packet is used for subsequent flow playback, high-quality test flow with high integrity can be input into the target service system after transformation, so that the situation that the performance test result of the target service system after transformation cannot reflect the real performance of the system due to incomplete collection data is avoided, and therefore an accurate and effective performance test result is provided.
The method comprises the steps of inputting a data set comprising different parameter combinations and corresponding acquisition integrity as a sample into a preset probability proxy function, and determining the optimal parameter combination in a parameter space of the probability proxy function by using an objective function as an optimal solution for achieving the highest acquisition integrity.
Considering that there is an association relationship between parameters for collecting the flow data packet, and the influence of different parameters on the collection result of the flow data packet and the occupation of resources is uncertain, and the objective condition of the number of parameters and the complexity of calculation, in combination with fig. 2, a Gaussian Process (Gaussian Process) is selected as a probability proxy function 20, a region most likely to cover an optimal solution is found in a parameter space of the probability proxy function 20, and a configuration point which is favorable for optimizing the optimal value range of the collection parameters is selected in the region range. And through actual flow packet acquisition testing, verify and evaluate acquisition integrity and resource consumption under specified parameter combinations, and update new data points and results 40 to the data set 10. After the objective function 30 is obtained, the optimal values of the parameter combinations are obtained based on the new dataset 10, continuously iteratively optimized. By the method, the acquisition integrity can be improved from 95% to more than 99.9%, and the acquisition integrity is greatly improved.
Besides collecting HTTP request and flow data packet of response generated by HTTP request, collecting monitoring data generated correspondingly. Specifically, performance monitoring data of a preset period of the production environment of the target service system are collected and used for comparing and analyzing the monitoring data in the subsequent playback process. The data collection format criteria are customized based on the characteristics of the collection target to collect monitoring data for a given application or component.
The playback service directly accesses the performance monitoring system database, inquires production environment performance data in the acquisition period of the acquisition system, including CPU performance, memory occupation, TPS, active session number, active thread number, top10 slow SQL and the like of the host computer where the application and the database are located, and records the data in the playback service database so as to prepare a subsequent output performance comparison analysis report.
Meanwhile, an application log is also collected, specifically, a log of a preset period of the production environment of the target service system is collected, and information such as a request log, an abnormal log and a middleware log is collected to prepare for performance analysis and comparison after playback is completed.
In one embodiment, if the collection tool used is in PCAP format while maintaining the collected traffic packets, the supported playback tool is single. If the PCAP format is converted to the HTTP request file format for the streaming playback, there may be a case where the HTTP request body is lost.
After the HTTP request and the response, performance monitoring data and log generated by the HTTP request when the target service is executed in the production environment are acquired, the system further comprises the steps of analyzing the acquired HTTP request from a data link layer protocol to an HTTP application layer protocol, storing the request header and the request body of the analyzed HTTP request in a target database in a way of being respectively stored, and recording the time stamp and the front-back sequence of the HTTP request.
Calling a PCAP file analysis program, carrying out PCAP data packet analysis on the acquired offline flow file, analyzing PCAP layer by layer from a data link layer protocol to an HTTP application layer protocol layer, storing the PCAP into a database in a mode of respectively storing a request header and a request body, and recording request basic information, wherein the request basic information comprises a time stamp, a sequence before and after the request and the like. By the method, the data can be analyzed more conveniently and flexibly, large files do not need to be managed independently, and the application range of playback tools is remarkably improved. The method has the advantages that the request parameters can be dynamically adjusted during playback according to stored HTTP request information, the playback flexibility is greatly improved, the playback problem caused by parameter differences among different environments is solved, the flow data of a plurality of acquisition periods can be continuously used, the playback simulation degree can be ensured, and the operation convenience can be improved.
And 104, performing flow playback on the modified target service system in a test environment based on the HTTP request.
And carrying out flow playback of the application system after transformation in the test environment, confirming a playback time node after all data are acquired and stored in a warehouse, and carrying out flow playback in the test environment. The playback service loads the playback strategy, the playback flow input source and the playback target service by calling the agent on the server of the target service system, sets the playback time node and starts the flow playback at the appointed time.
In order to better verify the performance condition of the target service application system after transformation after adaptation, two playback strategies are provided in the embodiment of the application, the service pressure in the test environment is improved by multiple playback based on the original flow of the production environment, and the processing capacity of the service under higher concurrency is verified through the request of a real user, so that powerful support and verification are provided for evaluating whether the performance of the target service system after transformation and the server configuration meet the requirements and the processing capacity of the system under high concurrency.
In one embodiment, optionally, the performing flow playback on the modified target service system under the test environment based on the HTTP requests includes obtaining an original playback flow source including collected HTTP requests, determining an original time interval corresponding to each HTTP request in the original playback flow source, simultaneously starting a plurality of independent service processes to load the original playback flow source respectively, and playing back each HTTP request in the playback flow source to the modified target service system according to the corresponding original time interval through the plurality of independent service processes.
In this embodiment, the traffic playback is to increase the number of HTTP requests at the time of playback, that is, increase the number of playback services in the case where the single playback service playback time and the request frequency are unchanged, and the number may be configured, for example, n is configured, that is, n times playback is performed, and the same original playback traffic source, that is, each HTTP request collected in the production environment, is loaded through n times of services on the basis of the original 1:1.
And (3) configuring a multiple value, namely defaulting to not perform multiple playback, namely 1:1 playback, wherein the playback service loads an original playback flow source.
The description is made with reference to fig. 3 with a configuration playback multiple of 2.
When the playback multiple is 2, after loading the traffic source of the original HTTP request collected in the production environment, on the premise of retaining the original time interval corresponding to each HTTP request, that is, the original collected HTTP request req1 is correspondingly sent out at the time node T1, the HTTP request req2 is correspondingly sent out at the time node T2, the HTTP request req3 is correspondingly sent out at the time node T3, the HTTP request req4 is correspondingly sent out at the time node T4. The number of times of inputting each original HTTP request in a traffic source for traffic playback is kept unchanged, and then 2 playback service processes are started according to playback multiples, namely, one playback service process2 is added to process copy (copy) copies of the original request sequence on the basis that the playback service process1 processes a corresponding request sequence of the original playback traffic source, and each HTTP request in the request sequence in the copy copies corresponds to an original time interval. The two playback service processes process1 and the playback service process2 point to the modified target business system in the same test environment. Thus, after 2 times of playback is performed, the number of times of requests can be doubled under the condition that the playback time and the request frequency are unchanged.
The two playback service processes process1 and process2 are independent of each other, and identity authentication parameters such as Session (Session) related to HTTP, token (Token) and the like are independent of each other, so that Session isolation among different playback service processes is ensured, the Session in the same playback service process is orderly carried out according to a time sequence, and the problem of business logic caused by repeated execution of a plurality of requests under the same transaction is avoided.
When the target service system receives a plurality of HTTP requests initiated by the playback service after the transformation of the test environment, the transaction ranges are respectively established for logic processing according to session, token conditions of the HTTP requests.
The playback service dynamically creates a proper number of playback service processes according to the configured multiple playback times. Optionally, the multiple independent service threads are distributed at the same node or different nodes of the target service system based on the configuration requirement of the modified target service system when performing traffic playback.
When one host computer does not meet the number of the playback service processes, the number of the processes of other nodes is automatically pulled up, and the playback service is ensured to meet the configuration requirement.
By the flow playback mode of the independent configuration playback multiple, when the test environment performs flow playback on the target service system after modification, the number of playback services can be increased under the condition that single playback service, playback time and request frequency are unchanged. The playback service dynamically creates a proper number of processes according to the configured times of playback, and compared with the traditional concurrency, the method can avoid the discontinuity of transactions, better simulate the high concurrency condition by using the real user request, and accurately find the performance bottleneck of the target service system after transformation.
In another embodiment, optionally, the performing flow playback on the modified target service system in the test environment based on the HTTP requests includes obtaining an original playback flow source including collected HTTP requests, determining an original time interval corresponding to each HTTP request in the original playback flow source, starting a single service process to load the original playback flow source, and playing back the HTTP requests in the playback flow source to the modified target service system after the single service process shortens the original time interval by a predetermined multiple in an equal proportion.
In this embodiment, the flow playback is to decrease the time interval between two requests at the time of playback, i.e., increase the density of playback requests per unit time by the frequency doubling method with the total request amount unchanged.
The doubling value may be configured, for example, n is configured, that is, the time interval between two adjacent HTTP requests is shortened by n times the playback time interval in equal proportion, n times the playback request is increased in unit time, and the playback time is shortened to 1/n of the original playback time. The double-speed playback cannot increase the playback speed without limitation, i.e., the double-frequency value cannot be too large, e.g., cannot exceed 5, otherwise the playback effect cannot be ensured precisely in terms of time granularity.
And configuring a frequency multiplication value, namely defaulting to a time interval without equal scale scaling adjustment, namely playing back at a speed of 1:1, and loading one original playback flow source comprising each acquired HTTP request according to the original time interval after the playback service reads the original playback flow source.
Described in connection with fig. 4 is a configuration with a frequency multiplication value of 2.
When the frequency multiplication value is 2, after loading the flow source of the original HTTP request collected in the production environment, calculating the time intervals of a plurality of HTTP requests req1, req2, and the like, shortening the playback time interval by 2 times according to the configured frequency multiplication value in equal proportion, and increasing the playback request by 2 times in unit time. For example, in the loaded original playback traffic source, 4 HTTP requests req1 to req4 exist between the time nodes T1 and T4, and when the playback time interval is shortened by adopting the frequency multiplication value of 2, 8 HTTP requests req1 to req8 exist between the time nodes T1 and T4, and at this time, the playback time is shortened to half as a whole.
By the flow playback mode of independently configuring the playback frequency multiplication value, when the test environment performs flow playback on the target service system after transformation, the time interval between two HTTP requests during playback can be reduced, namely, the playback request density in unit time is increased by a frequency multiplication method under the condition that the total request quantity is unchanged. The playback time is greatly shortened, the overall time consumption is shortened, the testing efficiency is improved, the server concurrency is increased, the server pressure is improved, and the service processing capacity of the target service system after transformation under high concurrency is verified more efficiently on the premise that the flow is complete and orderly service playback is not affected.
And 106, collecting response, performance monitoring data and logs generated correspondingly by the HTTP request in the flow playback process.
And in the process of inputting the acquired HTTP request to the modified target service system and carrying out flow playback, synchronously acquiring the test environment performance monitoring data and the application log corresponding to the playback flow, and carrying out centralized data storage according to the standard of the data in the acquired production environment so as to prepare for completing the performance analysis after the flow playback.
And step 108, 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 the performance test result of the target service system after modification.
After the flow playback is completed, the performance of the target service system after the modification can be analyzed by comparing the flow data packet before the modification of the target service system collected in the production environment with the flow data packet after the modification of the target service system collected in the test environment.
The method comprises the steps of analyzing responses, performance monitoring data and logs generated based on HTTP requests in a production environment, and responses, performance monitoring data and logs generated based on HTTP requests in a test environment correspondingly to obtain performance test results of the target service system after modification, wherein the steps of comparing the responses generated by the HTTP requests in the production environment with the responses generated by the HTTP requests in the test environment to determine time consumption of the same HTTP requests in the production environment and the test environment, comparing application performance data generated by the HTTP requests in the production environment with application performance data generated by the HTTP requests in the test environment to determine application performance of the target service system after modification, comparing database performance data generated by the HTTP requests in the production environment with database performance data generated by the HTTP requests in the test environment to determine database performance of the target service system after modification, comparing the logs generated by the HTTP requests in the production environment with the HTTP requests in the test environment to determine time consumption of a log exception condition, time consumption of a middleware and a response state, and determining running state of the target service system after modification, and the target service system is based on one or more time consumption performance results.
And comparing the original application performance data, database performance data of the target service system before transformation with the application performance data and database performance data of the test environment during playback, and comparing the log abnormal conditions during the period, the time consumption of the request of the middleware log, the response state code and other information, confirming the application service running condition of the test environment service system, obtaining the performance test result of the target service system after transformation, and outputting a flow playback report.
The report gives the running state, the performance condition and the performance bottleneck existing under the high concurrency condition of the application service after the target service system is completed and adapted, and whether the current server configuration meets the service requirement or not, thereby providing powerful support for performance optimization and resource configuration.
Next, with reference to fig. 5, a method for testing performance of a service system according to an embodiment of the present application is described in detail, where, as shown in fig. 5, the method includes the following steps:
Step 202, developing playback preparation, deploying a flow collection tool, and determining that a target service system is incorporated into performance monitoring;
Step 204, collecting HTTP requests of a target service system in a production environment service peak period (T1-T2), and collecting information such as performance monitoring data, application logs and the like in the period;
Step 206, the collected flow data packet is stored in a warehouse, the collected PCAP data packet file is analyzed into HTTP request information, and the HTTP request information is stored in an ES database in a warehouse;
step 208, performing flow playback in the period of the test environment T3-T4, and collecting performance monitoring data, application logs and other information in the period;
Step 210, outputting a flow playback report by comparing the data acquired in the analyzing step 204 and the data acquired in the analyzing step 208, and giving out a flow playback report of analysis and comparison of whether the server configuration resource meets the requirement or not, wherein the performance bottleneck exists in the application service running state, the performance condition and the high concurrency condition after the target service system is completed and adapted.
In the embodiment of the application, the response, performance monitoring data and log generated by HTTP request and HTTP request corresponding to target service are acquired when the target service system executes the target service in the production environment, the flow playback is carried out on the modified target service system in the test environment based on the HTTP request, the response, performance monitoring data and log generated by HTTP request corresponding to the HTTP request in the flow playback process are acquired, the response, performance monitoring data and log generated based on HTTP request in the production environment and the response, performance monitoring data and log generated based on HTTP request in the test environment are analyzed to obtain the performance test result of the modified target service system, so that the flow data packet of the production environment can be captured under the condition that the normal operation of the service system is not influenced, the automatic test of the service system after modification is realized by using the real access request of a user in the production environment, the load of the production environment is simulated in the test environment, the test environment is reduced, the test efficiency and the test accuracy are greatly improved, whether the performance bottleneck of the target service system after modification and the server resource configuration meet the service requirement or not is effectively and accurately found, and the performance guidance resource is provided for the target service system after the adaptation and the accurate configuration.
Optionally, as shown in fig. 6, the embodiment of the present application further provides a performance testing apparatus 2000 of a service system, which includes a processor 2400 and a memory 2200, where the memory 2200 stores a program or an instruction that can be executed on the processor 2400, and the program or the instruction implements each step of the performance testing method embodiment of the service system when executed by the processor 2400, and the steps achieve the same technical effects, so that repetition is avoided and no further description is given here.
The embodiment of the application also provides a readable storage medium, on which a program or an instruction is stored, where the program or the instruction realizes each process of the performance test method embodiment of any one of the above service systems when executed by a processor, and the same technical effects can be achieved, so that repetition is avoided, and no redundant description is provided herein. The readable storage medium includes a computer readable storage medium, such as Read-Only Memory (ROM), random access Memory (Random Access Memory RAM), magnetic disk or optical disk.
The embodiment of the application also provides a computer program product, which comprises a non-transitory computer readable storage medium storing a computer program, wherein the computer program is operable to enable a computer to implement each process of the performance test method embodiment of any one of the service systems when executed, and the same technical effects can be achieved, so that repetition is avoided, and redundant description is omitted here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.

Claims (10)

1. A method for testing performance of a business system, comprising:
Collecting response, performance monitoring data and logs generated by HTTP requests and HTTP requests when the target service system executes the target service in the production environment;
Performing flow playback on the modified target service system under a test environment based on the HTTP request;
collecting response, performance monitoring data and logs generated correspondingly by HTTP requests 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 target service system after modification.
2. The method according to claim 1, wherein the collecting HTTP requests of the target service system when executing the target service in the production environment comprises:
determining an optimal parameter combination used for acquiring the flow data packet based on the acquisition integrity of the flow data packet of the HTTP request corresponding to different parameter combinations, wherein the parameter combination comprises one or more of whether HTTP protocol filtering is configured, whether only HTTP request is acquired, whether the acquisition time is long, whether the attribution of a service port is limited during acquisition, and whether a high-speed storage device is adopted;
And collecting flow data packets of HTTP requests when the target service system executes the target service in the production environment in the service peak period based on the optimal parameter combination.
3. The method according to claim 2, wherein determining the optimal parameter combination for collecting the traffic data packets based on the collection integrity of the traffic data packets of the HTTP request corresponding to the different parameter combinations comprises:
inputting a data set comprising different parameter combinations and corresponding acquisition integrity as a sample into a preset probability proxy function;
And taking the objective function as an optimal solution with the highest acquisition integrity, and determining the optimal parameter combination in a parameter space of the probability proxy function.
4. The method according to claim 1, wherein after the collecting the response, performance monitoring data and log generated by the HTTP request and the HTTP request corresponding to the target service when the target service is executed in the production environment, the target service system further comprises:
Analyzing the acquired HTTP request from the data link layer protocol to an HTTP application layer protocol;
The request header and the request body of the HTTP request after analysis are stored in a target database in a mode of being respectively stored, and the time stamp and the sequence order of the HTTP request are recorded.
5. The method according to claim 1, wherein the performing traffic playback on the modified target service system in the test environment based on the HTTP request includes:
acquiring an original playback flow source comprising each acquired HTTP request;
determining an original time interval corresponding to each HTTP request in the original playback flow source;
Simultaneously starting a plurality of independent service processes to load the original playback flow sources respectively;
And playing back each HTTP request in the playback flow source to the modified target service system according to the corresponding original time interval through the plurality of independent service processes.
6. The method of claim 5, wherein the plurality of independent service threads are allocated at the same node or at different nodes of the target business system based on configuration requirements of the modified target business system for traffic playback.
7. The method according to claim 1, wherein the performing traffic playback on the modified target service system in the test environment based on the HTTP request includes:
acquiring an original playback flow source comprising each acquired HTTP request;
determining an original time interval corresponding to each HTTP request in the original playback flow source;
starting a single service process to load the original playback traffic source;
And shortening each HTTP request in the playback flow source by a preset multiple in equal proportion according to the corresponding original time interval through the single service process, and playing back the HTTP request to the modified target service system.
8. The method according to claim 1, wherein the 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 the performance test result of the modified target service system includes:
comparing the response generated by the HTTP request under the production environment with the response generated by the HTTP request under the test environment to determine the time consumption of the same HTTP request under the production environment and the test environment;
Comparing the application performance data generated by the HTTP request under the production environment with the application performance data generated by the HTTP request under the test environment to determine the application performance of the target service system after modification;
Comparing the database performance data generated by the HTTP request under the production environment with the database performance data generated by the HTTP request under the test environment to determine the database performance of the target service system after modification;
Comparing the log generated by the HTTP request in the production environment with the log comprising log abnormality, request time consumption of the middleware log and response state code generated by the HTTP request in the test environment to determine the running state of the target service system after modification;
And obtaining a performance test result of the target service system after modification based on the combination of one or more of the time consumption, the application performance, the database performance and the running state.
9. A performance testing apparatus of a business system, comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method of any of claims 1-8.
10. A readable storage medium, characterized in that it has stored thereon a program or instructions which, when executed by a processor, implement the steps of the method according to any of claims 1-8.
CN202411141070.9A 2024-08-19 2024-08-19 Performance testing method and device for business system, and readable storage medium Pending CN119135558A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411141070.9A CN119135558A (en) 2024-08-19 2024-08-19 Performance testing method and device for business system, and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411141070.9A CN119135558A (en) 2024-08-19 2024-08-19 Performance testing method and device for business system, and readable storage medium

Publications (1)

Publication Number Publication Date
CN119135558A true CN119135558A (en) 2024-12-13

Family

ID=93770920

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411141070.9A Pending CN119135558A (en) 2024-08-19 2024-08-19 Performance testing method and device for business system, and readable storage medium

Country Status (1)

Country Link
CN (1) CN119135558A (en)

Similar Documents

Publication Publication Date Title
CN110245078B (en) Software pressure testing method and device, storage medium and server
US5960181A (en) Computer performance modeling system and method
Subraya et al. Object driven performance testing of Web applications
CN113419747B (en) Middleware deployment method, device, equipment and storage medium
WO2019223142A1 (en) Application program testing method, apparatus, computer device and storage medium
CN107704369B (en) Operation log recording method, electronic device, storage medium and system
CN113127356A (en) Pressure measurement method and device, electronic equipment and storage medium
CN112559525B (en) Data checking system, method, device and server
CN108733545B (en) Pressure testing method and device
CN109409948B (en) Transaction abnormality detection method, apparatus, device, and computer-readable storage medium
CN113742226A (en) Software performance testing method, device, medium and electronic equipment
CN116074228B (en) Network card testing method and device, storage medium and electronic equipment
Herwanto et al. Measuring throughput and latency distributed ledger technology: Hyperledger
CN108363922A (en) A kind of automation malicious code emulation detection method and system
CN119135558A (en) Performance testing method and device for business system, and readable storage medium
CN116719750B (en) Software testing method and device, server equipment and storage medium
CN115878448A (en) Database test method, distributed database and storage medium
CN114598536B (en) Cloud platform virtualized data traffic safety monitoring method, system and storage medium
CN113905105B (en) Method and device for establishing application dependency relationship
CN115037794B (en) Data acquisition method, device, computer equipment and readable storage medium
CN110196862B (en) Data scene construction method, device, server and system
CN118035092A (en) System performance diagnosis method and device and related equipment
JP5093431B2 (en) Simulator system, evaluation method, and program
CN118504665A (en) Task processing method, device, electronic device and storage medium
CN117857334A (en) Automatic configuration and execution method for interface monitoring for large-scale micro-service

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination