Disclosure of Invention
In view of the foregoing, it is desirable to provide a system performance testing method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the testing efficiency.
In a first aspect, the present application provides a system performance testing method, including:
Determining an initial pressure value and a test script for a system to be tested;
Testing the performance of the system to be tested under the initial pressure value through the test script to obtain performance index data of the system to be tested under the initial pressure value;
Performing increasing treatment on the initial pressure value to obtain a new pressure value, and returning to the step of testing the performance of the system to be tested under the initial pressure value through the test script until reaching an iteration ending condition to obtain performance index data of the system to be tested under a plurality of pressure values;
And determining the critical pressure of the system to be tested entering the performance bottleneck period according to the performance index data under each pressure value.
In one embodiment, the increasing the initial pressure value to obtain a new pressure value includes:
acquiring a preset pressure increment and the current test times;
and increasing the initial pressure value according to the pressure increment and the test times to obtain a new pressure value.
In one embodiment, the increasing the initial pressure value to obtain a new pressure value includes:
determining a cost value of the system to be tested under the initial pressure value according to the performance index data of the system to be tested under the initial pressure value and a preset cost model;
according to a preset cost increment, increasing the cost value of the system to be tested under the initial pressure value to obtain a new cost value;
And determining a new pressure value after the initial pressure value increasing process according to the new cost value.
In one embodiment, the determining, according to the performance index data at each pressure value, the critical pressure of the system to be tested entering the performance bottleneck period includes:
determining a total cost expected value of the system to be tested under each pressure value according to the performance index data under each pressure value;
And determining the critical pressure of the system to be tested entering the performance bottleneck period according to the total cost expected value under each pressure value.
In one embodiment, the performance index data includes index values under a plurality of performance indexes, and the determining, according to the performance index data under each pressure value, a total expected cost value of the system under test under each pressure value includes:
Inputting the performance index data under the pressure values into a preset cost model aiming at each pressure value to obtain the cost value of each performance index under the pressure values;
And carrying out weighted summation on the cost value of each performance index according to the preset weight of each performance index to obtain a total cost expected value under the pressure value.
In one embodiment, the determining the critical pressure of the system under test entering the performance bottleneck period according to the total cost expected value under each pressure value includes:
determining the change trend of the total cost expected value along with the increase of the pressure value according to the total cost expected value under each pressure value;
And determining an inflection point of the total cost expected value according to the change trend of the total cost expected value along with the increase of the pressure value, and taking the pressure value corresponding to the inflection point as the critical pressure of the system to be tested entering the performance bottleneck period.
In a second aspect, the present application further provides a system performance testing apparatus, including:
The data determining module is used for determining an initial pressure value and a test script of the system to be tested;
the initial test module is used for testing the performance of the system to be tested under the initial pressure value through the test script to obtain performance index data of the system to be tested under the initial pressure value;
The iteration test module is used for increasing the initial pressure value to obtain a new pressure value, and returning to the step of testing the performance of the system to be tested under the initial pressure value through the test script until reaching an iteration ending condition to obtain performance index data of the system to be tested under a plurality of pressure values;
and the bottleneck determining module is used for determining the critical pressure of the system to be tested entering the performance bottleneck period according to the performance index data under each pressure value.
In a third aspect, the present application also provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
Determining an initial pressure value and a test script for a system to be tested;
Testing the performance of the system to be tested under the initial pressure value through the test script to obtain performance index data of the system to be tested under the initial pressure value;
Performing increasing treatment on the initial pressure value to obtain a new pressure value, and returning to the step of testing the performance of the system to be tested under the initial pressure value through the test script until reaching an iteration ending condition to obtain performance index data of the system to be tested under a plurality of pressure values;
And determining the critical pressure of the system to be tested entering the performance bottleneck period according to the performance index data under each pressure value.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
Determining an initial pressure value and a test script for a system to be tested;
Testing the performance of the system to be tested under the initial pressure value through the test script to obtain performance index data of the system to be tested under the initial pressure value;
Performing increasing treatment on the initial pressure value to obtain a new pressure value, and returning to the step of testing the performance of the system to be tested under the initial pressure value through the test script until reaching an iteration ending condition to obtain performance index data of the system to be tested under a plurality of pressure values;
And determining the critical pressure of the system to be tested entering the performance bottleneck period according to the performance index data under each pressure value.
In a fifth aspect, the application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of:
Determining an initial pressure value and a test script for a system to be tested;
Testing the performance of the system to be tested under the initial pressure value through the test script to obtain performance index data of the system to be tested under the initial pressure value;
Performing increasing treatment on the initial pressure value to obtain a new pressure value, and returning to the step of testing the performance of the system to be tested under the initial pressure value through the test script until reaching an iteration ending condition to obtain performance index data of the system to be tested under a plurality of pressure values;
And determining the critical pressure of the system to be tested entering the performance bottleneck period according to the performance index data under each pressure value.
The system performance testing method, the device, the computer equipment, the computer readable storage medium and the computer program product are characterized in that the method comprises the steps of determining an initial pressure value and a testing script of a system to be tested, testing the performance of the system to be tested under the initial pressure value through the testing script to obtain performance index data of the system to be tested under the initial pressure value, increasing the initial pressure value to obtain a new pressure value, returning to the step of testing the performance of the system to be tested under the initial pressure value through the testing script until reaching an iteration ending condition, obtaining performance index data of the system to be tested under a plurality of pressure values, and gradually increasing the pressure values through a server according to a preset mode to perform iterative testing, and determining the critical pressure of the system to be tested entering a performance bottleneck period according to the performance index data under each pressure value, thereby realizing the automatic processing of the iterative testing of the system to be tested, and improving the testing efficiency.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
In one embodiment, as shown in fig. 1, a system performance testing method is provided, where the method is applied to a server for illustration, it is understood that the method may also be applied to a terminal, and may also be applied to a system including the terminal and the server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the steps of:
step S102, determining an initial pressure value and a test script for the system to be tested.
The system to be tested can be a computer system needing performance test, and the computer system is a set of hardware and software and is used for receiving, processing and storing information.
The initial pressure value may be, among other things, the load applied when the system is tested, the number of users operating as such, or the number of transactions or requests processed within a particular time, etc.
The test script can be an automatic test tool and is used for simulating multi-user concurrent operation aiming at the system to be tested, and the automatic test tool is used for recording the operation behaviors of the user in the system, wherein the operation behaviors comprise common operations of user login, page browsing, form submitting and data inquiring.
Optionally, the server acquires historical performance data of the system to be tested, screens out load of normal operation of the system to be tested as an initial pressure value, acquires a preset test script and data required by the test script, wherein the required data comprises virtual user data and test case data, and associates the test script with the data. It can be appreciated that before the formal test, the test script needs to be verified, and the test script is tested to verify the correctness and stability of the test script. Wherein the virtual user data needs to cover different types of users and operation scenarios, including user names, passwords, and users ID (Identification). The test case data needs to cover main functions and boundary conditions of the system to be tested, including input data, expected output and test conditions.
Step S104, testing the performance of the system to be tested under the initial pressure value through a test script to obtain the performance index data of the system to be tested under the initial pressure value.
The performance index data may be an index value of performance such as response speed, processing capability, stability, etc. of the feedback system.
Optionally, the server calls the test script to test the performance of the system to be tested under the initial pressure value to obtain the performance index data of the system to be tested under the initial pressure value, for example, the pressure value of the test system is set at the initial pressure value, the test script is operated, the multi-user concurrent operation is simulated to the system to be tested, and the performance index data of the system to be tested is recorded.
And step S106, performing increasing treatment on the initial pressure value to obtain a new pressure value, and returning to the step of testing the performance of the system to be tested under the initial pressure value through the test script until reaching the iteration ending condition to obtain the performance index data of the system to be tested under a plurality of pressure values.
The increasing process may be a process of increasing the value, that is, increasing the value of the initial pressure value, and the increasing process may be linear or nonlinear.
The iteration end condition may be that the number of iteration tests is greater than a preset iteration number threshold.
Optionally, the server performs increasing processing on the initial pressure value to obtain a new pressure value, returns to the step of testing the performance of the system to be tested under the initial pressure value through the test script, and tests the system to be tested by using the new pressure value until reaching the iteration ending condition, so as to obtain the performance index data of the system to be tested under a plurality of pressure values.
Step S108, determining the critical pressure of the system to be tested entering the performance bottleneck period according to the performance index data under each pressure value.
The performance bottleneck period may refer to that during the operation of the computer system, the performance limitation of a certain component or resource causes the whole system to fail to fully utilize its potential processing capability, which generally affects the response time, processing speed and overall performance of the system.
The critical pressure may be a pressure value corresponding to the system to be tested entering the performance bottleneck period.
Optionally, the server determines a test for the system to be tested to enter a performance bottleneck period according to the performance index data measured by the system to be tested under each pressure value, and takes the pressure value corresponding to the test as the critical pressure.
The method comprises the steps of determining an initial pressure value and a test script of a system to be tested, testing the performance of the system to be tested under the initial pressure value through the test script to obtain performance index data of the system to be tested under the initial pressure value, increasing the initial pressure value to obtain a new pressure value, returning to the step of testing the performance of the system to be tested under the initial pressure value through the test script until reaching an iteration ending condition to obtain the performance index data of the system to be tested under a plurality of pressure values, and gradually increasing the pressure values through a server according to a preset mode to perform iterative test, determining the critical pressure of the system to be tested entering a performance bottleneck period according to the performance index data of each pressure value, thereby realizing the automatic processing of the iterative test of the system to be tested and improving the test efficiency.
In an exemplary embodiment, the step S106 of increasing the initial pressure value to obtain the content of the new pressure value includes:
And increasing the initial pressure value according to the pressure increment and the test times to obtain a new pressure value.
Wherein the pressure increase may be a part that increases on the basis of the initial pressure value as a reference value or an original value.
Optionally, the server acquires a preset pressure increment and a current test frequency, and increases the initial pressure value according to the pressure increment and the test frequency to obtain a new pressure value, where the corresponding expression includes:
wherein, the For the new pressure value corresponding to the ith test,As a result of the initial pressure value,In order to increase the pressure of the fluid,The current test times.
In this embodiment, by increasing the initial pressure value in a linear increasing manner during each test, a new pressure value for iterative test is obtained, so that the server automatically selects the pressure value for each iterative test, thereby further improving the test efficiency, and the test result can be more coherent by linearly increasing the pressure value for each test.
In an exemplary embodiment, the step S106 of increasing the initial pressure value to obtain the content of the new pressure value includes:
Determining a cost value of the system to be tested under the initial pressure value according to performance index data of the system to be tested under the initial pressure value and a preset cost model, increasing the cost value of the system to be tested under the initial pressure value according to a preset cost increment to obtain a new cost value, and determining a new pressure value after the initial pressure value is increased according to the new cost value.
The preset cost model can be a preset mathematical function model for calculating cost values, and the cost model is used for quantifying resource consumption or service loss of the system to be tested under different pressure values.
Optionally, the server inputs the performance index data of the system to be tested under the initial pressure value into a preset cost model to obtain cost values of a plurality of performance indexes corresponding to the performance index data of the system to be tested under the initial pressure value, and adds the preset cost increment and the cost value under the initial pressure value, so that each cost value of the system to be tested under the initial pressure value is increased to obtain a new cost value. And reversely calculating the sub-pressure value corresponding to each performance index according to each new cost value and a preset cost model, and obtaining a new pressure value according to the sum value of each sub-pressure value. The corresponding expression is:
wherein, the Indicating the new pressure value corresponding to the i +1 test,Expressed in the pressure valueThe cost value corresponding to the next x-th performance index,The cost-increment is represented and,The value of the fixed cost-value is expressed,Representing a preset cost factor.
In the embodiment, the new pressure value is reversely deduced by iteration to increase the cost, so that the continuity and predictability of the testing process are ensured, the iteration process of the pressure value is quickened, the convergence speed is improved, the testing times are reduced, and the testing efficiency is further improved.
In an exemplary embodiment, as shown in fig. 2, step S108 determines, according to performance index data at each pressure value, a critical pressure of the system under test entering a performance bottleneck period, including:
Step S202, determining the total cost expected value of the system to be tested under each pressure value according to the performance index data under each pressure value;
The total cost expected value can be probability average estimation of the total cost value when different test pressures or different performance index data fluctuation are considered under an uncertain environment.
Optionally, the server determines the cost value of the system to be tested under each pressure value according to the performance index data under each pressure value, and further determines the total expected cost value of the system to be tested under each pressure value according to the cost value under each pressure value.
Step S204, determining the critical pressure of the system to be tested entering the performance bottleneck period according to the total cost expected value under each pressure value.
Optionally, the server analyzes the variation trend of the total cost expected value under each pressure value by adopting a statistical method, and determines the critical pressure of the system to be tested entering the performance bottleneck period according to the variation trend.
In this embodiment, by locating the system performance under each pressure value, identifying the starting point of performance decay, and by calculating the total cost expected value, the contingency (such as network jitter and instantaneous load non-uniformity) of a single test is eliminated, the robustness of the test result is enhanced, and in addition, the subjective experience judgment is replaced by a mathematical method (such as derivative change and curvature analysis), so that human errors are avoided, and the accuracy of the test is improved.
In an exemplary embodiment, the performance index data includes index values under a plurality of performance indexes, and step S202 determines, according to the performance index data under each pressure value, a total cost expected value of the system under test under each pressure value, including:
And according to the preset weight of each performance index, carrying out weighted summation on the cost value of each performance index to obtain a total expected cost value under the pressure value.
The performance index data comprises index values under a plurality of performance indexes, such as hardware performance indexes, server performance indexes, middleware performance indexes, application program performance indexes and network performance indexes, wherein the performance indexes of hardware in a system to be tested comprise CPU (central processing unit) utilization rate, memory utilization rate and hard disk read-write rate, the performance indexes of the server comprise thread pool utilization rate, connection number and request processing time, the performance indexes of the middleware comprise message queue length, transaction processing time and cache hit rate, the performance indexes of an application program comprise code calling time, database query time and memory leakage rate, and the performance indexes of a network comprise network bandwidth utilization rate, network delay and data packet loss rate.
The preset weight can be set by the importance degree of each performance index in the actual test requirement.
Optionally, the server inputs the performance index data under the pressure value into a preset cost model for each pressure value to obtain a cost value of each performance index under the pressure value, and the corresponding expression includes:
wherein, the Represents the cost value corresponding to the xth performance index under the pressure value L,For the cost factor to be preset,The index value representing the xth performance index under the pressure value L, C, is a constant term, and is a fixed cost.
Further, the server performs weighted summation on the cost value of each performance index according to the preset weight of each performance index to obtain a total cost expected value under the pressure value, and the corresponding expression is:
wherein, the For the total cost expected value of the system under test at the pressure value L,As the weight of the x-th performance index,The cost value corresponding to the xth performance index under the pressure value L.
In this embodiment, the critical pressure of the performance bottleneck period is determined later by determining the total cost expected value of the system under test under each pressure value.
In an exemplary embodiment, step S204 determines a critical pressure for the system under test to enter a performance bottleneck period according to the total cost expected value at each pressure value, including:
And determining an inflection point of the total cost expected value according to the change trend of the total cost expected value along with the increase of the pressure value, and taking the pressure value corresponding to the inflection point as the critical pressure of the system to be tested entering the performance bottleneck period.
The inflection point may be a point at which the concavity and convexity of the curve changes in the calculus, at which point the second derivative is zero or absent, the shape of the curve changes from concave to convex, or vice versa.
Optionally, the server arranges the total cost expected values according to the order of increasing the pressure values, and adopts a statistical method, such as calculating the mean value, variance or forming a trend line of the total cost expected values for analysis, so as to obtain the variation trend of the total cost expected values along with the increasing pressure values. The server further determines an inflection point of the total cost expected value according to the change trend of the total cost expected value along with the increase of the pressure value, and takes the pressure value corresponding to the inflection point as the critical pressure of the system to be tested entering the performance bottleneck period.
In this embodiment, by gradually increasing the test pressure, the performance of the system under different loads is recorded and analyzed, and the performance of the system is comprehensively evaluated, so that the performance bottleneck of the system under high loads can be identified. By calculating the cost function and the total cost expected value, the performance consumption of the system under different pressures is quantified, and an intuitive data basis is provided for the analysis of the change trend by a subsequent statistical method (such as mean value, variance and trend line), so that the inflection point of the total cost expected value of the system to be tested entering the performance bottleneck period can be intuitively and accurately identified, and the critical pressure corresponding to the inflection point can be obtained.
In an exemplary embodiment, step S108 further includes, after determining the critical pressure of the system under test for entering the performance bottleneck period according to the total cost expected value at each pressure value:
and sequentially carrying out performance analysis on the components of each hierarchy according to the sequence of the hierarchy from bottom to top to determine the components which cause performance bottlenecks in the system to be tested.
Among other things, a component may refer to various hardware and software components that make up a computer.
Optionally, the server performs hierarchical division on each component in the system to be tested, and divides the components from bottom to top, and sequentially includes hardware, the server, middleware, an application program and a network, so as to obtain a hierarchy corresponding to each component. The server further sequentially analyzes the performance of the components of each level by adopting a performance testing tool according to the level from bottom to top, determines the components which cause performance bottlenecks in the system to be tested, and formulates corresponding optimization schemes such as hardware upgrading, server configuration optimization, middleware optimization, code optimization, network optimization and the like. It should be noted that, after the server executes the corresponding optimization scheme, the performance test of the system to be tested may be performed again, and the critical pressure of the next performance bottleneck period is found until the positioning and optimization of the performance bottlenecks of all the components in the system to be tested are completed.
In this embodiment, the performance test (load test, pressure test) method is designed based on the basic principle of the system architecture, and based on the pressure test, only one performance bottle is found and solved for each performance test, so that an iterative test framework is provided. Starting with the underlying system component, if this system component is tested without a performance bottleneck, then if a performance bottle pre-exists in a later test, it is certain that this component is not responsible, but rather that the upper system component is responsible. In this embodiment, the "bottom-up" means that the system to be tested is hierarchically divided into hardware, servers, middleware, applications and networks from bottom to top. And indicates that the flow direction of the performance bottleneck is unidirectional, i.e. the occurrence of a problem in the lower layer component affects the performance of the upper layer component, while the occurrence of a problem in the upper layer component does not affect the performance of the lower layer component. The layered positioning thought can help testers avoid confusion caused by the mutual influence of components in different layers, so that the positioning of performance bottlenecks is more orderly.
In one exemplary embodiment, as shown in FIG. 3, another system performance testing method is provided, comprising:
step 1, test script preparation and data preparation.
Illustratively, an automated testing tool is used to record the behavior of a user browsing the system, and edit the recorded script to develop a test script that meets the performance test requirements. Data required for the test script, including virtual user data and test case data, is prepared and associated with the test script.
The method comprises the steps of recording operation behaviors of a user in a system by using an automatic testing tool, wherein the operation behaviors comprise common operations of logging in by the user, browsing pages, submitting forms and inquiring data. Editing the recorded script to ensure that the script meets the requirement of performance test. Necessary parameterization settings are added, such as user entered data, requested URL (Uniform Resource Locator ). The script can simulate multi-user concurrent operation, and proper concurrent user number and execution time are set. And running the edited script to verify the correctness and stability of the script. Ensure that the script can be normally executed and accurately simulate the user behavior. Virtual user data is prepared by creating virtual user data including a user name, a password, and a user ID. It is ensured that the virtual user data is able to cover different types of users and operating scenarios. Test case data is prepared, including input data, expected output, test conditions. Ensuring that test case data can cover the main functions and boundary conditions of the system. Virtual user data and test case data are associated with the test script. Ensuring that the script can correctly invoke and use the data during execution.
And 2, designing and executing a test scene.
An initial pressure value is selected from the historical performance data of the system to be tested and is initially tested, and specifically, the initial pressure value is selected based on the normal running load of the system so as to ensure that the starting point of the test is representative. And under each pressure value, recording various performance index values of components in the system to be tested, wherein the indexes reflect the resource consumption conditions of the system under different loads. In the positioning and optimizing of the performance bottleneck of the hardware, the CPU (Central Processing Unit ) utilization, memory utilization, hard disk read-write rate are used as performance indexes to calculate critical points and position specific bottleneck points for the cost function (corresponding to the cost model in the embodiment) of each performance index under specific test pressure, while in other servers, middleware, application programs and networks, respectively different performance indexes are used. And calculating the total cost expected value of the system to be tested under the iteratively increased test pressure according to the cost function value (cost value) of each performance index obtained by the cost function, wherein the total cost expected value is used for comprehensively evaluating the overall performance of the system under different pressures. The method comprises the steps of analyzing the variation trend of total cost expected value data by using a statistical method (such as mean value, variance and trend line), finding out the inflection point of the variation of the total cost expected value data, namely the critical point corresponding to the entering of the system to be tested into the performance bottleneck period, and comprehensively evaluating the performance of the system by gradually increasing the test pressure, recording and analyzing the performance of the system under different loads through the test scene design of the step. This helps identify performance bottlenecks of the system under high loads. And then, providing guidance for system optimization through comprehensive bottleneck identification and performance evaluation. The optimization scheme can be adjusted and improved for specific performance bottlenecks based on the test results.
Wherein, by calculating the cost function and the total cost expected value, the performance consumption of the system under different pressures is quantified. The method provides visual data basis for analyzing the change trend by a subsequent statistical method (such as mean, variance and trend line).
The performance indexes of hardware in the system to be tested comprise CPU utilization rate, memory utilization rate and hard disk read-write rate, wherein the performance indexes of the server comprise thread pool utilization rate, connection number and request processing time, the performance indexes of the middleware comprise message queue length, transaction processing time and cache hit rate, the performance indexes of the application program comprise code calling time, database query time and memory leakage rate, and the performance indexes of the network comprise network bandwidth utilization rate, network delay and data packet loss rate. Specifically, hardware performance indicators, CPU usage, high CPU usage may indicate that the system is loaded too high, possibly resulting in performance degradation or slow system response. Memory usage-high memory usage may result in reduced system performance or memory starvation errors. Hard disk read-write speed-high hard disk read-write speed may cause I/O bottleneck, affecting system performance. Server performance metrics-thread pool usage-high thread pool usage may lead to thread contention and performance degradation. Connection count-high connection count may cause server overload, affecting response time. Request processing time-long request processing times may indicate server performance problems or insufficient resources. Middleware performance index, message queue length, which represents the number of messages waiting to be processed in the message queue. Long message queues may cause delays and performance degradation. Transaction time-represents the time required by the middleware to process each transaction. Long transaction times may indicate middleware performance problems or insufficient resources. Cache hit ratio, which represents the proportion of hits in a cache request. Low cache hit rates may result in frequent database accesses, affecting performance. The performance index of the application program is code calling time, which represents the execution time of each code segment in the application program. Long code call times may indicate code inefficiency or resource contention. Database query time, which represents the time required by an application to perform a database query. Long database query times may indicate database performance problems or query inefficiency. Memory leak rate, the proportion of unreleased memory in an application program. Gao Nacun leak rates can lead to memory starvation and performance degradation. Network performance index: network bandwidth usage: the usage of network bandwidth is expressed, typically in percent. High network bandwidth usage may lead to network congestion and performance degradation. Network delay-time representing the time that a data packet is transmitted in the network. High network delays may result in increased response time and reduced user experience. Packet loss rate, which is the proportion of packets lost during network transmission. High packet loss rates may result in communication failures and performance degradation.
By monitoring and analyzing the performance indexes, the performance of the system under different loads can be comprehensively evaluated, the performance bottleneck can be identified and solved, and the overall performance and stability of the system are improved.
The method for iteratively increasing the test pressure comprises the steps of setting a fixed increment delta L according to an initial pressure value, increasing the pressure value by delta L when each iteration is performed, setting a cost increment delta C when each iteration is performed, adjusting the pressure value according to the cost increment, and determining a new pressure value by reverse calculation according to a cost function under the new pressure value.
Specifically, by setting cost increment, the cost increment method can analyze the change trend of the total cost expected value data according to a statistical method (such as mean, variance and trend line), and determine a cost increment delta C according to the curvature of the change trend.
The method ensures the continuity and predictability of the test process, accelerates the convergence speed of the pressure iteration process, reduces the test times and improves the test efficiency.
And step 3, performance bottleneck positioning is carried out.
The system components are divided from bottom to top and sequentially comprise hardware, a server, middleware, an application program and a network, the performance analysis tool is used for monitoring and hierarchically analyzing the system performance, and the performance bottleneck points of the system components are positioned according to the hierarchical analysis result.
It should be noted that, the performance test (load test, pressure test) method is designed by deducing the basic principle of the system architecture, and the invention is based on the pressure test, because only one performance bottle pre-test is found and solved in each performance test, and further an iterative test framework is provided. Starting with the underlying system component, if this system component is tested without a performance bottleneck, then if a performance bottle pre-exists in a later test, it is certain that this component is not responsible, but rather that the upper system component is responsible.
In the step, "bottom-up" means that the system to be tested is hierarchically divided into hardware, servers, middleware, application programs and networks from bottom to top. And indicates that the flow direction of the performance bottleneck is unidirectional, i.e. the occurrence of a problem in the lower layer component affects the performance of the upper layer component, while the occurrence of a problem in the upper layer component does not affect the performance of the lower layer component. The layered positioning thought can help testers avoid confusion caused by the mutual influence of components in different layers, so that the positioning of performance bottlenecks is more orderly.
The method for monitoring and hierarchically analyzing the system performance by using the performance analysis tool and the log analysis tool comprises the specific steps of installing and configuring the performance analysis tool to ensure that the tool is compatible with the system to be tested and is correctly integrated into the system to be tested, monitoring the performance index of the system to be tested in real time by using the performance analysis tool, and locating the performance bottleneck point of each system component by hierarchically and one by one analyzing the performance index of hardware, a server, middleware, an application program and a network in the system to be tested.
In particular, different performance analysis tools may be used to view performance of components at different levels (view performance of hardware, performance of middleware, performance of applications, performance of servers, performance of networks). And positioning to a specific performance bottleneck point according to the result of the hierarchical analysis. The root cause of the bottleneck is determined, such as insufficient resources, improper configuration, and low code efficiency. And then the subsequent steps are carried out, and corresponding optimization schemes are formulated aiming at the identified performance bottlenecks. The optimization scheme comprises hardware upgrading, server configuration optimization, middleware tuning, code optimization and network optimization. And implementing an optimization scheme to optimize the system. And then, carrying out performance test again to verify whether the optimization effect meets the expectations.
And 4, optimizing. And (3) aiming at the positioned performance bottleneck, formulating a corresponding optimization scheme, and optimizing the system according to the optimization scheme to verify whether the optimization effect meets the expectations.
And 5, performing a circulation test, namely repeating the steps 2 to 4, performing a performance test again, searching a critical point of the next performance bottleneck period of the system to be tested, and performing the circulation until the positioning and optimization of the performance bottlenecks of all the system components are completed. And a closed loop scheme for testing, positioning and optimizing the system performance bottleneck according to the layering division rule and testing again is designed, and the system performance is gradually optimized until the positioning and optimizing of the performance bottleneck of all the system components are completed. The comprehensive evaluation and continuous optimization of the system performance are ensured, and the overall performance and stability of the system are improved.
In this embodiment, the test scenario design adopts a linear increment method or iteration of a cost increment method to increase test pressure, calculates a cost function and a total cost expected value through each performance index, analyzes the variation trend of the total cost expected value data by using a statistical method, and judges and finds out the performance bottleneck. The continuity and predictability of the testing process are ensured, the convergence speed of the pressure iterative process is accelerated, the testing times are reduced, the testing efficiency is improved, all the system components are checked one by adopting a bottom-up method according to the hierarchical division rule of the system components, and the performance bottleneck points are positioned by monitoring and layering analysis through a performance analysis tool. The comprehensiveness of the test is ensured. The invention designs a closed loop scheme of testing, positioning, optimizing and retesting the system performance bottleneck according to the layering division rule, ensures comprehensive evaluation and continuous optimization of the system performance, and improves the overall performance and stability of the system.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a system performance testing device for realizing the system performance testing method. The implementation of the solution provided by the device is similar to that described in the above method, so the specific limitation of one or more embodiments of the system performance testing device provided below may be referred to the limitation of the system performance testing method hereinabove, and will not be repeated herein.
In one exemplary embodiment, as shown in FIG. 4, a system performance testing apparatus 400 is provided, comprising a data determination module 401, an initial testing module 402, an iterative testing module 403, and a bottleneck determination module 404, wherein:
The data determining module 401 is configured to determine an initial pressure value and a test script for the system under test.
The initial testing module 402 is configured to test performance of the system under test under an initial pressure value through a test script, so as to obtain performance index data of the system under test under the initial pressure value.
The iteration test module 403 is configured to perform an increase process on the initial pressure value to obtain a new pressure value, and return to a step of testing the performance of the system to be tested under the initial pressure value through the test script until reaching an iteration end condition, to obtain performance index data of the system to be tested under a plurality of pressure values.
The bottleneck determining module 404 is configured to determine, according to the performance index data under each pressure value, a critical pressure of the system under test entering the performance bottleneck period.
Further, in one embodiment, the iteration test module 403 is further configured to obtain a preset pressure increment and a current test number, and increase the initial pressure value according to the pressure increment and the test number to obtain a new pressure value.
Further, in one embodiment, the iteration test module 403 is further configured to determine a cost value of the system to be tested under the initial pressure value according to the performance index data of the system to be tested under the initial pressure value and a preset cost model, perform an increase process on the cost value of the system to be tested under the initial pressure value according to a preset cost increment to obtain a new cost value, and determine a new pressure value after the increase process on the initial pressure value according to the new cost value.
Further, in one embodiment, the bottleneck determining module 404 is further configured to determine a total cost expected value of the system under test under each pressure value according to the performance index data under each pressure value, and determine a critical pressure of the system under test entering the performance bottleneck period according to the total cost expected value under each pressure value.
Further, in one embodiment, the bottleneck determining module 404 is further configured to input the performance index data under the pressure value into a preset cost model for each pressure value to obtain a cost value of each performance index under the pressure value, and perform weighted summation on the cost value of each performance index according to the preset weight of each performance index to obtain a total expected cost value under the pressure value.
Further, in one embodiment, the bottleneck determining module 404 is further configured to determine a trend of the total cost expected value along with the increase of the pressure value according to the total cost expected value under each pressure value, determine an inflection point of the total cost expected value according to the trend of the total cost expected value along with the increase of the pressure value, and use the pressure value corresponding to the inflection point as the critical pressure of the system to be tested entering the performance bottleneck period.
Further, in one embodiment, the bottleneck determining module 404 is further configured to perform hierarchical division on each component in the system to be tested to obtain a hierarchy corresponding to each component, and perform performance analysis on the components in each hierarchy sequentially according to the sequence of the hierarchies from bottom to top to determine the component in the system to be tested that causes the performance bottleneck.
The various modules in the system performance test apparatus 400 described above may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one exemplary embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing data such as initial pressure values, test script related data, performance index data, new pressure values and the like. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a system performance test method.
It will be appreciated by those skilled in the art that the structure shown in FIG. 5 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are both information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data are required to meet the related regulations.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile memory and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (RESISTIVE RANDOM ACCESS MEMORY, reRAM), magneto-resistive Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (PHASE CHANGE Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computation, an artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) processor, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the present application.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.