System pressure testing method and device, equipment and storage medium
By constructing an automated closed-loop testing process and utilizing predefined stress testing scenarios and multi-level performance index thresholds, intelligent performance testing of distributed software systems has been achieved. This solves the problems of low automation and lack of safe circuit breaker mechanisms in existing technologies, thereby improving testing efficiency and system security.
Patent Information
- Application Number
- CN202511687028.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-17
AI Technical Summary
Existing technologies have low automation levels in performance testing of distributed software systems, rely on manual monitoring, cannot be normalized or sustained, and lack intelligent safety circuit breaker mechanisms, which can easily have adverse effects on the system.
This paper provides a system stress testing method. By predefining stress test scenarios, multi-level performance index thresholds and associated circuit breaker control actions, an automated closed-loop test process is constructed. Test tasks are automatically triggered according to a preset timing strategy, performance index data is collected in real time, and circuit breaker control actions are automatically triggered based on the comparison results, so as to achieve unattended operation and intelligent protection.
It achieves unattended and intelligent operation of the entire stress testing process, from task triggering and execution monitoring to security intervention, significantly improving testing efficiency and system security, and enabling timely detection of performance degradation issues and proactive protection.
Smart Images

Figure CN121542142A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of testing technology, and in particular to a system stress testing method, apparatus, equipment and storage medium. Background Technology
[0002] Currently, in the performance testing of distributed software systems, especially core business systems in fields such as telecommunications and finance, stress testing is a crucial step in ensuring system stability. Existing technologies typically rely on dedicated stress testing tools (such as JMeter and LoadRunner), where testers pre-write test scripts, configure stress scenarios, and manually execute test tasks at specific times (such as during system off-peak periods or before deployment). During testing, key performance indicators such as system resource utilization, application response time, and transaction success rate must be manually monitored. If a sharp drop in system performance or anomalies are detected, the test must be manually stopped to avoid causing substantial damage to the production environment.
[0003] However, this traditional performance stress testing method has obvious limitations, mainly reflected in: low degree of automation, reliance on manual supervision; inability to normalize and sustain testing activities, and low level of intelligence, which can easily have adverse effects on the system.
[0004] In summary, the problems with the relevant technologies urgently need to be addressed. Summary of the Invention
[0005] The purpose of this application is to at least partially solve one of the technical problems existing in the related art.
[0006] Therefore, one object of the embodiments of this application is to provide a system stress testing method, apparatus, device and storage medium.
[0007] To achieve the above-mentioned technical objectives, the technical solutions adopted in the embodiments of this application include: On the one hand, embodiments of this application provide a system stress testing method, the method comprising: Obtain predefined stress test scenarios, multi-level performance index thresholds, and circuit breaker control actions associated with each level of performance index threshold; The stress test task is automatically triggered according to the preset timing strategy. During the stress test, a load is applied to the system under test, and the performance index data of the system under test are collected in real time. The collected performance index data is compared with the multi-level performance index thresholds, and the corresponding circuit breaker control action is automatically triggered based on the comparison result to adjust or terminate the stress test task. Based on the triggering of the circuit breaker control action and / or the results of the stress test task, a notification message is generated and sent.
[0008] In addition, the system stress testing method according to the above embodiments of this application may also have the following additional technical features: Furthermore, in one embodiment of this application, obtaining the predefined stress test scenario, multi-level performance index thresholds, and circuit breaker control actions associated with each level of the performance index thresholds includes: Obtain the user's configuration information; wherein, the configuration information includes: The stress test scenario includes at least one of the following: target address for stress test, request parameters, request headers, think time, number of concurrent users, and duration of stress test; The multi-level performance indicator thresholds are bound to the stress test scenario, wherein the multi-level performance indicator thresholds include at least a primary threshold, an intermediate threshold, and a high-level threshold; And circuit breaker control actions associated with the performance index thresholds at each level, wherein the primary threshold is associated with an early warning action, the intermediate threshold is associated with a degradation action to dynamically reduce the test load, and the advanced threshold is associated with an interrupt action to immediately terminate the test.
[0009] Furthermore, in one embodiment of this application, automatically triggering the execution of the stress test task according to a preset timing strategy includes: The trigger time is determined according to the preset timing strategy; Detect whether the current time point has reached the trigger time point; In response to the current time point reaching the trigger time point, the execution of the stress test task is triggered.
[0010] Furthermore, in one embodiment of this application, the collection of performance index data of the system under test includes: Collect at least one of the system indicator data, application indicator data, and business indicator data of the system under test; The system metrics include CPU utilization, memory utilization, disk I / O, and network traffic; the application metrics include queries per second, transactions per second, response time, and error rate; and the business metrics include order success rate and payment success rate.
[0011] Furthermore, in one embodiment of this application, the step of comparing the collected performance index data with the multi-level performance index thresholds and automatically triggering the corresponding circuit breaker control action based on the comparison result includes: The collected performance index data is preprocessed, and a comprehensive risk score is calculated based on the preprocessed performance index data. The comprehensive risk score is compared with the multi-level performance index thresholds, and the corresponding circuit breaker control action is triggered based on the threshold range in which the comprehensive risk score falls.
[0012] Furthermore, in one embodiment of this application, the step of preprocessing the collected performance index data and calculating a comprehensive risk score based on the preprocessed performance index data includes: The collected performance index data is cleaned to remove invalid, transient anomaly data; Based on the volatility of the current request, the time window length for the performance indicator data used to calculate the comprehensive risk score is dynamically adjusted. Calculate the corresponding risk sub-score based on the performance index data for each of the aforementioned time window lengths; The comprehensive risk score is obtained by weighted summation of the risk sub-scores.
[0013] Furthermore, in one embodiment of this application, the circuit breaker control action includes a degradation action and an interruption action; the automatic triggering of the corresponding circuit breaker control action based on the comparison result includes: In response to triggering the degradation action, the load pressure applied to the system under test is dynamically reduced; In response to the interrupt action, the stress test task is stopped and the test status information is saved.
[0014] On the other hand, embodiments of this application provide a system stress testing device, the system comprising: The acquisition unit is used to acquire predefined stress test scenarios, multi-level performance index thresholds, and circuit breaker control actions associated with each level of the performance index thresholds; The execution unit is used to automatically trigger the execution of stress test tasks according to a preset timing strategy; The data acquisition unit is used to apply a load to the system under test and collect the performance index data of the system under test in real time during the execution of the stress test task. The triggering unit is used to compare the collected performance index data with the multi-level performance index thresholds, and automatically trigger the corresponding circuit breaker control action according to the comparison result to adjust or terminate the stress test task. The generation unit is used to generate and send notification information based on the triggering of the fuse control action and / or the result of the stress test task.
[0015] On the other hand, embodiments of this application provide an electronic device, including: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the system stress testing method described above.
[0016] On the other hand, embodiments of this application also provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to implement the above-described system stress testing method.
[0017] On the other hand, embodiments of this application also provide a computer program product, which includes a computer program stored in a computer-readable storage medium. The processor of an electronic device reads the computer program from the computer-readable storage medium and executes the computer program, causing the electronic device to perform the system stress test method described above.
[0018] The advantages and beneficial effects of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application: This application discloses a system stress testing method, apparatus, equipment, and storage medium, aiming to improve the problems of low automation, inability to perform routine testing, and lack of safety circuit breaker mechanisms in existing technologies. The focus of this application is to construct an automated closed-loop testing process: First, strategy configuration is completed by predefining stress test scenarios, multi-level performance index thresholds, and associated circuit breaker control actions; then, test tasks are automatically triggered according to a preset timing strategy. During stress testing, the system collects performance index data in real time and compares it with multi-level thresholds. Based on the comparison results, corresponding circuit breaker control actions (such as early warning, dynamic stress reduction, or immediate termination of the test) are automatically triggered, thereby achieving intelligent protection for the system under test. Finally, notifications are automatically generated and sent based on circuit breaker events or test results. This application achieves unattended and intelligent stress testing throughout the entire process from task triggering and execution monitoring to security intervention, significantly improving testing efficiency and system security. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following description is provided with accompanying drawings of the relevant technical solutions in the embodiments of this application or the prior art. It should be understood that the accompanying drawings described below are only for the purpose of clearly illustrating some embodiments of the technical solutions in this application. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0020] Figure 1 This is a schematic diagram of the implementation environment for a system stress testing method provided in this application embodiment; Figure 2 This is a flowchart illustrating a system stress testing method provided in an embodiment of this application; Figure 3 This is a schematic diagram illustrating the implementation logic of a system stress testing method provided in this application embodiment; Figure 4 This is a schematic diagram of a process for automatically triggering a stress test task provided in an embodiment of this application; Figure 5 This is a schematic diagram of a process for determining a circuit breaker control action provided in an embodiment of this application; Figure 6 This is a schematic diagram of a process for calculating a comprehensive risk score provided in an embodiment of this application; Figure 7 This is a schematic diagram of a process for triggering a circuit breaker control action provided in an embodiment of this application; Figure 8 This is a schematic diagram illustrating the principle of triggering a circuit breaker control action provided in an embodiment of this application; Figure 9 This is a schematic diagram of the structure of a system pressure testing device provided in the embodiments of this application; Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0021] The present application will be further described below with reference to the accompanying drawings and specific embodiments. The described embodiments should not be considered as limitations on the present application, and all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present application.
[0022] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0023] Currently, in the performance testing of distributed software systems, especially core business systems in fields such as telecommunications and finance, stress testing is a crucial step in ensuring system stability. Existing technologies typically rely on dedicated stress testing tools (such as JMeter and LoadRunner), where testers pre-write test scripts, configure stress scenarios, and manually execute test tasks at specific times (such as during system off-peak periods or before deployment). During testing, key performance indicators such as system resource utilization, application response time, and transaction success rate must be manually monitored. If a sharp drop in system performance or anomalies are detected, the test must be manually stopped to avoid causing substantial damage to the production environment.
[0024] However, this traditional performance stress testing method has obvious limitations, mainly in the following aspects: 1. Low level of automation and reliance on manual intervention: The initiation, execution, monitoring, and termination of the testing process heavily depend on the manual operation of performance test engineers. From script design and scenario configuration to result analysis, a large amount of human resources are required, resulting in low efficiency, high labor costs, and an inability to adapt to the agile pace of high-frequency iteration and continuous delivery in modern software development.
[0025] 2. Testing activities cannot be normalized and sustained: Performance testing is often regarded as a "one-off" verification activity before project launch, rather than a routine health check mechanism embedded in the operation and maintenance system. This makes it impossible to conduct periodic and continuous stress inspections of the online production environment, and it is difficult to detect performance degradation issues caused by gradual factors such as accumulated code updates, growth of business data, and changes in infrastructure in a timely manner, leaving the system with unknown risks.
[0026] 3. Lack of intelligent safety circuit breaker mechanisms: Traditional load testing tools are designed to apply stress rather than protect the system, and generally lack effective real-time protection mechanisms. When a system performance drops sharply or resources become overloaded during testing, the tool usually continues to apply stress "mindlessly" instead of proactively intervening. This passive behavior can easily amplify local performance problems, causing the testing process itself to overwhelm the online business system, leading to service unavailability, data errors, and other online failures, causing substantial damage to business continuity.
[0027] In view of this, this application provides a system stress testing method, apparatus, device, and storage medium, aiming to improve the problems of low automation, inability to perform routine testing, and lack of safety circuit breaker mechanisms in existing technologies. The focus of this application is to construct an automated closed-loop testing process: First, strategy configuration is completed by predefining stress test scenarios, multi-level performance index thresholds, and associated circuit breaker control actions; then, test tasks are automatically triggered according to a preset timing strategy. During stress testing, the system collects performance index data in real time and compares it with multi-level thresholds. Based on the comparison results, corresponding circuit breaker control actions (such as early warning, dynamic stress reduction, or immediate termination of the test) are automatically triggered, thereby achieving intelligent protection for the system under test. Finally, notifications are automatically generated and sent based on circuit breaker events or test results. This application realizes unattended and intelligent stress testing from task triggering, execution monitoring to security intervention, significantly improving testing efficiency and system security.
[0028] Please refer to Figure 1 , Figure 1This diagram illustrates the implementation environment of a system stress testing method provided in this embodiment. In this implementation environment, the main hardware and software components involved include a terminal device 110 and a backend server 120. The terminal device 110 and the backend server 120 are connected via communication.
[0029] The system stress testing method provided in this embodiment can be configured to be executed independently on the terminal device 110, independently on the backend server 120, or based on data interaction between the terminal device 110 and the backend server 120. The terminal device 110 is typically a client for performance testing engineers or system maintenance personnel to operate and interact with; its specific form can be a personal computer, laptop, workstation, or dedicated monitoring terminal, etc. The backend server 120 is the server that carries the core processing logic and data computation. It can be a single physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0030] The terminal device 110 and the backend server 120 can establish a communication connection via a wireless network or a wired network. This wireless or wired network uses standard communication technologies and / or protocols. The network can be the Internet or any other network, including but not limited to any combination of Local Area Network (LAN), Metropolitan Area Network (MAN), Wide Area Network (WAN), mobile, wired or wireless networks, private networks, or virtual private networks.
[0031] The software functional modules related to the system stress testing method provided in this application embodiment can be configured on the aforementioned hardware in different ways according to different application scenarios and resource allocation requirements. For example, in some embodiments, all functional modules of the method, including configuration management, task scheduling, stress test execution, monitoring analysis, and alarm notification, can be integrated and deployed on the terminal device 110. In this integrated deployment mode, the terminal device 110 independently completes the entire process from configuration, triggering to execution, decision-making, and notification, which is suitable for direct and independent testing scenarios of specific systems.
[0032] In some embodiments, the core computing and execution modules can be deployed on the backend server 120, while the configuration and result display interface can be deployed on the terminal device 110. In this distributed deployment mode, the terminal device 110 primarily handles user interaction functions, such as allowing users to configure test parameters, view generated test reports, and receive alarm information. The backend server 120, on the other hand, is responsible for executing computationally intensive and resource-intensive tasks, including scheduling and managing timed tasks, initiating stress requests, real-time collection and calculation of performance metrics, generating circuit breaker decisions, and controlling the stress testing engine. The terminal device 110 and the backend server 120 interact through predefined interfaces. For example, the terminal device 110 uploads user configuration information to the backend server 120, and the backend server 120 sends decision results, alarm information, and test reports to the terminal device 110 for display.
[0033] In some embodiments, all functional modules can be deployed on the backend server 120 side, and the terminal device 110 can operate by remotely accessing the service interface provided by the backend server 120 through client tools such as a browser. This mode facilitates centralized management and maintenance of the system.
[0034] Of course, this is understandable. Figure 1 The implementation environment described in this application is only one of the optional application scenarios for the system stress testing method provided in this embodiment. The actual application is not fixed. Figure 1 The software and hardware environment shown.
[0035] Below, in conjunction with the aforementioned description of the implementation environment, a system stress testing method provided in the embodiments of this application will be introduced and explained.
[0036] Please refer to Figure 2 , Figure 2 This is a schematic diagram of a system stress testing method provided in an embodiment of this application. Specifically, the system stress testing method provided in this embodiment includes, but is not limited to: Step 210: Obtain the predefined stress test scenario, multi-level performance index thresholds, and circuit breaker control actions associated with each level of performance index threshold; Step 220: Automatically trigger the execution of the stress test task according to the preset timing strategy; Step 230: During the execution of the stress test task, apply a load to the system under test and collect the performance index data of the system under test in real time; Step 240: Compare the collected performance index data with the multi-level performance index thresholds, and automatically trigger the corresponding circuit breaker control action based on the comparison result to adjust or terminate the stress test task. Step 250: Generate and send notification information based on the triggering of the circuit breaker control action and / or the result of the stress test task.
[0037] This application provides a system stress testing method that constructs a secure and automated closed-loop testing process. The method first completes initial setup by acquiring predefined stress test scenarios, multi-level performance index thresholds, and associated circuit breaker control actions. Subsequently, the stress test task is automatically triggered according to a preset timing strategy, requiring no manual intervention. During the test, while applying load to the system under test, its various performance index data are collected in real time. The real-time collected performance data is intelligently compared with pre-set multi-level thresholds, and corresponding circuit breaker control actions are automatically triggered based on the comparison results, such as dynamically adjusting the test pressure or immediately terminating the test task, thereby achieving proactive security protection for the system under test. Finally, the method automatically generates and sends notification information based on the triggering of the circuit breaker event or the final test results, completing a fully unattended operation and maintenance process from task configuration, automatic execution, real-time monitoring, intelligent decision-making to result feedback.
[0038] The system stress testing method provided in this application embodiment will be described and explained in detail below with specific steps.
[0039] In step 210, predefined stress test scenarios, multi-level performance index thresholds, and circuit breaker control actions associated with each performance index threshold are obtained. This step transforms test intent, security boundaries, and emergency response mechanisms into structured configuration information that the system can recognize and execute, thereby improving the security, effectiveness, and intelligence of subsequent automated testing processes.
[0040] In this embodiment, the stress test scenario can be a complete set of instructions that simulates real user behavior and business logic. It may include the following: Basic request configuration: defining the API endpoint (target URL) for stress testing, the HTTP method used (GET, POST, etc.), request headers (such as Content-Type, Authorization, etc.), and request body (such as data in JSON or XML format). For complex business flows, multiple API call sequences need to be configured, and the logical relationships between them need to be defined. For example, first execute the login interface to obtain a token, and then use the token to call the user information query interface, forming a "transaction". Stress model configuration: defining the number of concurrent users (virtual users), stress ramping strategy (such as adding 50 users per second until reaching the target of 1000 users), stress duration (such as stable operation for 10 minutes), and think time (simulating user operation intervals). In some embodiments, it may also include whether to use different stress curves, such as wave-shaped or peak-shaped curves, to test the system's resilience. Data association and parameterization: To simulate real-world scenarios and avoid performance illusions caused by caching, dynamic parameters need to be configured. For example, you can read different usernames and passwords from a CSV file to log in, or use regular expressions to extract data from the response of a previous request for use in the next request.
[0041] In this embodiment, the setting of multi-level performance indicator thresholds is the core basis for realizing intelligent decision-making and graded response, introducing a gradient, multi-layered security boundary system. For example, when the real-time collected performance indicator data exceeds the primary threshold, it may only trigger an early warning record; when it exceeds the intermediate threshold, it will initiate degradation actions such as dynamically reducing load pressure; and once the advanced threshold is reached, it will immediately execute a task interruption action to terminate the test, thereby constructing a flexible and intelligent defense line to ensure test security while maximizing the acquisition of effective performance data.
[0042] In step 220, a pre-set timing strategy can be configured to automatically trigger the execution of stress testing tasks. This transforms the stress testing task initiation mechanism from traditional manual triggering to fully automated triggering by a pre-set system strategy, thereby completely freeing human resources from repetitive and periodic operations and ensuring that testing activities can be carried out continuously in a predictable and regular manner. This transforms performance testing from an irregular project-based activity dependent on human memory and operation into a highly reliable foundational service built into the system's operation and maintenance framework. This not only significantly reduces the risk of missing testing windows due to human forgetfulness or negligence, but more importantly, it lays the technical foundation for periodic health checks of online systems. It enables the setting of scheduled stress checks for critical business systems, similar to setting up scheduled backup tasks, to promptly and proactively identify potential performance degradation risks caused by code updates, data growth, or infrastructure changes.
[0043] In step 230, once the stress test task is automatically triggered, it enters a dynamic and continuous execution cycle. During this cycle, based on a predefined stress test scenario, the behavior of a large number of real users or business requests is simulated, applying quantifiable and controllable load pressure to the system under test. This load application is programmatic and automated, aiming to proactively create an environment similar to real business peaks or extreme scenarios to observe and evaluate the behavior, stability, and performance bottlenecks of the system under test under pressure. Throughout this process, various performance metrics reflecting the operational status of the system under test, which is currently under load, can be continuously captured.
[0044] In step 240, the collected performance index data can be compared with the multi-level performance index thresholds, and the corresponding circuit breaker control action can be automatically triggered based on the comparison result to adjust or terminate the stress test task.
[0045] In this embodiment, performance index data that is collected in real time and characterizes the current health status of the system can be quickly and continuously compared with a predefined multi-level performance index threshold safety standard system. This comparison process is not a one-time event, but a continuous monitoring and evaluation throughout the entire stress test. Its purpose is to determine in real time the position of the system's current state relative to the preset safety boundary.
[0046] Based on the comparison results, the corresponding circuit breaker action will be automatically triggered. Specifically, if the comparison finds that a performance indicator has reached a threshold representing a minor risk, an early warning action will be triggered, recording and notifying without directly intervening in the testing process. If the indicator reaches a higher-level threshold requiring active intervention, a degradation-type control action will be triggered, such as dynamically reducing the load pressure applied to the system under test to attempt to restore the system to a stable state. Once the indicator reaches the highest level of safety threshold, representing a system on the verge of collapse, the most stringent interruption action will be triggered, immediately terminating the stress test to protect the production system from irreversible damage. This process is fully automated, requiring no human intervention for analysis, judgment, or manual operation.
[0047] In step 250, when the system triggers any circuit breaker action during testing—whether as an early warning record, a proactive load degradation, or an emergency task interruption—this event itself is a critical signal. This step automatically generates corresponding notification information, clearly informing relevant personnel what event occurred, why it occurred, and the current system snapshot, enabling the automated decision to be traceable and understandable.
[0048] Simultaneously, after a stress test task naturally ends or is interrupted, the system will automatically generate a comprehensive test report based on all data collected throughout the test process. This report will include a test overview, performance trends, SLA achievement status, and circuit breaker event records. For example, please refer to... Figure 3 , Figure 3 This diagram illustrates the implementation logic of a system stress testing method provided in an embodiment of this application. This ensures the transparency and observability of the entire automated process. The operations and maintenance team can promptly grasp the test dynamics and system health status without constantly monitoring the screen, enabling them to quickly respond to anomalies, analyze performance bottlenecks, and perform necessary optimization interventions.
[0049] It is understood that the system stress testing method provided in this application embodiment completes the strategy configuration by predefining stress test scenarios, multi-level performance index thresholds, and associated circuit breaker control actions; subsequently, the test task is automatically triggered to execute according to a preset timing strategy. During the stress test, the system collects performance index data in real time and compares it with multi-level thresholds. Based on the comparison results, it automatically triggers corresponding circuit breaker control actions (such as early warning, dynamic stress reduction, or immediate termination of the test), thereby achieving intelligent protection for the system under test. Finally, a notification is automatically generated and sent based on the circuit breaker event or test results. This method realizes unattended and intelligent stress testing throughout the entire process from task triggering and execution monitoring to security intervention, significantly improving testing efficiency and system security.
[0050] Specifically, in some embodiments, obtaining the predefined stress test scenario, multi-level performance index thresholds, and circuit breaker control actions associated with each level of the performance index thresholds includes: Obtain the user's configuration information; wherein, the configuration information includes: The stress test scenario includes at least one of the following: target address for stress test, request parameters, request headers, think time, number of concurrent users, and duration of stress test; The multi-level performance indicator thresholds are bound to the stress test scenario, wherein the multi-level performance indicator thresholds include at least a primary threshold, an intermediate threshold, and a high-level threshold; And circuit breaker control actions associated with the performance index thresholds at each level, wherein the primary threshold is associated with an early warning action, the intermediate threshold is associated with a degradation action to dynamically reduce the test load, and the advanced threshold is associated with an interrupt action to immediately terminate the test.
[0051] In this embodiment, users can define load testing tasks through configuration information, including load testing scenarios, multi-level performance metric thresholds, and circuit breaker actions. Specifically, load testing scenarios may include, but are not limited to, target URLs, HTTP methods, request bodies, request headers, concurrent users, load ramp-up time, and duration. Multiple API combination scenarios are supported, and transaction logic can be configured.
[0052] For performance metric thresholds, multiple threshold levels can be defined for key performance metrics, for example: Primary threshold (warning line): 95% of requests have a response time of <100ms; Intermediate threshold (degradation line): 99% of requests have a response time <500ms or an error rate >0.1%; Advanced threshold (interruption line): System survivable nodes <80%, CPU utilization >90%, or error rate >5%.
[0053] In this embodiment, each performance metric threshold is bound to a circuit breaker control action. The strategy for the circuit breaker control action is based on a sliding window algorithm using a queue. The algorithm divides time into fixed segments, records the timestamp of each request, and forms a queue to store the timestamp of each request (or event objects with success / failure flags). All remaining requests in the queue are requests that occurred within the most recent time window. The algorithm counts the number of failures among these requests to calculate the failure rate. Exemplarily, in some embodiments, the circuit breaker control action can be configured as follows: When the primary threshold is triggered, an alert action is executed (logging is recorded, but load testing is not affected).
[0054] When the intermediate threshold is triggered, a degradation action is performed (such as automatically reducing the pressure by 50%).
[0055] When an advanced threshold is triggered, an interrupt action is performed (immediately stop all load testing threads and release resources).
[0056] Record events: Each time a request occurs, add its timestamp to the end of the queue.
[0057] Each time a new request arrives or a calculation is performed, check if the element at the head of the queue (the oldest request) exceeds the range of the current time minus the time window. If it does, remove it from the queue. At this point, all requests remaining in the queue are those that occurred within the most recent time window. The failure rate can be calculated by counting the number of failures among these requests.
[0058] The configuration information may also include alarm notification configuration, which is used to configure the list of alarm recipients and notification channels.
[0059] Specifically, in some embodiments, reference is made to Figure 4 The automatic triggering of stress test tasks according to a preset timing strategy includes: The trigger time is determined according to the preset timing strategy; Detect whether the current time point has reached the trigger time point; In response to the current time point reaching the trigger time point, the execution of the stress test task is triggered.
[0060] In this embodiment, the user can set a timing strategy to accurately calculate the trigger time for the next task execution. Subsequently, the current time is continuously compared with this preset trigger time. This is a proactive, periodic monitoring process that requires no external manual intervention. Once the system confirms that the current time has reached or exceeded the preset trigger time, it automatically responds to this condition fulfillment event and immediately initiates the corresponding stress test task execution process. This transforms task initiation from a passive, manual operation into a proactive, time-driven event. It ensures that performance tests can be reliably activated and executed at designated times (e.g., during the daily off-peak business hours in the early morning), providing a solid technical foundation for periodic, routine system performance inspections and completely eliminating the risk of missing test windows due to human forgetfulness or negligence.
[0061] Specifically, in some embodiments, the collection of performance index data of the system under test includes: Collect at least one of the system indicator data, application indicator data, and business indicator data of the system under test; The system metrics include CPU utilization, memory utilization, disk I / O, and network traffic; the application metrics include queries per second, transactions per second, response time, and error rate; and the business metrics include order success rate and payment success rate.
[0062] Specifically, in some embodiments, reference is made to Figure 5 The step of comparing the collected performance index data with the multi-level performance index thresholds and automatically triggering the corresponding circuit breaker control action based on the comparison result includes: The collected performance index data is preprocessed, and a comprehensive risk score is calculated based on the preprocessed performance index data. The comprehensive risk score is compared with the multi-level performance index thresholds, and the corresponding circuit breaker control action is triggered based on the threshold range in which the comprehensive risk score falls.
[0063] Specifically, in some embodiments, reference is made to Figure 6 The step of preprocessing the collected performance index data and calculating a comprehensive risk score based on the preprocessed performance index data includes: The collected performance index data is cleaned to remove invalid, transient anomaly data; Based on the volatility of the current request, the time window length for the performance indicator data used to calculate the comprehensive risk score is dynamically adjusted. Calculate the corresponding risk sub-score based on the performance index data for each of the aforementioned time window lengths; The comprehensive risk score is obtained by weighted summation of the risk sub-scores.
[0064] In this embodiment of the application, after receiving the collected performance index data, data preprocessing can be performed. Data preprocessing can improve the misjudgment problem of sudden traffic and gradual pressure increase scenarios in fixed time windows, and provide a high-quality data foundation for subsequent SLA comparison.
[0065] For example, data preprocessing in this application embodiment may include the following process: Data cleaning and standardization: By collecting extreme data (such as invalid data with instantaneous CPU utilization of 100% but lasting less than 1 second) generated during the collection process, valid data samples are retained; Adaptive time window adjustment: Based on request volatility = (current 5-second maximum concurrency - current 5-second minimum concurrency) / current 5-second average concurrency, with the following rules: Volatility ≤10% (stable flow): Fixed window of 5 seconds, matching the SLA threshold calculation cycle; 10% < Volatility ≤ 50% (Flow Fluctuation): The window is reduced to 2 seconds to improve the sensitivity to indicator changes; Volatility > 50% (burst traffic): Use a sliding step of 1 second and a window length of 3 seconds to capture the true indicators of high load; Based on the preprocessed standardized data, the indicators are divided into levels and dynamic weights are assigned, as shown in the table below: Table 1
[0066] When calculating the overall risk score, for a single performance indicator, the actual value of the indicator can be divided by the performance indicator threshold to obtain the corresponding risk sub-score. Then, all the risk sub-scores are weighted to obtain the overall risk score.
[0067] The comparison rules with performance indicator thresholds can be as follows: If the total score is <0.8: all indicators meet the SLA requirements, it is judged as "normal", no circuit breaker action is triggered, and the stress test continues; If 0.8 ≤ total score < 1.0: the "primary SLA threshold" (corresponding to the primary warning line) has been reached, and the status is determined to be "warning state"; If 1.0 ≤ Total Score < 1.2: The “Intermediate SLA Threshold” (corresponding to the intermediate downgrade line) has been reached, and the status is determined to be “downgraded”. If the total score is ≥1.2: the "Advanced SLA Threshold" (corresponding to the Advanced Interruption Line) is reached, and the status is determined to be "Interruption State".
[0068] Specifically, in some embodiments, reference is made to Figure 7 The circuit breaker control action includes a degradation action and an interruption action; the automatic triggering of the corresponding circuit breaker control action based on the comparison result includes: In response to triggering the degradation action, the load pressure applied to the system under test is dynamically reduced; In response to the interrupt action, the stress test task is stopped and the test status information is saved.
[0069] Reference Figure 8 In this embodiment, hierarchical decision-making is performed based on threshold comparison results to achieve predictive early warning, thereby achieving "precise response + early prevention". The hierarchical decision-making and execution process includes: Normal state (total score < 0.8): The monitoring center sends a "continue load test" command to the load testing engine and simultaneously stores real-time indicator data in the test log for use in subsequent report generation; Warning status (0.8≤total score<1.0): The monitoring center generates a "primary circuit breaker warning event", records the indicator details at the time of the warning, does not interfere with the execution of the stress test, but pushes the warning information to the alarm notification in real time; Degraded status (1.0≤Total score<1.2): The monitoring center sends an “intermediate circuit breaker-degrade” command to the load testing engine. The command must specify the adjustment parameters (such as “concurrency reduced from the current 3000 to 1500, request frequency reduced by 50%), and record the degradation trigger conditions and adjustment parameters. Interruption status (total score ≥ 1.2): The monitoring center sends an "Advanced Circuit Breaker - Interruption" command to the load testing engine, and simultaneously triggers an emergency alarm process (such as prioritizing notifying the operations and maintenance manager by phone) to ensure that the load test stops immediately to protect system security.
[0070] Decision output: Decision results are transmitted through a dedicated channel (delay ≤ 1 second), and logs are synchronized to the configuration management module for traceability.
[0071] The execution of circuit breaker control actions can include the following process: Upon receiving the command, the load testing engine immediately executes the corresponding action. The load testing engine responds immediately upon receiving the command: Degradation: Dynamically adjust thread pool size, request frequency, timeout, etc. Interruption: Gracefully stop all threads, saving the current test state and logs; In this embodiment, a test report is automatically generated after the test, including: SLA achievement status, circuit breaker event records, performance trend charts, and bottleneck analysis suggestions. The report is pushed via email or message, along with a link to detailed analysis. For degradation instructions: the stress model is dynamically adjusted, such as reducing the number of concurrent threads or lowering the request frequency. For interrupt instructions: all stress test threads are immediately stopped, and the final state at the time of interruption is recorded.
[0072] In a specific implementation case, the method execution flow of this application is as follows: Core system nighttime inspection (stress test scenario: login / balance check / transfer interface, concurrency 1000→5000; SLA configuration: basic - login P95 < 100ms, intermediate - transfer error rate > 0.1% or P99 > 500ms, advanced - CPU > 85% or memory > 80%), step four is executed as follows: ① At 2:08 AM, the stress test entered the "concurrency 3000" stage, and the requested volatility was approximately 13.3% (10% < volatility ≤ 50%). The dynamic window was automatically adjusted to 2 seconds. ② Monitoring center collected the following metrics: CPU = 78% (threshold 85%), transfer interface error rate = 0.2% (threshold 0.1%), P99 = 520ms (threshold 500ms), non-stress test business traffic percentage = 25% (threshold 50%). ③ Calculate the circuit breaker risk score: Core metric score = (78% / 85% × 20%) + (database connection pool utilization rate 70% / 80% × 20%) ≈ 0.184 + 0.175 = 0.359; Business performance indicator score = (0.2% / 0.1% × 35%) = 0.7; Environmental indicator score = (25% / 50% × 25%) = 0.125; Total score = 0.359 + 0.7 + 0.125 = 1.184 (1.0 ≤ score < 1.2), judged as "downgraded status"; ④ The monitoring center sent a "degradation instruction: reduce the concurrency from 3000 to 1500" to the load testing engine, and predicted the indicators for the next 10 seconds: if the current adjustment is maintained, the prediction error rate will drop to 0.08%, the P99 will drop to 450ms, and the total score will drop to 0.85, so no pre-warning was triggered; ⑤ At 2:10 AM, the indicators were updated: error rate = 0.07%, P99 = 440ms, total score = 0.32 + 0.245 + 0.125 = 0.69 (< 0.8), which was judged as "normal state". The monitoring center sent the "continue load test" command, and the load test was gradually restored after adjustment.
[0073] It is understood that the technical solutions provided in the embodiments of this application have at least the following advantages: 1. Multi-level SLA and fuse protection: This fundamentally solves the risk of traditional stress testing potentially collapsing the production system. Through a tiered strategy, it can both prevent serious accidents and provide flexible protection, achieving intelligent safety protection.
[0074] 2. Unattended timed triggering: Completely frees manpower from repetitive manual testing, realizing 24 / 7 automated performance inspection, greatly improving efficiency, reducing labor costs, and perfectly matching the CI / CD process.
[0075] 3. Real-time closed-loop control process: This changes the "mindless" stress application mode of load testing tools, giving them intelligent adjustment capabilities based on feedback. The testing process is no longer open-loop, but a closed-loop process that can adaptively adjust according to the system state.
[0076] 4. Tiered circuit breaker method: This method avoids the "overreaction" of terminating the test entirely due to minor fluctuations in indicators. It can maximize the acquisition of performance data (e.g., continue testing after downgrading) while ensuring system security, and help to more accurately locate problems.
[0077] 5. Intelligent alarm notification: The test results are proactively and accurately pushed to the relevant responsible persons, which shortens the time for fault discovery and location, forms a complete operation and maintenance closed loop of "inspection-discovery-alarm-handling", and improves system stability.
[0078] 6. Integrated System Architecture: It integrates scattered functions (stress testing, monitoring, alarms) into an organic whole system, providing a one-stop solution, improving reliability and ease of use, and avoiding the complexity and instability of self-integration.
[0079] Reference Figure 9 This application also provides a system stress testing device, which includes: The acquisition unit 910 is used to acquire predefined stress test scenarios, multi-level performance index thresholds, and circuit breaker control actions associated with each level of the performance index thresholds. The execution unit 920 is used to automatically trigger the execution of stress test tasks according to a preset timing strategy; The acquisition unit 930 is used to apply a load to the system under test and collect the performance index data of the system under test in real time during the execution of the stress test task. Trigger unit 940 is used to compare the collected performance index data with the multi-level performance index thresholds, and automatically trigger the corresponding circuit breaker control action according to the comparison result to adjust or terminate the stress test task. The generation unit 950 is used to generate and send notification information based on the triggering of the fuse control action and / or the result of the stress test task.
[0080] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0081] This application also provides an electronic device, including: At least one processor; At least one memory for storing at least one program; When at least one program is executed by at least one processor, the at least one processor performs the system stress test method described above.
[0082] The electronic device in the embodiments of this application may be a terminal device, a computer device, or a server device.
[0083] For example, taking a server device as an example, refer to Figure 10The server device 1000 can vary significantly due to differences in configuration or performance. It may include one or more central processing units (CPUs) and memory 1060, and one or more storage media 1030 (e.g., one or more mass storage devices) for storing application programs 1033 or data 1032. The memory 1060 and storage media 1030 may be temporary or persistent storage. The program stored in the storage media 1030 may include one or more units or modules, each of which may include a series of operation instructions for the server device 1000. Furthermore, the CPU 1010 may be configured to communicate with the storage media 1030 and execute the series of operation instructions stored in the storage media 1030 on the server device 1000.
[0084] Server device 1000 may also include one or more power supplies 1020, one or more wired or wireless network interfaces 1040, one or more input / output interfaces 1050, and one or more operating systems 1031.
[0085] The central processing unit 1010 in server device 1000 can be used to perform, for example, Figure 2 The system stress test method shown is an example.
[0086] Similarly, the content of the above method embodiments is applicable to the embodiments of this electronic device. The specific functions implemented by the embodiments of this electronic device are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0087] This application embodiment also provides a computer-readable storage medium storing a program executable by a central processing unit 1010, which, when executed by the central processing unit 1010, is used to perform the above-described system stress test method.
[0088] Similarly, the content of the above method embodiments is applicable to the present computer-readable storage medium embodiments. The specific functions implemented by the present computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0089] This application also discloses a computer program product or computer program, which includes computer instructions stored in the aforementioned computer-readable storage medium. Figure 10The processor of the illustrated electronic device can read the computer instructions from the aforementioned computer-readable storage medium, and the processor executes the computer instructions, causing the electronic device to perform... Figure 2 The system stress test method shown is an example.
[0090] Understandable Figure 2 The content of the system stress testing method embodiments shown is applicable to this computer program product or computer program embodiment, and the specific functions implemented by this computer program product or computer program embodiment are the same as those shown. Figure 2 The system stress testing method shown in the embodiment is the same, and the beneficial effects achieved are the same. Figure 2 The beneficial effects achieved by the system stress testing method embodiment shown are also the same.
[0091] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this application are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.
[0092] Furthermore, although this application is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding this application. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional technology for an engineer. Therefore, those skilled in the art can implement the application set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of this application, which is determined by the full scope of the appended claims and their equivalents.
[0093] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0094] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0095] More specific examples (a non-exhaustive list) of computer-readable media include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0096] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0097] In the foregoing description of this specification, the references to terms such as "one embodiment," "another embodiment," or "some embodiments," etc., indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0098] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
[0099] The above is a detailed description of the preferred embodiments of this application, but this application is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A system stress testing method, characterized by, The method comprises: obtaining a predefined stress test scenario, a multi-level performance indicator threshold value, and a fuse control action associated with each level of the performance indicator threshold value; automatically triggering execution of a stress test task according to a preset timing strategy; in the process of executing the stress test task, applying a load to the measured system and collecting performance indicator data of the measured system in real time; comparing the collected performance indicator data with the multi-level performance indicator threshold value, and automatically triggering the corresponding fuse control action according to the comparison result to adjust or terminate the stress test task; generating and sending notification information according to the triggering of the fuse control action and / or the result of the stress test task.
2. The method of claim 1, wherein, The method comprises: obtaining configuration information of a user; wherein the configuration information comprises: a stress test scenario, including at least one of a stress test target address, request parameters, request headers, thinking time, number of concurrent users, and stress test duration; a multi-level performance indicator threshold value bound to the stress test scenario, wherein the multi-level performance indicator threshold value at least includes a primary threshold value, an intermediate threshold value, and a high-level threshold value; and a fuse control action associated with each level of the performance indicator threshold value, wherein the primary threshold value is associated with a warning action, the intermediate threshold value is associated with a degradation action for dynamically reducing test load, and the high-level threshold value is associated with an interruption action for immediately terminating the test.
3. The method of claim 1 or 2, wherein, The method comprises: determining a triggering time point according to a preset timing strategy; detecting whether the current time point reaches the triggering time point; in response to the current time point reaching the triggering time point, triggering execution of a stress test task.
4. The method of claim 1, wherein, The method comprises: collecting at least one of system indicator data, application indicator data, and business indicator data of the measured system; wherein the system indicator data includes CPU usage, memory usage, disk I / O, and network traffic, the application indicator data includes query rate per second, transaction number per second, response time, and error rate, and the business indicator data includes order success rate and payment success rate.
5. The method of claim 1, wherein, The method comprises: preprocessing the collected performance indicator data, and calculating a comprehensive risk score based on the preprocessed performance indicator data; comparing the comprehensive risk score with the multi-level performance indicator threshold value, and triggering the corresponding fuse control action according to the threshold interval in which the comprehensive risk score falls.
6. The method of claim 5, wherein, The method comprises: performing data cleaning on the collected performance indicator data to remove invalid transient abnormal data; dynamically adjust a time window length of performance indicator data used to calculate the comprehensive risk score based on a current requested volatility; calculate a corresponding risk sub-score according to performance indicator data under each of the time window lengths; perform a weighted summation of the risk sub-scores to obtain the comprehensive risk score.
7. The method of claim 1, wherein, The fuse control actions include a degradation action and an interruption action; and the automatically triggering the corresponding fuse control action according to the comparison result comprises: in response to triggering the degradation action, dynamically reducing a load pressure applied to the measured system; in response to triggering the interruption action, stopping the pressure test task and saving test state information.
8. A system stress testing apparatus, characterized by, The system comprises: an acquisition unit configured to acquire a predefined pressure test scenario, multi-level performance indicator thresholds, and fuse control actions associated with each level of the performance indicator thresholds; an execution unit configured to automatically trigger execution of a pressure test task according to a preset timing strategy; a collection unit configured to apply a load to a measured system and collect performance indicator data of the measured system in real time during execution of the pressure test task; a triggering unit configured to compare the collected performance indicator data with the multi-level performance indicator thresholds and automatically trigger a corresponding fuse control action according to a comparison result to adjust or terminate the pressure test task; a generation unit configured to generate and send notification information according to triggering of the fuse control actions and / or a result of the pressure test task.
9. An electronic device, comprising: comprise: at least one processor; at least one memory configured to store at least one program; when the at least one program is executed by the at least one processor, the at least one processor implements a system pressure test method as claimed in any one of claims 1-7.
10. A computer readable storage medium having stored therein a program that is executable by a processor, characterized in that, The program executable by the processor, when executed by the processor, is used to implement a system pressure test method as claimed in any one of claims 1-7.