Pressure testing method, system, equipment and medium
By conducting stress tests on the server to be tested, dynamically adjusting the concurrent number and performing function fit, the problem of inaccurate test results caused by fixed coefficients in nonlinear scenarios is solved, and more accurate test results and higher intelligence are achieved.
Patent Information
- Application Number
- CN202310334891.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2043-03-31
AI Technical Summary
In the prior art, using a fixed coefficient to determine the target concurrency number may lead to inaccurate test results in nonlinear scenarios.
By conducting stress tests on the server to be tested, performance indicators and pressure indicators are determined, function fitting is performed, and concurrency numbers are dynamically adjusted until the concurrency numbers corresponding to the peak TPS are consistent. Function fitting and preset performance indicator thresholds are used to determine the adjacent next concurrency numbers.
It improves the accuracy of stress test results, reduces manual intervention, and improves intelligence.
Smart Images

Figure CN116150035B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of detection technology, and in particular to a pressure testing method, system, equipment and medium. Background Art
[0002] Software testing is an essential step in the software development process. Professional testing is required before software is put into use to ensure quality. During software stress testing, it's often necessary to gradually increase the pressure to find peak concurrency and transaction processing speed (TPS). Stress testing typically uses a fixed gradient to increase the pressure. While this method is simple to use, it can easily miss peak points during testing, leading to inaccurate test results.
[0003] In related technologies, a fixed coefficient is used to determine the target concurrency number. This method takes into account the nonlinear boosting method and improves the accuracy of the test results to a certain extent. However, since it uses a fixed coefficient to determine the target concurrency number, for nonlinear scenarios, the target concurrency number value obtained may be wrong, resulting in inaccurate test results. Summary of the Invention
[0004] In view of the shortcomings of the existing technology described above, the present invention provides a stress testing method, system, equipment and medium to solve the technical problem that when a fixed coefficient is used to determine the target concurrency number, the target concurrency number obtained in nonlinear scenarios may be wrong, resulting in inaccurate test results.
[0005] To solve the above technical problems, the technical solutions of this application are as follows:
[0006] In a first aspect, the present application provides a stress testing method, the stress testing method comprising:
[0007] Perform stress testing on the server to be tested to determine the performance indicators and stress indicators of the server to be tested, including the number of concurrent connections and TPS;
[0008] Perform function fitting based on the performance index and TPS to obtain the first fitting function;
[0009] Determine a first adjacent next concurrent number based on the first fitting function and the concurrent number;
[0010] Adjust the number of concurrent connections to the next adjacent number of concurrent connections;
[0011] Based on the first adjacent next concurrency number, repeat the stress test, function fitting, determine the first adjacent next concurrency number, adjust the concurrency number to the first adjacent next concurrency number, and perform stress testing until the concurrency number corresponding to the peak TPS obtained by the stress test is consistent with the first adjacent next concurrency number, thus obtaining the peak TPS.
[0012] In an exemplary embodiment of the present application, determining the first adjacent next concurrent number includes:
[0013] Determine the maximum value of the fitted TPS based on the first fitting function and each preset performance indicator threshold;
[0014] Sort the concurrency numbers in the pressure indicators in chronological order to obtain the first concurrency number sequence;
[0015] The first adjacent next concurrent number is determined based on the fitted TPS maximum value and the first latest concurrent number in the first concurrent number sequence.
[0016] In an exemplary embodiment of the present application, determining the maximum value of the fitted TPS includes:
[0017] Substitute each preset performance indicator threshold into the corresponding first fitting function to obtain the corresponding fitting TPS value;
[0018] Compare the fitted TPS values and obtain the maximum fitted TPS value.
[0019] In an exemplary embodiment of the present application, performing function fitting according to the performance index and TPS includes:
[0020] Sort the TPS in the performance indicators and pressure indicators in chronological order to obtain the performance indicator sequence and TPS sequence;
[0021] The latest performance index data and TPS data are selected from the performance index sequence and TPS sequence to perform function fitting.
[0022] In an exemplary embodiment of the present application, during the test process, a test report is obtained, wherein the test report includes an error information status, wherein the error information status includes the occurrence of an error message, and the stress testing method further includes:
[0023] Adjust the number of concurrent connections to the number corresponding to the peak TPS;
[0024] According to the concurrency number corresponding to the peak TPS, the server to be tested is stress tested again, and a function is fitted based on the performance index in the test result and the concurrency number in the stress index to obtain a second fitting function;
[0025] Determine the second adjacent next concurrent number based on the second fitting function and the concurrent number;
[0026] Adjust the number of concurrent connections to the next adjacent number of concurrent connections;
[0027] According to the second adjacent next concurrency number, repeatedly perform stress testing on the server to be tested, perform function fitting, determine the second adjacent next concurrency number, adjust the concurrency number to the second adjacent next concurrency number, and perform stress testing until the second adjacent next concurrency number is consistent with the concurrency number obtained by the stress test and the error information status is that an error message appears, and the second adjacent next concurrency number is determined as the maximum concurrency number.
[0028] In an exemplary embodiment of the present application, determining the second adjacent next concurrent number includes:
[0029] Determining a minimum number of concurrent fits based on the second fitting function and each preset performance indicator upper threshold, wherein the preset performance indicator upper threshold is greater than or equal to the corresponding preset performance indicator threshold;
[0030] Sort the concurrency numbers in the stress indicators obtained by the second stress test in chronological order to obtain a second concurrency number sequence;
[0031] The second adjacent next concurrency number is determined based on the minimum value of the fitted concurrency number and the second latest concurrency number in the second concurrency number sequence.
[0032] In an exemplary embodiment of the present application, determining the minimum value of the fitting concurrency number includes:
[0033] Substitute the upper threshold of each preset performance indicator into the corresponding second fitting function to obtain the corresponding fitting concurrency number;
[0034] Compare the concurrency numbers of each fit and get the minimum concurrency number of fit.
[0035] In a second aspect, the present application provides a pressure testing system, comprising:
[0036] The testing module is used to perform stress testing on the server to be tested and determine the performance indicators and stress indicators of the server to be tested, wherein the stress indicators include the number of concurrent connections and TPS;
[0037] A function fitting module is used to perform function fitting based on the performance index and TPS to obtain a first fitting function;
[0038] A determination module, configured to determine a first adjacent next concurrent number based on the first fitting function and the concurrent number;
[0039] An adjustment module, configured to adjust the number of concurrent requests to the first adjacent next concurrent request number;
[0040] The execution module is used to repeat the stress test, function fitting, determine the first adjacent next concurrency number, adjust the concurrency number to the first adjacent next concurrency number, and perform stress testing according to the first adjacent next concurrency number until the concurrency number corresponding to the peak TPS obtained by the stress test is consistent with the first adjacent next concurrency number, thereby obtaining the peak TPS.
[0041] In a third aspect, the present application provides an electronic device, comprising:
[0042] one or more processors;
[0043] The storage device is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the stress testing method as described above.
[0044] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer is caused to execute the stress testing method as described above.
[0045] Beneficial effects of the present invention:
[0046] The present application performs a stress test on the server to be tested to obtain the performance index and stress index of the server to be tested, performs function fitting based on the performance index and TPS to obtain a first fitting function, determines the first adjacent next concurrency based on the first fitting function and the concurrency number, adjusts the concurrency number to the first adjacent next concurrency number, repeats the stress test, function fitting, determination of the first adjacent next concurrency number, adjustment of the concurrency number to the first adjacent next concurrency number, and stress testing based on the first adjacent next concurrency number, until the concurrency number corresponding to the peak TPS is consistent with the first adjacent next concurrency number, and obtains the peak TPS, which solves the technical problem that when a fixed coefficient is used to determine the target concurrency number, the target concurrency number value obtained may be wrong for nonlinear scenarios, resulting in inaccurate test results.
[0047] This application does not require manual intervention during the stress testing process, and also solves the technical problem in the existing technology that requires a lot of manual intervention, resulting in a low level of intelligence.
[0048] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying drawings are incorporated into and constitute a part of the specification, illustrating embodiments consistent with the present application and, together with the specification, serving to explain the principles of the present application. It is obvious that the drawings described below are merely some embodiments of the present application, and a person of ordinary skill in the art can derive other drawings based on these drawings without inventive effort. In the drawings:
[0050] Figure 1 A flow chart of a pressure testing method according to an exemplary embodiment of the present application;
[0051] Figure 2 for Figure 1 A flowchart of determining the first adjacent next concurrent number in an exemplary embodiment in the embodiment shown;
[0052] Figure 3 for Figure 2 A flowchart of determining a maximum value of a fitted TPS in an exemplary embodiment in the embodiment shown;
[0053] Figure 4 for Figure 1 A flowchart of performing function fitting according to performance indicators and TPS in an exemplary embodiment is shown;
[0054] Figure 5 A flow chart of a pressure testing method shown as another exemplary embodiment of the present application;
[0055] Figure 6 for Figure 5 A flowchart of determining the second adjacent next concurrent number in an exemplary embodiment in the embodiment shown;
[0056] Figure 7 for Figure 6 A flowchart of determining a minimum value of a fitting concurrency number in an exemplary embodiment in the embodiment shown;
[0057] Figure 8 A flowchart of a pressure testing method according to a specific embodiment;
[0058] Figure 9 for Figure 8 The relationship diagram of indicators in the specific embodiment shown;
[0059] Figure 10 A block diagram of a pressure testing system shown as an exemplary embodiment of the present application;
[0060] Figure 11 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0061] The following describes the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art will readily appreciate the other advantages and benefits of the present invention from the disclosure herein. The present invention may also be implemented or applied through various other specific embodiments, and the various details in this specification may be modified or altered based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are intended only to illustrate the present invention and are not intended to limit the scope of protection of the present invention.
[0062] It should be noted that the illustrations provided in the following embodiments are merely schematic illustrations of the basic concept of the present invention. Therefore, the illustrations only show components related to the present invention and are not drawn according to the number, shape, and size of components in actual implementation. In actual implementation, the type, quantity, and proportion of each component may be changed arbitrarily, and the component layout may also be more complex.
[0063] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the embodiments of the present invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring the embodiments of the present invention.
[0064] See also Figure 1 , Figure 1 The present invention provides a flowchart of a stress testing method for an exemplary embodiment of the present application. The method is used to perform stress testing on software to solve the problem that related technologies use fixed coefficients to calculate the target concurrency. This method takes into account nonlinear boosting methods and improves the accuracy of test results to a certain extent. However, since it uses fixed coefficients to calculate the target concurrency, the target concurrency value obtained may be wrong in nonlinear scenarios, resulting in inaccurate test results.
[0065] like Figure 1 As shown, in an exemplary embodiment of the present application, the pressure testing method includes steps S110 to S150, which are described in detail as follows:
[0066] Step S110: Perform a stress test on the server to be tested to determine the performance index and stress index of the server to be tested;
[0067] It should be noted that performance indicators include CPU usage, disk usage, bandwidth usage, memory usage, disk I / O, and available connections, while stress indicators include concurrency and peak TPS (i.e., peak throughput).
[0068] For example, a preset boosting method may be used to perform a stress test on the server to be tested. The preset boosting method may be an 8-times increment method with a preset increment of 10 starting from a concurrency number of 1 and 10, and the duration of each stress test shall not be less than a preset duration threshold of 3 minutes.
[0069] Step S120: Perform function fitting based on the performance index and TPS to obtain a first fitting function;
[0070] Step S130: Determine the first adjacent next concurrent number based on the first fitting function and the concurrent number;
[0071] Step S140: Adjust the concurrent number to the first adjacent concurrent number;
[0072] Step S150. Repeat the stress test, function fitting, determining the first adjacent next concurrent number, adjusting the concurrent number to the first adjacent next concurrent number, and performing the stress test according to the first adjacent next concurrent number, until the concurrent number corresponding to the peak TPS obtained by the stress test is consistent with the first adjacent next concurrent number, and the peak TPS is obtained.
[0073] In the related art, a fixed coefficient is used to calculate the target concurrency. This method takes into account the nonlinear boosting method and improves the accuracy of the test results to a certain extent. After analyzing the above-mentioned related art, the inventor found that it uses a fixed coefficient to calculate the target concurrency. For nonlinear scenarios, the target concurrency value obtained may be wrong, resulting in inaccurate test results. Therefore, the inventor considered performing a stress test on the server to be tested, obtaining the performance index and stress index of the server to be tested, performing function fitting based on the performance index and TPS, obtaining a first fitting function, determining the first adjacent next concurrency based on the first fitting function and the concurrency, adjusting the concurrency to the first adjacent next concurrency, repeating the stress test, function fitting, determining the first adjacent next concurrency, adjusting the concurrency to the first adjacent next concurrency, and performing stress testing according to the first adjacent next concurrency until the concurrency corresponding to the peak TPS is consistent with the first adjacent next concurrency, obtaining the peak TPS, solving the technical problem that the target concurrency value obtained for nonlinear scenarios may be wrong, resulting in inaccurate test results.
[0074] See also Figure 2 , Figure 2 for Figure 1 The embodiment shown is a flowchart of determining the first adjacent next concurrency number in an exemplary embodiment.
[0075] like Figure 2 As shown, in an exemplary embodiment of the present application, Figure 1The process of determining the first adjacent next concurrent number in the embodiment shown includes steps S210 to S230, which are described in detail as follows:
[0076] Step S210: Determine the maximum value of the fitted TPS based on the first fitting function and each preset performance indicator threshold;
[0077] Step S220: Sort the concurrency numbers in the pressure index in chronological order to obtain a first concurrency number sequence;
[0078] Step S230: Determine the first adjacent next concurrent number based on the fitted TPS maximum value and the first latest concurrent number in the first concurrent number sequence.
[0079] For example, the first adjacent next concurrent number is determined according to formula (1):
[0080]
[0081] Where, P1 is the first adjacent concurrent number; A is the concurrent number corresponding to the maximum value of the fitted TPS; P0 is the first latest concurrent number; express The corresponding value is rounded up to an integer, for example, The corresponding value is 95.5, then It is 96.
[0082] See also Figure 3 , Figure 3 for Figure 2 The illustrated embodiment is a flow chart for determining a fitted TPS maximum value in an exemplary embodiment.
[0083] like Figure 3 As shown, in an exemplary embodiment of the present application, Figure 2 The process of determining the maximum value of the fitted TPS in the illustrated embodiment includes steps S310 and S320, which are described in detail as follows:
[0084] Step S310: Substitute each preset performance indicator threshold into the corresponding first fitting function to obtain the corresponding fitting TPS value;
[0085] Step S320: Compare the fitted TPS values to obtain the maximum fitted TPS value.
[0086] See also Figure 4 , Figure 4 for Figure 1 The embodiment shown is a flowchart of performing function fitting according to performance indicators and TPS in an exemplary embodiment.
[0087] like Figure 4 As shown, in an exemplary embodiment of the present application, Figure 1The process of performing function fitting based on the performance index and TPS in the illustrated embodiment includes steps S410 and S420, which are described in detail as follows:
[0088] Step S410. Sort the TPS in the performance indicators and pressure indicators in chronological order to obtain a performance indicator sequence and a TPS sequence;
[0089] Step S420: Select the latest performance indicator data and TPS data from the performance indicator sequence and TPS sequence, and perform function fitting.
[0090] Specifically, in this application, logistics function fitting is performed with the latest several performance indicators as the horizontal coordinates and the latest several TPS data (the number is the same as the number of performance indicators) as the vertical coordinates to obtain the first fitting function between each performance indicator and TPS (specifically the first logistics fitting function). For example, the last 10 performance indicators within the preset time length corresponding to each performance indicator are respectively fitted with TPS to obtain the corresponding first fitting function, namely, the first fitting function between CPU utilization (horizontal coordinate) and TPS (vertical coordinate), the first fitting function between disk utilization (horizontal coordinate) and TPS (vertical coordinate), the first fitting function between bandwidth utilization (horizontal coordinate) and TPS (vertical coordinate), the first fitting function between memory utilization (horizontal coordinate) and TPS (vertical coordinate), the first fitting function between disk I / O (horizontal coordinate) and TPS (vertical coordinate), and the first fitting function between the number of available connections (horizontal coordinate) and TPS (vertical coordinate).
[0091] See also Figure 5 , Figure 5 The flowchart of a pressure testing method is shown as another exemplary embodiment of the present application.
[0092] like Figure 5 As shown, in another exemplary embodiment of the present application, during the test process, a test report is obtained, the test report includes an error information status, the error information status includes the occurrence of error information, and the stress testing method further includes steps S510 to S550, which are described in detail as follows:
[0093] Step S510: Adjust the number of concurrent connections to the number of concurrent connections corresponding to the peak TPS.
[0094] Step S520: Based on the number of concurrent connections corresponding to the peak TPS, the server under test is stress-tested again, and a function is fitted based on the performance indicators in the test results and the number of concurrent connections in the stress indicators to obtain a second fitting function.
[0095] Step S530: Determine the second adjacent next concurrent number based on the second fitting function and the concurrent number;
[0096] Step S540: Adjust the concurrent number to the second adjacent concurrent number;
[0097] Step S550. According to the second adjacent next concurrency number, repeatedly perform stress testing on the server to be tested, perform function fitting, determine the second adjacent next concurrency number, adjust the concurrency number to the second adjacent next concurrency number, and perform stress testing until the second adjacent next concurrency number is consistent with the concurrency number obtained by the stress test and the error information status is that an error message appears, and the second adjacent next concurrency number is determined as the maximum concurrency number.
[0098] See also Figure 6 , Figure 6 for Figure 5 The embodiment shown is a flowchart of determining the second adjacent next concurrency number in an exemplary embodiment.
[0099] like Figure 6 As shown, in an exemplary embodiment of the present application, Figure 5 The process of determining the second adjacent next concurrent number in the illustrated embodiment includes steps S610 and S620, which are described in detail as follows:
[0100] See also Figure 6 , Figure 6 for Figure 5 The embodiment shown is a flowchart of determining the minimum value of the fitting concurrency in an exemplary embodiment.
[0101] like Figure 6 As shown, in an exemplary embodiment of the present application, Figure 5 The process of determining the minimum value of the number of concurrent fitting in the embodiment shown includes steps S610 to S630, which are described in detail as follows:
[0102] Step S610: Determine the minimum value of the concurrent fitting number based on the second fitting function and the upper thresholds of the preset performance indicators;
[0103] It should be noted that the preset performance indicator upper threshold is greater than or the TPS maximum value is greater than the corresponding preset performance indicator threshold;
[0104] Step S620: Sort the concurrency numbers in the stress indicators obtained by performing the stress test again in chronological order to obtain a second concurrency number sequence;
[0105] Step S630: Determine the second adjacent next concurrency number based on the minimum value of the fitted concurrency number and the second latest concurrency number in the second concurrency number sequence.
[0106] For example, the second adjacent next concurrent number is determined according to formula (2):
[0107]
[0108] Where P2 is the second adjacent concurrent number, B is the minimum value of the fitted concurrent number, and P′0 is the second latest concurrent number.
[0109] See also Figure 7 , Figure 7 for Figure 6 The embodiment shown is a flowchart of determining the minimum value of the fitting concurrency in an exemplary embodiment.
[0110] See also Figure 7 , Figure 7 The figure is a flow chart of a pressure testing method according to a specific embodiment.
[0111] like Figure 7 As shown, in an exemplary embodiment, Figure 6 The process of determining the minimum value of the concurrent fitting number in the embodiment shown includes steps S710 to S720, which are described in detail as follows:
[0112] Step S710: Substitute the upper threshold of each preset performance indicator into the corresponding second fitting function to obtain the corresponding fitting concurrency number;
[0113] Step S720: Compare the concurrency numbers of the fittings to obtain the minimum concurrency number of the fittings.
[0114] See also Figure 8 , Figure 8 The figure is a flow chart of a pressure testing method according to a specific embodiment.
[0115] like Figure 8 As shown, in a specific embodiment, the steps of the pressure testing method are as follows:
[0116] Use the preset boost method to perform stress testing on the server to be tested, and determine the performance indicators and stress indicators of the server to be tested, such as Figure 9 As shown, performance indicators include CPU usage, disk usage, bandwidth usage, memory usage, disk I / O, and available connections. Stress indicators include concurrency and peak TPS (i.e., peak throughput). The preset boosting method can be 8 increments of 10 with a preset increment of 10 starting from concurrency 1 and 10. The duration of each stress test shall not be less than the preset duration threshold of 5 minutes.
[0117] Sort the TPS in the performance indicators and pressure indicators in chronological order to obtain the performance indicator sequence and TPS sequence;
[0118] Selecting the latest performance indicator data and TPS data from the performance indicator sequence and the TPS sequence, and performing function fitting. Specifically, performing logistics function fitting with the latest performance indicators as the abscissa and the latest TPS data (the number is the same as the number of performance indicators) as the ordinate, to obtain a first fitting function (specifically, a first logistics fitting function) between each performance indicator and the TPS. For example, performing function fitting with the latest 10 performance indicators within a preset time period corresponding to each performance indicator and the TPS, respectively, to obtain respective corresponding first fitting functions, namely, a first fitting function between CPU usage (abscissa) and TPS (ordinate), a first fitting function between disk usage (abscissa) and TPS (ordinate), a first fitting function between bandwidth usage (abscissa) and TPS (ordinate), a first fitting function between memory usage (abscissa) and TPS (ordinate), a first fitting function between disk I / O (abscissa) and TPS (ordinate), and a first fitting function between the number of available connections (abscissa) and TPS (ordinate);
[0119] Determine the maximum fitted TPS value based on the first fitting function and each preset performance indicator threshold. Specifically, substitute each preset performance indicator threshold into the corresponding first fitting function to obtain the corresponding fitted TPS value.
[0120] Compare the fitted TPS values and obtain the maximum fitted TPS value;
[0121] Sort the concurrency numbers in the pressure indicators in chronological order to obtain the first concurrency number sequence;
[0122] Based on the fitted TPS maximum value and the first latest concurrent number in the first concurrent number sequence, the first adjacent next concurrent number is determined according to formula (1):
[0123]
[0124] Where, P1 is the first adjacent concurrent number; A is the concurrent number corresponding to the maximum value of the fitted TPS; P0 is the first latest concurrent number; express The corresponding value is rounded up to an integer, for example, The corresponding value is 95.5, then is 96;
[0125] Adjust the number of concurrent connections to the next adjacent number of concurrent connections;
[0126] Repeat the stress test and function fitting based on the first adjacent next concurrency number, determine the first adjacent next concurrency number, adjust the concurrency number to the first adjacent next concurrency number, and perform the stress test again until the concurrency number corresponding to the peak TPS obtained from the stress test (i.e., the estimated maximum TPS) is consistent with the first adjacent next concurrency number, and the peak TPS is obtained;
[0127] Adjust the number of concurrent connections to the number corresponding to the peak TPS;
[0128] According to the number of concurrency corresponding to the peak TPS, the server to be tested is stress tested again. During the test, a test report is obtained, which includes the error information status. The error information status includes the occurrence of error information. Function fitting is performed based on the performance indicators in the test results and the concurrency in the stress indicators to obtain a second fitting function. Specifically, the latest performance indicator data is used as the horizontal axis and the latest concurrent data (the number is the same as the number of performance indicators) is used as the vertical axis to perform logistics function fitting to obtain the second fitting function between each performance indicator and the concurrency (specifically, the second logistics fitting function). For example, each performance indicator is The last 10 performance indicators within the preset time period are respectively fitted with the concurrency number to obtain the corresponding second fitting functions, namely, the second fitting function between CPU usage (abscissa) and concurrency number (ordinate), the second fitting function between disk usage (abscissa) and concurrency number (ordinate), the second fitting function between bandwidth usage (abscissa) and concurrency number (ordinate), the second fitting function between memory usage (abscissa) and concurrency number (ordinate), the second fitting function between disk I / O (abscissa) and concurrency number (ordinate), and the second fitting function between the number of available connections (abscissa) and concurrency number (ordinate);
[0129] Substitute each preset performance indicator upper limit threshold into the corresponding second fitting function to obtain the corresponding fitting concurrency number, and the preset performance indicator upper limit threshold is greater than or the maximum TPS value is greater than the corresponding preset performance indicator threshold;
[0130] Compare the concurrency numbers of each fit and get the minimum value of the concurrency number of fit;
[0131] Sort the concurrency numbers in the stress indicators obtained by the second stress test in chronological order to obtain a second concurrency number sequence;
[0132] Based on the minimum value of the fitted concurrent number and the second latest concurrent number in the second concurrent number sequence, the second adjacent next concurrent number is determined according to formula (2):
[0133]
[0134] Where P2 is the second adjacent concurrent number, B is the minimum value of the fitted concurrent number; P′0 is the second latest concurrent number;
[0135] Adjust the number of concurrent connections to the next adjacent number of concurrent connections;
[0136] According to the second adjacent next concurrency number, repeatedly perform stress testing on the server to be tested, perform function fitting, determine the second adjacent next concurrency number, adjust the concurrency number to the second adjacent next concurrency number, and perform stress testing until the second adjacent next concurrency number (that is, the estimated maximum concurrency) is consistent with the concurrency number obtained by this stress test and the error information status is that an error message appears, and the second adjacent next concurrency number is determined as the maximum concurrency number.
[0137] See also Figure 10 , Figure 10 A block diagram of a stress testing system according to an exemplary embodiment of the present application.
[0138] like Figure 10 As shown, the pressure testing system M1000 of the embodiment of the present application includes:
[0139] The test module M1010 is used to perform stress testing on the server to be tested and determine the performance index and stress index of the server to be tested;
[0140] It should be noted that pressure indicators include concurrency and TPS;
[0141] Function fitting module M1020, used to perform function fitting according to the performance index and TPS to obtain a first fitting function;
[0142] A determination module M1030 is configured to determine a first adjacent next concurrent number based on the first fitting function and the concurrent number;
[0143] An adjustment module M1040 is configured to adjust the concurrency number to the first adjacent next concurrency number;
[0144] Execution module M1050 is used to repeat stress testing, function fitting, determining the first adjacent next concurrency number, adjusting the concurrency number to the first adjacent next concurrency number, and performing stress testing according to the first adjacent next concurrency number until the concurrency number corresponding to the peak TPS obtained by the stress test is consistent with the first adjacent next concurrency number, thereby obtaining the peak TPS.
[0145] It should be noted that the pressure testing system provided in the above embodiment and the pressure testing method provided in the above embodiment are of the same concept. The specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here. In actual applications, the pressure testing system provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0146] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the stress testing method provided in the above-mentioned embodiments.
[0147] Figure 11 The following is a schematic diagram showing the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application. Figure 11 The computer system 1100 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0148] like Figure 11 As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage part 1108 into the random access memory (RAM) 1103, such as executing the method described in the above embodiment. Various programs and data required for system operation are also stored in the RAM 1103. The CPU 1101, ROM 1102 and RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0149] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, and the like; an output section 1107 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 1108 including a hard disk and the like; and a communication section 1109 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. Removable media 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1110 as needed, so that computer programs read therefrom can be installed into the storage section 1108 as needed.
[0150] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1109, and / or installed from a removable medium 1111. When the computer program is executed by the central processing unit (CPU) 1101, the various functions defined in the system of the present application are executed.
[0151] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0152] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0153] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.
[0154] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon. When executed by a computer processor, the computer program causes the computer to perform the Bluetooth positioning antenna detection method described above. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently and not be incorporated into the electronic device.
[0155] Another aspect of the present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the Bluetooth positioning antenna detection method provided in each of the above embodiments.
[0156] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the present invention. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, any equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical principles disclosed herein are intended to be covered by the claims of the present invention.
Claims
1. A stress testing method, characterized in that: The stress testing method includes: Perform stress testing on the server to be tested to determine the performance indicators and stress indicators of the server to be tested, including the number of concurrent connections and TPS; Perform function fitting based on the performance index and TPS to obtain the first fitting function; Determine the maximum value of the fitted TPS based on the first fitting function and each preset performance indicator threshold; Sort the concurrency numbers in the pressure indicators in chronological order to obtain the first concurrency number sequence; Determine the first adjacent next concurrent number based on the fitted TPS maximum value and the first latest concurrent number in the first concurrent number sequence; Adjust the number of concurrent connections to the next adjacent number of concurrent connections; Repeat the stress test and function fitting based on the first adjacent next concurrency number, determine the first adjacent next concurrency number, adjust the concurrency number to the first adjacent next concurrency number, and perform the stress test again until the concurrency number corresponding to the peak TPS obtained from the stress test is consistent with the first adjacent next concurrency number, thus obtaining the peak TPS. During the test, a test report is obtained, wherein the test report includes an error information status, wherein the error information status includes the occurrence of an error information. The stress testing method further includes: Adjust the number of concurrent connections to the number corresponding to the peak TPS; According to the concurrency number corresponding to the peak TPS, the server to be tested is stress tested again, and a function is fitted based on the performance index in the test result and the concurrency number in the stress index to obtain a second fitting function; Determine the second adjacent next concurrent number based on the second fitting function and the concurrent number; Adjust the number of concurrent connections to the next adjacent number of concurrent connections; According to the second adjacent next concurrency number, repeatedly perform stress testing on the server to be tested, perform function fitting, determine the second adjacent next concurrency number, adjust the concurrency number to the second adjacent next concurrency number, and perform stress testing until the second adjacent next concurrency number is consistent with the concurrency number obtained by the stress test and the error information status is that an error message appears, and the second adjacent next concurrency number is determined as the maximum concurrency number.
2. The pressure testing method according to claim 1, wherein: Determine the maximum value of the fitted TPS, including: Substitute each preset performance indicator threshold into the corresponding first fitting function to obtain the corresponding fitting TPS value; Compare the fitted TPS values and obtain the maximum fitted TPS value.
3. The pressure testing method according to claim 1, wherein: Function fitting based on performance indicators and TPS includes: Sort the TPS in the performance indicators and pressure indicators in chronological order to obtain the performance indicator sequence and TPS sequence; The latest performance index data and TPS data are selected from the performance index sequence and TPS sequence to perform function fitting.
4. The pressure testing method according to claim 1, wherein: Determine the next concurrency count for the second adjacent session, including: Determining a minimum number of concurrent fits based on the second fitting function and each preset performance indicator upper threshold, wherein the preset performance indicator upper threshold is greater than or equal to the corresponding preset performance indicator threshold; Sort the concurrency numbers in the stress indicators obtained by the second stress test in chronological order to obtain a second concurrency number sequence; The second adjacent next concurrency number is determined based on the minimum value of the fitted concurrency number and the second latest concurrency number in the second concurrency number sequence.
5. The pressure testing method according to claim 4, wherein: Determine the minimum number of concurrent connections, including: Substitute the upper threshold of each preset performance indicator into the corresponding second fitting function to obtain the corresponding fitting concurrency number; Compare the concurrency numbers of each fit and get the minimum concurrency number of fit.
6. A pressure testing system, characterized in that: The pressure testing system comprises: The testing module is used to perform stress testing on the server to be tested and determine the performance indicators and stress indicators of the server to be tested, wherein the stress indicators include the number of concurrent connections and TPS; A function fitting module is used to perform function fitting based on the performance index and TPS to obtain a first fitting function; The determination module is used to determine the maximum value of the fitted TPS based on the first fitting function and each preset performance indicator threshold; sort the concurrency numbers in the pressure indicator in chronological order to obtain a first concurrency number sequence; determine the first adjacent next concurrency number based on the maximum value of the fitted TPS and the first latest concurrency number in the first concurrency number sequence; during the test, obtain a test report, the test report includes an error information status, the error information status includes the occurrence of an error message, the determination module is further used to adjust the concurrency number to the concurrency number corresponding to the peak TPS; according to the concurrency number corresponding to the peak TPS, perform a stress test on the server to be tested again. , and perform function fitting based on the performance indicators in the test results and the concurrency number in the stress indicators to obtain a second fitting function; based on the second fitting function and the concurrency number, determine the second adjacent next concurrency number; adjust the concurrency number to the second adjacent next concurrency number; based on the second adjacent next concurrency number, repeat the stress test on the server to be tested, perform function fitting, determine the second adjacent next concurrency number, adjust the concurrency number to the second adjacent next concurrency number, and perform stress testing until the second adjacent next concurrency number is consistent with the concurrency number obtained in the stress test and the error information status is that an error message appears, and determine the second adjacent next concurrency number as the maximum concurrency number; An adjustment module, configured to adjust the number of concurrent requests to the first adjacent next concurrent request number; The execution module is used to repeat the stress test, function fitting, determine the first adjacent next concurrency number, adjust the concurrency number to the first adjacent next concurrency number, and perform stress testing according to the first adjacent next concurrency number until the concurrency number corresponding to the peak TPS obtained by the stress test is consistent with the first adjacent next concurrency number, thereby obtaining the peak TPS.
7. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the stress testing method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the stress testing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Application system performance testing method and device, computer equipment and storage media
CN107329881A
Automated determination of maximum service throughput
US9647919B1