Distributed pressure testing method and related device
Through the distributed pressure testing method, using multiple presses to work in parallel, the problem that a single press cannot simulate high concurrency scenarios is solved, and effective testing and data analysis of the server's high concurrency capabilities are achieved.
Patent Information
- Application Number
- CN202411879806.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-25
AI Technical Summary
The hardware resources and operating system performance tuning capabilities of a single press limit the maximum number of user concurrency it can simulate, and cannot accurately simulate high concurrency scenarios in the real world.
The distributed pressure testing method is adopted, by determining the target press identifier from multiple press identifiers, obtaining its pressurization parameters, and allocating scenario test tasks according to the pressurization strategy within the preset pressure measurement time. Multiple presses work in parallel to overcome the concurrency limit of a single unit.
The high concurrency capability test of the server is realized, the concurrency limitation of a single press is overcome, the accuracy and real-time performance of data analysis are improved, and the high concurrency scenarios in the real world can be better simulated.
Smart Images

Figure CN119690795A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing technology, and in particular to a distributed pressure testing method and related devices. Background Art
[0002] Stress testing is a key part of performance testing. Stress testing can test the behavior and performance of the server under high load conditions.
[0003] The hardware resources of a single test machine (such as CPU (Central Processing Unit), memory, network bandwidth) and the performance tuning capabilities of the operating system limit the maximum number of concurrent users that can be simulated. If the test requirements exceed this limit, a single test machine cannot provide enough load and cannot accurately simulate high-concurrency scenarios in the real world. Summary of the invention
[0004] In view of the above problems, the present application provides a distributed stress testing method and related devices to achieve the purpose of stress testing in high concurrency scenarios. The specific scheme is as follows:
[0005] The first aspect of the present application provides a distributed stress testing method, comprising:
[0006] Determine multiple target press identifiers from multiple press identifiers whose operating status is an idle state;
[0007] From the preset correspondence between the press identification and the press information, searching for the target press information corresponding to the plurality of target press identifications, the press information including the communication address of the press, the user name of the press and the password of the press;
[0008] Obtain stress parameters corresponding to the target stress machine identifiers, wherein the stress parameters include the number of concurrent users, scenario test tasks, preset stress test duration, and stress strategy. The scenario test tasks include the communication address of the server to be tested and the operation request;
[0009] For each of the target stress machine identifiers, the scenario test tasks are allocated to the stress machine corresponding to the target stress machine identifier according to the stress test strategy within the preset stress test duration; wherein the total number of the scenario test tasks allocated to the stress machine does not exceed the number of concurrent users;
[0010] For each target press machine identifier, obtain an execution result file fed back by the press machine corresponding to the target press machine identifier, wherein the execution result file includes a plurality of response results, and the response results are response results of the server in response to the operation request sent by the press machine; the press machines corresponding to the plurality of target press machine identifiers pressurize the same server;
[0011] Based on the execution result files respectively corresponding to the multiple target press machine identifiers, the high concurrency capability information of the server is obtained.
[0012] In a possible implementation, the method further includes:
[0013] Obtaining a first resource usage rate of the server;
[0014] Obtain second resource usage rates respectively corresponding to a plurality of target press identifiers;
[0015] Obtaining an average response time of the operation request of the server and an error rate of the operation request;
[0016] For each of the target press machine identifiers, if the actual stress testing duration of the press machine corresponding to the target press machine identifier is less than the preset stress testing duration and satisfies a first preset condition, stop allocating the scenario test task to the press machine;
[0017] Wherein, the first preset condition is that the first resource usage rate exceeds a first preset range or the second resource usage rate of the target press identification exceeds a second preset range or the average response time is greater than or equal to a third preset threshold or the error rate is greater than or equal to a fourth preset threshold;
[0018] For each of the target press machine identifiers, if the actual stress testing duration of the press machine corresponding to the target press machine identifier is less than the preset stress testing duration and satisfies the second preset condition, keep allocating the scenario test task to the press machine corresponding to the target press machine identifier according to the stress strategy;
[0019] Among them, the second preset condition is that if the first resource utilization rate belongs to the first preset range and the second resource utilization rate of the target press identification belongs to the second preset range and the average response time is less than the third preset threshold and the error rate is less than the fourth preset threshold.
[0020] In a possible implementation, the pressurizing parameters corresponding to the plurality of target press machine identifiers respectively, the step of obtaining the pressurizing parameters corresponding to the plurality of target press machine identifiers respectively comprises:
[0021] Setting the number of concurrent users through the first user interface;
[0022] Setting the preset stress testing duration through the first user interface;
[0023] The pressurization strategy is set through the first user interface.
[0024] In a possible implementation, the step of setting the pressurization strategy through the first user interface includes:
[0025] Selecting a pressure mode through the first user interface, wherein the pressure mode includes linear increase, step increase, and configuration using a JMX script;
[0026] Controlling the first user interface to display pressure parameters corresponding to the pressure mode;
[0027] The pressure parameters are set through the first user interface to obtain the pressure strategy.
[0028] In a possible implementation, the method of presetting the scenario test task includes:
[0029] Creating a scenario test task template through a second user interface;
[0030] Displaying the task parameters of the scenario test task module through the second user interface;
[0031] The task parameters are set through the second user interface to obtain the scenario testing task.
[0032] A second aspect of the present application provides a distributed pressure testing device, comprising:
[0033] A first determination module is used to determine a plurality of target press machine identifiers from a plurality of press machine identifiers whose operating status is an idle state;
[0034] A search module, used for searching for target press information corresponding to a plurality of target press identifiers respectively from a preset correspondence relationship between press identifiers and press information, wherein the press information includes a communication address of the press, a user name of the press, and a password of the press;
[0035] A first acquisition module is used to obtain the pressure parameters corresponding to the multiple target pressure machine identifiers, wherein the pressure parameters include the number of concurrent users, scenario test tasks, preset pressure test duration and pressure strategy, and the scenario test tasks include the communication address of the server to be tested and the operation request;
[0036] A stress distribution module, for allocating the scenario test tasks to the stress machine corresponding to the target stress machine identifier according to the stress testing strategy within the preset stress testing duration for each target stress machine identifier; wherein the total number of scenario test tasks allocated to the stress machine does not exceed the number of concurrent users;
[0037] The second acquisition module is used to acquire, for each target press machine identifier, an execution result file fed back by the press machine corresponding to the target press machine identifier, wherein the execution result file includes a plurality of response results, and the response results are response results of the server in response to the operation request sent by the press machine; the press machines corresponding to the plurality of target press machine identifiers pressurize the same server;
[0038] The third acquisition module is used to acquire the high concurrency capability information of the server based on the execution result files respectively corresponding to the multiple target press identifiers.
[0039] In a possible implementation, the method further includes:
[0040] A fourth acquisition module, used to acquire a first resource usage rate of the server;
[0041] A fifth acquisition module, used for acquiring second resource usage rates respectively corresponding to the plurality of target press machine identifiers;
[0042] A sixth acquisition module, used to acquire an average response time of the operation request of the server and an error rate of the operation request;
[0043] A stop stress test module is used for, for each target stress machine identifier, if the actual stress test duration of the stress machine corresponding to the target stress machine identifier is less than the preset stress test duration and satisfies a first preset condition, to stop allocating the scenario test task to the stress machine;
[0044] Wherein, the first preset condition is that the first resource usage rate exceeds a first preset range or the second resource usage rate of the target press identification exceeds a second preset range or the average response time is greater than or equal to a third preset threshold or the error rate is greater than or equal to a fourth preset threshold;
[0045] A continue stressing module is used for, for each of the target press machine identifiers, if the actual stress testing duration of the press machine corresponding to the target press machine identifier is less than the preset stress testing duration and satisfies a second preset condition, to continue allocating the scenario test task to the press machine corresponding to the target press machine identifier according to the stressing strategy;
[0046] Among them, the second preset condition is that if the first resource utilization rate belongs to the first preset range and the second resource utilization rate of the target press identification belongs to the second preset range and the average response time is less than the third preset threshold and the error rate is less than the fourth preset threshold.
[0047] A third aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the distributed stress testing method of the above-mentioned first aspect or any implementation of the first aspect.
[0048] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0049] The memory is used to store computer programs;
[0050] The processor is used to execute the computer program so that the electronic device can implement the distributed stress testing method of the above-mentioned first aspect or any implementation method of the first aspect.
[0051] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the distributed stress testing method of the above-mentioned first aspect or any implementation of the first aspect.
[0052] By means of the above technical scheme, the present application provides a distributed stress testing method, which determines multiple target press machine identifiers from multiple press machine identifiers whose running status is idle; each target press machine identifier corresponds to a press machine; the press machine information has been set in advance for each press machine identifier, so the target press machine information corresponding to multiple target press machine identifiers can be obtained. After determining the target press machine identifier, the pressurization parameters of the target press machine identifier can be obtained; thus, the scenario test tasks can be assigned to the corresponding press machines based on the pressurization parameters of each target press machine identifier. The present application uses multiple press machines to work in parallel, overcoming the concurrency limitation of a single press machine. For each target press machine identifier, the execution result files respectively fed back by the press machine corresponding to the target press machine identifier are obtained; based on the execution result files respectively corresponding to the multiple target press machine identifiers, the high concurrency capability information of the server is obtained. The present application centrally manages and analyzes the execution result files of multiple press machines, eliminating the need for the tester to manually collect and organize data, thereby improving the accuracy and real-time performance of data analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0054] Figure 1 A schematic diagram of a system architecture provided for this application;
[0055] Figure 2 A schematic diagram of an optional hardware structure of an electronic device 100 provided in this application;
[0056] Figure 3 A schematic diagram of the structure of a server 200 provided in this application;
[0057] Figure 4 A schematic diagram of a distributed stress testing method provided in this application;
[0058] Figure 5 A schematic diagram of an implementation method of adding a user interface to a press provided in the present application;
[0059] Figure 6 A schematic diagram of an implementation method of a visual report provided in this application;
[0060] Figure 7 A schematic diagram of an implementation method of a first user interface provided in the present application;
[0061] Figure 8 A schematic diagram of pressure parameters when the pressure application mode provided in this application is a step-by-step increase;
[0062] Fig. 9 Provided for this application Figure 8 A schematic diagram of a pressurization curve corresponding to the pressurization strategy shown;
[0063] Fig.10 The pressure mode provided for this application is a schematic diagram of pressure parameters when using JMX script configuration;
[0064] Fig.11 A schematic diagram of an implementation of the second user interface provided in this application;
[0065] Fig.12 A schematic diagram of the structure of a distributed pressure testing device provided in this application. DETAILED DESCRIPTION
[0066] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0067] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0068] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0069] Stress testing can detect the behavior and performance of a server under high load conditions. There are some limitations in the stress testing methods in the related art, especially in the face of scenarios that require large-scale concurrent testing. The limitations of the stress testing methods in the related art are explained below.
[0070] The hardware resources (such as CPU, memory, network bandwidth) and performance tuning capabilities of a single test machine limit the maximum number of concurrent users that can be simulated. When the test requirements exceed this limit, a single test machine cannot provide enough load and cannot accurately simulate high-concurrency scenarios in the real world.
[0071] The limitations of a single stress machine become particularly obvious when it is necessary to simulate tens of thousands or even hundreds of thousands of users accessing the server at the same time. This large-scale concurrent testing is crucial for evaluating the scalability, stability, and fault tolerance of the server, but the single stress machine test in related technologies cannot provide such a testing environment.
[0072] In the related art, in order to overcome the concurrency limitation of a single press, multiple presses can be used to work in parallel. However, there is a lack of effective coordination and communication mechanisms between these presses, which leads to scattered test results and difficulty in centralized management and analysis. Testers need to manually collect and integrate this data, which is not only time-consuming and labor-intensive, but also prone to errors, affecting the accuracy and real-time nature of data analysis. Due to the lack of effective data aggregation and analysis tools, it is difficult for testers to monitor the test progress and server performance in real time, and it is impossible to adjust the pressure strategy in time, such as reducing the load when the server is close to the collapse point or increasing the load when the server performs well.
[0073] It is understandable that during business peak periods, such as the "Double Eleven" and "Black Friday" promotions of e-commerce, the number of concurrent requests that the server needs to handle surges. If the stress test cannot accurately simulate this high-concurrency scenario, it may affect business continuity or even cause service interruptions.
[0074] In order to solve the above problems, the present application discloses a distributed stress testing method, which can coordinate multiple stress machines to work together and provide a unified data collection and analysis platform to improve the efficiency and accuracy of the test, thereby better simulating the high-concurrency scenarios in the real world and providing strong data support for server performance optimization and expansion.
[0075] See also Figure 1 , Figure 1 A schematic diagram of a system architecture is shown. The system may include an electronic device 100, a server 200 and a plurality of presses 300.
[0076] Among them, an application or a webpage may be installed on the electronic device 100, and the application and the webpage may provide an interface, and the electronic device 100 may receive relevant parameters input by the user on the interface, such as pressurization parameters, and send the parameters to the multiple press machines 300. The multiple press machines 300 may access the server 200 respectively based on the received parameters; the multiple press machines 300 return the response results fed back by the server 200 to the electronic device 100.
[0077] Exemplarily, the server 200 is a server to be tested, and exemplary, the server 200 may be a web server. Exemplarily, a user may access the server 200 through a client. A plurality of press machines 300 may simulate user behavior and send operation requests to the server 200.
[0078] Next describe Figure 1 The product form of the electronic device 100;
[0079] The electronic device 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any limitation on this.
[0080] Figure 2 An optional hardware structure diagram of the electronic device 100 is shown.
[0081] refer to Figure 2As shown, the electronic device 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), an earphone jack 163 (optional), a processor 170, an external interface 180, a power supply 190 and other components. Those skilled in the art will appreciate that Figure 2 The electronic device is merely an example and does not limit the electronic device, and may include more or less components than those shown in the figure, or may combine certain components, or may include different components.
[0082] The input unit 130 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device. Specifically, the input unit 130 may include a touch screen 131 (optional) and / or other input devices 132. The touch screen 131 can collect the user's touch operations on or near it (such as the user's operation on or near the touch screen using any suitable object such as fingers, joints, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch screen can detect the user's touch action on the touch screen, convert the touch action into a touch signal and send it to the processor 170, and can receive and execute the command sent by the processor 170; the touch signal at least includes the touch point coordinate information. The touch screen 131 can provide an input interface and an output interface between the electronic device 100 and the user. In addition, the touch screen can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch screen 131, the input unit 130 can also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0083] Among them, the input device 132 can receive input data and the like.
[0084] The display unit 140 can be used to display information input by the user or information provided to the user, various menus of the electronic device 100, interactive interfaces, file display and / or playback of any multimedia file. In the embodiment of the present application, the display unit 140 can be used to display interfaces, processing results, etc.
[0085] The memory 120 can be used to store instructions and data. The memory 120 can mainly include an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files, texts, etc.; the instruction storage area can store software units such as operating systems, applications, instructions required for at least one function, or their subsets and extensions. It can also include a non-volatile random access memory; provide the processor 170 with hardware, software and data resources including management of computing and processing equipment, and support control software and applications. It is also used for the storage of multimedia files, and the storage of running programs and applications.
[0086] The processor 170 is the control center of the electronic device 100. It uses various interfaces and lines to connect various parts of the entire electronic device 100. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it executes various functions of the electronic device 100 and processes data, thereby controlling the electronic device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 170. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips. The processor 170 may also be used to generate corresponding operation control signals, send them to corresponding components of the computing and processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that each functional module therein performs corresponding functions, thereby controlling the corresponding components to act according to the requirements of the instructions.
[0087] Among them, the memory 120 can be used to store software codes related to the distributed stress testing method, the processor 170 can execute the steps of the distributed stress testing method, and can also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to implement corresponding functions.
[0088] The radio frequency unit 110 (optional) can be used for receiving and sending information or receiving and sending signals during a call, for example, after receiving the downlink information of the base station, it is sent to the processor 170 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the radio frequency unit 110 can also communicate with network devices and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.
[0089] In this embodiment of the present application, the RF unit 110 can send data to the server 200 and receive processing results sent by the server 200.
[0090] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.
[0091] The electronic device 100 also includes a power source 190 (such as a battery) for supplying power to various components. Preferably, the power source can be logically connected to the processor 170 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
[0092] The electronic device 100 also includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the electronic device 100 to communicate with other devices, or may be used to connect a charger to charge the electronic device 100 .
[0093] Although not shown, the electronic device 100 may also include a flash, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied to Figure 2 In the electronic device 100 shown.
[0094] Next describe Figure 1 The product form of the server 200;
[0095] Figure 3 A structural diagram of a server 200 is provided, such as Figure 3 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.
[0096] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0097] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0098] The memory 204 may include a volatile memory, such as a random access memory (RAM). The memory 204 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0099] It should be understood that the above-mentioned electronic device 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned electronic device 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0100] Reference Figure 4 , Figure 4 A schematic diagram of a distributed stress testing method provided in an embodiment of the present application is shown in FIG. Figure 4 As shown in the figure, a distributed stress testing method provided in an embodiment of the present application may include steps S401 to S406, and these steps are described in detail below.
[0101] Step S401: Determine a plurality of target press identifiers from a plurality of press identifiers whose operating status is an idle status.
[0102] The present application adopts a distributed pressure distribution strategy, and the above-mentioned multiple presses and the electronic device executing the present application constitute a pressure distribution cluster, in which the electronic device is the master node and the multiple presses are slave nodes.
[0103] Exemplarily, the stress test parameters can be set through the user interface of the electronic device, including selecting the target press machine identifier of the press machine (slave node) participating in the test, etc. After the electronic device (master node) obtains these stress test parameters, it allocates the overall concurrent tasks to each press machine slave node according to the test requirements and configuration.
[0104] It is understandable that after the pressure test is completed, the press can be released to save resources.
[0105] For example, some test scenarios have a large stress test scale and require a large number of concurrent users, such as 1 million, which may require more than 10 stress machines. Some test scenarios have a small stress test scale and may require a few stress machines; in summary, different test scenarios may require different numbers of stress machines; if a corresponding number of stress machines are configured for each test scenario and used as resident resources, it will lead to a waste of resources. Because the stress test for the same test scenario may only take one month in a year. In order to save resources and unify management, multiple stress machines can be shared. After the stress test is completed, the stress machine can be released, that is, the operating status of the stress machine identifier of the released stress machine is idle; the operating status of the stress machine identifier of the unreleased stress machine is running.
[0106] The following example illustrates the test scenario.
[0107] The shopping scenario includes operations such as selecting products, adding to a shopping cart, and submitting an order. For example, selecting products, adding to a shopping cart, and submitting an order correspond to different test scenarios. For example, selecting products, adding to a shopping cart, and submitting an order may correspond to the same test scenario; selecting products, adding to a shopping cart, and submitting an order are different test steps in the same test scenario.
[0108] Step S402: searching for target press information corresponding to a plurality of target press identifiers from a preset correspondence between press identifiers and press information, wherein the press information includes a press communication address, a press user name, and a press password.
[0109] For example, as the scale of the test scenario increases or decreases, presses can be added or deleted locally.
[0110] In the embodiment of the present application, the press machine can be added or deleted through the interface displayed by the electronic device. Figure 5 Shown is a schematic diagram of an implementation method of adding a user interface to a press provided in an embodiment of the present application.
[0111] For example, by Figure 5 The user interface shown can set the press information of the press. Exemplarily, the press information includes but is not limited to: the press name, the communication address of the press, the user name of the press, and the password of the press.
[0112] Figure 5 Here, "Node Name" represents the name of the press, "Node Address" represents the communication address of the press, "System User Name" represents the user name of the press, and "System Password" represents the password of the press.
[0113] For example, the node address may be an IP (Internet Protocol Address) address. The electronic device may interact with the press machine through the “node address”.
[0114] For example, the press machine can be logged in via a “system user name” and a “system password”.
[0115] Step S403: Obtain stress parameters corresponding to the target stress machine identifiers, wherein the stress parameters include the number of concurrent users, scenario test tasks, preset stress test duration and stress strategy, and the scenario test tasks include the communication address of the server to be tested and the operation request.
[0116] For example, the number of concurrent users of different presses can be the same or different. The pressure strategies that do not pass the presses can be the same or different. The preset pressure test durations of different presses can be the same or different. The scenario test tasks of different presses can be the same or different.
[0117] The following is an explanation of each name.
[0118] The number of concurrent users refers to the number of concurrent users simulated in the stress test. This number can represent the total number of virtual users that send requests to the server at the same time, which is used to simulate the possible user load in the real world. The number of concurrent users is a key parameter in stress testing, which directly affects the scale and intensity of the test.
[0119] The operation request in the scenario test task refers to the specific test case or test script that needs to be executed in the stress test. The operation request usually includes a series of predefined requests that simulate the actions that users may perform in actual use, such as browsing web pages, searching for content, submitting forms, etc. The design of the operation request needs to be customized according to the actual business logic and user behavior of the server. Exemplarily, the operation request refers to the specific request that simulates user behavior in the scenario test task. The operation request can include HTTP (HyperText Transfer Protocol) requests, database queries, API (Application Programming Interface) calls, etc. These requests are designed based on actual business operations to ensure that the test can cover the key functions and performance bottlenecks of the server.
[0120] The preset stress test duration refers to the test duration set before the stress test begins. The preset stress test duration determines how long the test will run, and this parameter is crucial for evaluating the performance and stability of the server under long-term operation. The preset stress test duration can be determined based on the test purpose and server characteristics. For example, it may be necessary to simulate a business peak within a day, or test the performance of the server after running continuously for 8 hours.
[0121] The stress strategy refers to how to gradually increase the load during stress testing. The stress strategy can be linear, that is, evenly increase the number of users, or non-linear, such as step-by-step or step-by-step increments, that is, increase the number of users at different rates in different time periods. The choice of stress strategy will affect the accuracy of the test and the consumption of server resources, and needs to be formulated according to the test objectives and server characteristics.
[0122] The communication address of the server to be tested refers to the network address of the server, including the IP address and port number, which the press will use to locate and connect to the server. The communication address is the basis for network communication and ensures that the press can correctly send operation requests to the server.
[0123] Step S404: for each of the target stress machine identifiers, allocate the scenario test tasks to the stress machine corresponding to the target stress machine identifier according to the stress testing strategy within the preset stress testing duration; wherein the total number of the scenario test tasks allocated to the stress machine does not exceed the number of concurrent users.
[0124] Since the presses corresponding to the multiple target press machine identifiers apply pressure to the same server, the sum of the numbers of concurrent users of the presses corresponding to the multiple target press machine identifiers is the number of concurrent users for the server.
[0125] Assuming that the number of multiple target press machine identifiers is 3, the number of press machines is 3, and assuming that the number of concurrent users of each press machine is 5000, the number of concurrent users of the server is 15000. Multiple press machines work in parallel, overcoming the concurrency limitation of a single press machine.
[0126] Step S405: for each of the target press machine identifiers, obtain the execution result file fed back by the press machine corresponding to the target press machine identifier, wherein the execution result file includes multiple response results, and the response result is the response result of the server in response to the operation request sent by the press machine.
[0127] Exemplarily, the execution result file corresponding to each target press machine identifier includes the start time (Start Time), end time (End Time), average response time of the operation requests, and error rate of the operation requests of all operation requests of the press machine with the target press machine identifier.
[0128] Step S406: Based on the execution result files corresponding to the multiple target press identifiers, the high concurrency capability information of the server is obtained.
[0129] Exemplarily, the high concurrency capability information of the server can be displayed in a visual report. In order for those skilled in the art to better understand the visual report, an example is given below to illustrate.
[0130] like Figure 6 The figure shows a schematic diagram of an implementation method of the visual report provided in an embodiment of the present application.
[0131] Combine the following Figure 6 The high concurrency capability information is explained. For example, the high concurrency capability information includes the earliest start time (Start Time) and the latest end time (End Time) of the operation request in the execution result file corresponding to multiple target press machine identifiers; the average response time of all operation requests in the execution result file corresponding to multiple target press machine identifiers, and the average error rate of all operation requests in the execution result file corresponding to multiple target press machine identifiers.
[0132] For example, Figure 6 "result.jtl" indicates the execution result file. Figure 6 The "Average" in the "ResponseTime (ms)" indicates the average response time; "Min" indicates the minimum response time; "Max" indicates the maximum response time; and "Median" indicates the median value of the response time. "Error%" indicates the error rate of the operation request. "#Samples" indicates the number of concurrent users, and "FAIL" indicates the number of errors that occurred in the process of responding to the operation request.
[0133] Exemplarily, the high concurrency capability information also includes: minimum response time, maximum response time, and error rate of operation requests.
[0134] It is understandable that the electronic device in the present application can aggregate the execution result files corresponding to multiple target press machine identifiers. The present application centrally manages and analyzes the execution result files of multiple press machines, eliminating the need for the tester to manually collect and organize data, thereby improving the accuracy and real-time nature of data analysis.
[0135] The embodiment of the present application provides a distributed stress testing method, which determines multiple target press machine identifiers from multiple press machine identifiers whose running status is idle; each target press machine identifier corresponds to a press machine; the press machine information has been set in advance for each press machine identifier, so the target press machine information corresponding to multiple target press machine identifiers can be obtained. After determining the target press machine identifier, the pressurization parameters of the target press machine identifier can be obtained; thus, the scenario test tasks can be assigned to the corresponding press machines based on the pressurization parameters of each target press machine identifier. The present application uses multiple press machines to work in parallel, overcoming the concurrency limitation of a single press machine. For each target press machine identifier, the execution result files respectively fed back by the press machine corresponding to the target press machine identifier are obtained; based on the execution result files respectively corresponding to the multiple target press machine identifiers, the high concurrency capability information of the server is obtained. The present application centrally manages and analyzes the execution result files of multiple press machines, eliminating the need for testers to manually collect and organize data, thereby improving the accuracy and real-time performance of data analysis.
[0136] It is understandable that for each press machine, during the stress process, that is, before the preset stress test duration ends, if the resource utilization rate of the server or press machine is high, it indicates that the server or press machine has approached or reached a bottleneck, and it may be necessary to stop the stress to avoid system overload. It is understandable that if during the stress process, the average response time of the server's operation request begins to increase significantly or the error rate rises or the throughput begins to decrease, it may indicate that the server is about to reach its limit and needs to stop stressing. If the tester stops the stress manually, there will be 30 seconds or 1 minute between the tester discovering the problem and the time between the tester discovering the problem and the artificial stop of the stress. This is fatal for production, because within these 30 seconds or 1 minute, the press machine or server may be paralyzed. Since the press machine and the server are remote servers, it is very time-consuming and labor-intensive to repair and start the press machine or server again after the press machine or server is paralyzed. Based on this, the embodiment of the present application provides the following method, which includes the following steps A1 to A5 during the implementation process.
[0137] Step A1: Obtain a first resource usage rate of the server.
[0138] Exemplarily, the first resource usage includes, but is not limited to: CPU usage, network IO (Input / Output) usage, and memory usage.
[0139] Exemplarily, the CPU usage of the server can be obtained through command line tools, system monitoring tools or third-party monitoring software. For example, in a Linux system, the top command or htop command can be used to monitor the CPU usage in real time. The top command provides a dynamic real-time view of the system status, including CPU usage, process information, etc. htop provides a more intuitive interface and can display different resource usage through color coding.
[0140] For example, the network IO usage can be monitored by a tool such as iostat. Iostat is a tool for disk I / O that can provide data refreshed every second and display disk I / O statistics.
[0141] For example, in a Linux system, the free-m command can be used to obtain memory usage, including total memory, used memory, and available memory. The vmstat command also provides monitoring of memory status, including memory usage and swap space usage.
[0142] Step A2: Obtain the second resource usage rates corresponding to the plurality of target press machine identifiers.
[0143] Exemplarily, the second resource usage includes, but is not limited to: CPU usage, network IO usage, and memory usage.
[0144] Step A3: Obtain the average response time of the operation request of the server and the error rate of the operation request.
[0145] The average response time refers to the average time required for the server to process an operation request and return a response result. During stress testing, as the number of concurrent users increases, the server load will gradually increase, which may cause the average response time to increase. If the average response time exceeds the preset service level agreement (SLA) threshold, or increases significantly compared to the baseline value, this indicates that the server may be close to or reach its performance limit. It is understandable that if the increase in the average response time is caused by a bottleneck in the server's resources (such as CPU, memory, or network IO), then continuing to increase the pressure may cause the server performance to deteriorate further or even cause the server to become unavailable.
[0146] The error rate is the ratio of error responses returned by the server during the stress test. An increase in the error rate may be caused by server overload, insufficient resources, or code defects. If the error rate increases suddenly, especially if it exceeds a preset threshold, it may be a sign that the server is about to crash. A high error rate means that the user experience is impaired and business processes may not be completed normally. An increase in the error rate may also be due to the exhaustion of the server's resources (such as database connection pool exhaustion, memory leaks, etc.), which requires immediate action to avoid complete server failure.
[0147] Step A4: For each target press machine identifier, if the actual stress testing duration of the press machine corresponding to the target press machine identifier is less than the preset stress testing duration and satisfies a first preset condition, stop allocating the scenario test task to the press machine.
[0148] Among them, the first preset condition is that the first resource utilization rate exceeds the first preset range or the second resource utilization rate of the target press identification exceeds the second preset range or the average response time is greater than or equal to the third preset threshold or the error rate is greater than or equal to the fourth preset threshold.
[0149] Exemplarily, the first resource usage rate includes multiple resource usage rates, and the first preset ranges corresponding to different resource usage rates may be the same or different, and may be determined based on actual conditions, and the present application does not limit this. For example, the first preset range of CPU usage rate may be (0, 70%]; the first preset range of network IO usage rate may be (0, 85%]; and the first preset range of memory usage rate may be (0, 90%].
[0150] Exemplarily, the second resource utilization rate includes multiple resource utilization rates, and the second preset ranges corresponding to different resource utilization rates may be the same or different, and the specific range may be determined based on actual conditions, and this application does not limit this.
[0151] Exemplarily, the third preset threshold and the fourth preset threshold may be determined based on actual conditions, and this application does not limit this.
[0152] Step A5: For each target press machine identifier, if the actual stress testing duration of the press machine corresponding to the target press machine identifier is less than the preset stress testing duration and meets the second preset condition, continue to allocate the scenario test task to the press machine corresponding to the target press machine identifier according to the stress strategy.
[0153] Among them, the second preset condition is that if the first resource utilization rate belongs to the first preset range and the second resource utilization rate of the target press identification belongs to the second preset range and the average response time is less than the third preset threshold and the error rate is less than the fourth preset threshold.
[0154] In summary, the first resource utilization rate, the second resource utilization rate, the average response time and the error rate are important indicators for evaluating server performance and stability. They are closely related to the decision to stop pressurization. These indicators need to be closely monitored and automatically adjusted in a timely manner according to the actual situation without human intervention to ensure the effectiveness of the test and the safety of the server and pressurizer.
[0155] It is understandable that there are multiple ways to implement step S403. The embodiment of the present application provides but is not limited to the following method. If multiple target press machine identifiers correspond to pressurization parameters respectively, the method includes the following steps B1 to B3 during implementation.
[0156] Step B1: Setting the number of concurrent users through the first user interface.
[0157] like Figure 7 Shown is a schematic diagram of an implementation method of the first user interface provided in an embodiment of the present application.
[0158] from Figure 7 It can be seen that the first user interface can display multiple press logos. Figure 7 "Node Name" is used to indicate the press identification. Figure 7 Two press identifiers, press number 1 and press number 2, are shown in the figure. Press number 1 is in working state, so the operating state of press number 1 is "running". Press number 2 is in idle state, so the operating state of press number 2 is "idle state". The tester cannot select press number 1 because press number 1 is already in working state. The tester can determine multiple target press identifiers from multiple press identifiers whose operating state is idle state.
[0159] pass Figure 7 As you can see, you can set the "Number of concurrent users" via "Number of concurrent users".
[0160] Step B2: Setting the preset stress testing duration through the first user interface.
[0161] For example, by Figure 7 In "Stress Test Duration", set the preset stress test duration, such as Figure 7 The time for the test is 600 seconds.
[0162] Step B3: Setting the pressurization strategy through the first user interface.
[0163] The implementation process of step B3 is described in detail below. Step B3 may include the following steps B31 to B33.
[0164] Step B31: Select a pressure mode through the first user interface, where the pressure modes include linear increase, step increase, and configuration using a JMX script.
[0165] Step B32: Control the first user interface to display the pressure parameters corresponding to the pressure mode.
[0166] Step B33: Setting the pressure parameters through the first user interface to obtain the pressure strategy.
[0167] Figure 7 Area 71 in the figure is the pressure parameter when the pressure mode is linearly increasing.
[0168] Area 71 can be used to set the number of concurrent users, stress test duration and stress strategy. The stress strategy is {increase concurrent users within "first duration" seconds}. The first duration is the duration for the stress machine to send operation requests of the number of concurrent users to the server.
[0169] like Figure 8 , which is a schematic diagram of pressure parameters when the pressure mode provided in an embodiment of the present application is a step-by-step increase.
[0170] Figure 8 The middle area 81 is the pressure parameters when the pressure mode is step-by-step increase. By setting the pressure parameters in area 81, a pressure strategy can be obtained.
[0171] like Fig. 9 As shown, the embodiment of the present application provides Figure 8 A schematic diagram of a pressurization curve corresponding to the pressurization strategy is shown.
[0172] like Fig.10 As shown, the pressure mode provided for the implementation of this application is a schematic diagram of pressure parameters when using JMX script configuration.
[0173] Exemplarily, the pressure parameters corresponding to each test scenario can be set through the first user interface.
[0174] Exemplarily, the stress parameters of the test scenario shown in the second user interface can be set through the second user interface. Exemplarily, the stress mode is the stress parameters when using the JMX script configuration, such as Fig.10 As shown, no further description is given here.
[0175] The following is an explanation of a method for setting a scenario test task. The method includes the following steps C1 to C3 during implementation.
[0176] Step C1: Create a scenario test task template through the second user interface.
[0177] Step C2: Displaying the task parameters of the scenario test task module through the second user interface.
[0178] Step C3: Setting the task parameters through the second user interface to obtain the scenario test task.
[0179] Exemplarily, if the test scenario includes multiple test steps, steps C1 to C3 need to be executed for each test step.
[0180] The following is an explanation with specific examples. Fig.11 Shown is a schematic diagram of an implementation method of the second user interface provided in an embodiment of the present application.
[0181] Exemplarily, the tester can obtain the scenario test task by adding corresponding task parameters in the scenario test task template. Exemplarily, the task parameters include but are not limited to: the communication address of the server (including IP address and port number), the method of HTTP request, and the path of HTTP request.
[0182] In an optional implementation, if the press machine corresponding to the target press machine identifier has sent all scenario test tasks for the number of concurrent users to the server, that is, the press test is completed, the operating state of the target press machine identifier is switched from running to idle state.
[0183] A distributed stress testing method provided by an embodiment of the present application is introduced above, and a device for executing the above-mentioned distributed stress testing method will be introduced below.
[0184] See also Fig.12 , Fig.12 This is a schematic diagram of the structure of a distributed pressure testing device provided in an embodiment of the present application. Fig.12 As shown, the distributed pressure testing device comprises:
[0185] The first determination module 1201 is used to determine multiple target press identifiers from multiple press identifiers whose operating status is an idle state;
[0186] A search module 1202 is used to search for target press information corresponding to a plurality of target press identifiers from a preset correspondence relationship between press identifiers and press information, wherein the press information includes a communication address of the press, a user name of the press, and a password of the press;
[0187] The first acquisition module 1203 is used to obtain the stress parameters corresponding to the multiple target stress machine identifiers, wherein the stress parameters include the number of concurrent users, scenario test tasks, preset stress test duration and stress strategy, and the scenario test tasks include the communication address of the server to be tested and the operation request;
[0188] The stress distribution module 1204 is used to distribute the scenario test tasks to the stress machine corresponding to the target stress machine identifier according to the stress strategy within the preset stress test duration for each target stress machine identifier; wherein the total number of scenario test tasks distributed to the stress machine does not exceed the number of concurrent users;
[0189] The second acquisition module 1205 is used to acquire, for each target press machine identifier, an execution result file fed back by the press machine corresponding to the target press machine identifier, wherein the execution result file includes multiple response results, and the response results are response results of the server in response to the operation request sent by the press machine; the press machines corresponding to the multiple target press machine identifiers pressurize the same server;
[0190] The third acquisition module 1206 is used to acquire the high concurrency capability information of the server based on the execution result files respectively corresponding to the multiple target press machine identifiers.
[0191] In an optional implementation, the method further includes:
[0192] A fourth acquisition module, used to acquire a first resource usage rate of the server;
[0193] A fifth acquisition module, used for acquiring second resource usage rates respectively corresponding to the plurality of target press machine identifiers;
[0194] A sixth acquisition module, used to acquire an average response time of the operation request of the server and an error rate of the operation request;
[0195] A stop stress test module is used for, for each target stress machine identifier, if the actual stress test duration of the stress machine corresponding to the target stress machine identifier is less than the preset stress test duration and satisfies a first preset condition, to stop allocating the scenario test task to the stress machine;
[0196] Wherein, the first preset condition is that the first resource usage rate exceeds a first preset range or the second resource usage rate of the target press identification exceeds a second preset range or the average response time is greater than or equal to a third preset threshold or the error rate is greater than or equal to a fourth preset threshold;
[0197] A continue stressing module is used for, for each of the target press machine identifiers, if the actual stress testing duration of the press machine corresponding to the target press machine identifier is less than the preset stress testing duration and satisfies a second preset condition, to continue allocating the scenario test task to the press machine corresponding to the target press machine identifier according to the stressing strategy;
[0198] Among them, the second preset condition is that if the first resource utilization rate belongs to the first preset range and the second resource utilization rate of the target press identification belongs to the second preset range and the average response time is less than the third preset threshold and the error rate is less than the fourth preset threshold.
[0199] In an optional implementation, the pressurization parameters corresponding to the plurality of target press machine identifiers are respectively obtained by a first acquisition module including:
[0200] A first setting unit, configured to set the number of concurrent users through the first user interface;
[0201] A second setting unit, configured to set the preset stress testing duration through the first user interface;
[0202] A third setting unit is used to set the pressure strategy through the first user interface.
[0203] In an optional implementation, the third setting unit includes:
[0204] A selection subunit, used for selecting a pressure mode through the first user interface, wherein the pressure mode includes linear increase, step increase and configuration using a JMX script;
[0205] A control subunit, used for controlling the first user interface to display the pressure parameters corresponding to the pressure mode;
[0206] The setting subunit is used to set the pressure parameters through the first user interface to obtain the pressure strategy.
[0207] In an optional implementation, the method further includes:
[0208] A creation module, used for creating a scenario test task template through a second user interface;
[0209] A control display module is used to display the task parameters of the scenario test task module through the second user interface;
[0210] A setting module is used to set the task parameters through the second user interface to obtain the scenario test task.
[0211] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any distributed stress testing method provided in the embodiment of the present application.
[0212] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When one or more computer programs are executed by an electronic device, the electronic device can implement any distributed stress testing method provided in an embodiment of the present application.
[0213] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0214] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0215] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0216] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A distributed stress testing method, characterized in that: include: Determine multiple target press identifiers from multiple press identifiers whose operating status is an idle state; From the preset correspondence between the press identification and the press information, searching for the target press information corresponding to the plurality of target press identifications, the press information including the communication address of the press, the user name of the press and the password of the press; Obtain stress parameters corresponding to the target stress machine identifiers, wherein the stress parameters include the number of concurrent users, scenario test tasks, preset stress test duration, and stress strategy. The scenario test tasks include the communication address of the server to be tested and the operation request; For each of the target stress machine identifiers, the scenario test tasks are allocated to the stress machine corresponding to the target stress machine identifier according to the stress test strategy within the preset stress test duration; wherein the total number of the scenario test tasks allocated to the stress machine does not exceed the number of concurrent users; For each target press machine identifier, obtain an execution result file fed back by the press machine corresponding to the target press machine identifier, wherein the execution result file includes a plurality of response results, and the response results are response results of the server in response to the operation request sent by the press machine; the press machines corresponding to the plurality of target press machine identifiers pressurize the same server; Based on the execution result files respectively corresponding to the multiple target press machine identifiers, the high concurrency capability information of the server is obtained.
2. The distributed stress testing method according to claim 1, characterized in that: Also includes: Obtaining a first resource usage rate of the server; Obtaining second resource usage rates respectively corresponding to a plurality of target press identifiers; Obtaining an average response time of the operation request of the server and an error rate of the operation request; For each of the target press machine identifiers, if the actual stress testing duration of the press machine corresponding to the target press machine identifier is less than the preset stress testing duration and satisfies a first preset condition, stop allocating the scenario test task to the press machine; Wherein, the first preset condition is that the first resource usage rate exceeds a first preset range or the second resource usage rate of the target press identification exceeds a second preset range or the average response time is greater than or equal to a third preset threshold or the error rate is greater than or equal to a fourth preset threshold; For each of the target press machine identifiers, if the actual stress testing duration of the press machine corresponding to the target press machine identifier is less than the preset stress testing duration and satisfies the second preset condition, keep allocating the scenario test task to the press machine corresponding to the target press machine identifier according to the stress strategy; Among them, the second preset condition is that if the first resource utilization rate belongs to the first preset range and the second resource utilization rate of the target press identification belongs to the second preset range and the average response time is less than the third preset threshold and the error rate is less than the fourth preset threshold.
3. The distributed stress testing method according to claim 1, characterized in that: The pressurizing parameters corresponding to the plurality of target press machine identifiers are obtained, and the step of obtaining the pressurizing parameters corresponding to the plurality of target press machine identifiers comprises: Setting the number of concurrent users through the first user interface; Setting the preset stress testing duration through the first user interface; The pressurization strategy is set through the first user interface.
4. The distributed stress testing method according to claim 3, characterized in that: The step of setting the pressurization strategy through the first user interface includes: Selecting a pressure mode through the first user interface, wherein the pressure mode includes linear increase, step increase, and configuration using a JMX script; Controlling the first user interface to display the pressure parameters corresponding to the pressure mode; The pressure parameters are set through the first user interface to obtain the pressure strategy.
5. The distributed stress testing method according to any one of claims 1 to 4, characterized in that: The method for presetting the scenario test task includes: Creating a scenario test task template through a second user interface; Displaying the task parameters of the scenario test task module through the second user interface; The task parameters are set through the second user interface to obtain the scenario testing task.
6. A distributed pressure testing device, characterized in that: include: A first determination module is used to determine a plurality of target press machine identifiers from a plurality of press machine identifiers whose operating status is an idle state; A search module, used for searching for target press information corresponding to a plurality of target press identifiers respectively from a preset correspondence relationship between press identifiers and press information, wherein the press information includes a communication address of the press, a user name of the press, and a password of the press; A first acquisition module is used to obtain the pressure parameters corresponding to the multiple target pressure machine identifiers, wherein the pressure parameters include the number of concurrent users, scenario test tasks, preset pressure test duration and pressure strategy, and the scenario test tasks include the communication address of the server to be tested and the operation request; A stress distribution module, for allocating the scenario test tasks to the stress machine corresponding to the target stress machine identifier according to the stress testing strategy within the preset stress testing duration for each target stress machine identifier; wherein the total number of scenario test tasks allocated to the stress machine does not exceed the number of concurrent users; The second acquisition module is used to acquire, for each target press machine identifier, an execution result file fed back by the press machine corresponding to the target press machine identifier, wherein the execution result file includes a plurality of response results, and the response results are response results of the server in response to the operation request sent by the press machine; the press machines corresponding to the plurality of target press machine identifiers pressurize the same server; The third acquisition module is used to acquire the high concurrency capability information of the server based on the execution result files respectively corresponding to the multiple target press identifiers.
7. The distributed pressure testing device according to claim 6, characterized in that: Also includes: A fourth acquisition module, used to acquire a first resource usage rate of the server; A fifth acquisition module, used for acquiring second resource usage rates respectively corresponding to the plurality of target press machine identifiers; A sixth acquisition module, used to acquire an average response time of the operation request of the server and an error rate of the operation request; A stop stress test module is used for, for each target stress machine identifier, if the actual stress test duration of the stress machine corresponding to the target stress machine identifier is less than the preset stress test duration and satisfies a first preset condition, to stop allocating the scenario test task to the stress machine; Wherein, the first preset condition is that the first resource usage rate exceeds a first preset range or the second resource usage rate of the target press identification exceeds a second preset range or the average response time is greater than or equal to a third preset threshold or the error rate is greater than or equal to a fourth preset threshold; A continue stressing module is used for, for each of the target press machine identifiers, if the actual stress testing duration of the press machine corresponding to the target press machine identifier is less than the preset stress testing duration and satisfies a second preset condition, to continue allocating the scenario test task to the press machine corresponding to the target press machine identifier according to the stressing strategy; Among them, the second preset condition is that if the first resource utilization rate belongs to the first preset range and the second resource utilization rate of the target press identification belongs to the second preset range and the average response time is less than the third preset threshold and the error rate is less than the fourth preset threshold.
8. A computer program product, characterized in that It includes computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the distributed stress testing method as described in any one of claims 1 to 5.
9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the distributed stress testing method as described in any one of claims 1 to 5.
10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the distributed stress testing method as described in any one of claims 1 to 5.