Aliyun-based pressure test system and method for rapidly switching shadow environment
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JINBAOXIN SOCIAL SECURITY CARD TECH CO LTD
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-12
AI Technical Summary
(1)配置操作繁琐:需要手动更改数据库、redis(开源内存数据结构存储系统)等配置参数,并通过重启服务器完成切换,涉及多个微服务的重启过程会导致时间浪费
[0047]根据本申请提供的具体实施例,本申请具有了以下技术效果。
Smart Images

Figure CN122019400A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Java distributed system stress testing technology, and in particular to a stress testing system and method based on Alibaba Cloud for quickly switching shadow environments. Background Technology
[0002] Because Java distributed systems need to withstand high traffic volumes, full-link stress testing (or load testing) is necessary to understand the current system's capacity and identify potential bottlenecks affecting system performance. There are generally three approaches to full-link stress testing: The first is to directly simulate normal traffic, which impacts user experience and generates a large amount of dirty data. The second is to use a buffer shield approach, which cannot fully simulate real user requests. The third is to use a shadow link approach, conducting stress testing in a shadow environment to ensure the testing environment is the same as the production server, only the storage is changed to a shadow database. This approach requires at least two data centers to avoid impacting user experience. For the third approach, since a single point in the system cannot handle high-volume requests, the business logic needs to be broken down into multiple microservices, each deployed across multiple servers to form a distributed system.
[0003] When performing stress testing on Java distributed systems in a production environment, the following issues arise: (1) Cumbersome configuration operation: It is necessary to manually change the configuration parameters of the database, Redis (an open source in-memory data structure storage system), and complete the switch by restarting the server. The restart process involving multiple microservices will lead to a waste of time.
[0004] (2) Poor log management: A large number of logs will be generated during the stress test, but the traditional log collection pipeline may be congested, and log collection in the production environment needs to be suspended.
[0005] (3) The rate limiting operation is complicated: During the load test, the application-related rate limiting mechanism needs to be turned off. However, if the operation sequence is not correct, it may affect the production environment or cause unpredictable consequences.
[0006] (4) Lack of automated management: The existing stress testing process lacks unified management, making it impossible to monitor and analyze stress test results in real time, resulting in time-consuming and inefficient troubleshooting.
[0007] In summary, these problems not only increase the time cost of stress testing and reduce its efficiency, but may also have a potential impact on the production environment, ultimately affecting the stability and availability of the production environment system. Summary of the Invention
[0008] The purpose of this application is to provide a stress testing system and method based on Alibaba Cloud for quickly switching shadow environments, which can reduce the time cost of stress testing, improve the efficiency of stress testing, and ensure the stability and availability of the production environment system.
[0009] To achieve the above objectives, this application provides the following solution.
[0010] In the first aspect, this application provides a stress testing system based on Alibaba Cloud's fast shadow environment switching, which includes: a log collection and management module, an environment switching module, a stress testing management and analysis module, and an automated process module.
[0011] The log collection and management module is used to modify the application framework's log configuration file to direct the load test logs to a temporary path independent of the production environment, and to automatically delete the load test logs after the load test is completed.
[0012] The environment switching module is used to call Alibaba Cloud API to achieve one-click switching between the production environment and the shadow environment by pre-setting the JVM parameters required for stress testing, and to trigger application restart.
[0013] The load testing management and analysis module provides a task management interface for submitting load testing tasks, records load testing metrics and exception logs in real time, and calls the large model interface to analyze problems that occur during the load testing process and generate analysis reports.
[0014] The automated process module is used to encapsulate the current limiting switch interface, control the start and stop of the current limiting state, and automatically execute the environment switching and restart process.
[0015] Optionally, the log collection and management module specifically includes the following units.
[0016] The log path adjustment unit is used to dynamically adjust the log path based on the Lombak configuration, so that the load test logs are written to a temporary directory to isolate the production log collection channel.
[0017] The log cleanup unit is used to automatically clean up log files in the temporary directory after the load test is completed.
[0018] Optionally, the environment switching module specifically includes the following units.
[0019] The JVM parameter loading unit is used to load pre-defined JVM parameters using Spring.profiles.active.
[0020] The Alibaba Cloud API unit is used to call the Alibaba Cloud API based on the JVM parameters to batch modify the database connection parameters of the Nacos configuration center to the shadow library and trigger the application restart.
[0021] Optionally, the stress test management and analysis module specifically includes the following units.
[0022] The load testing task management unit is used to generate a task management interface for submitting load testing tasks.
[0023] The metrics and log recording unit is used to record load test metrics and anomaly logs in real time.
[0024] The problem analysis and report generation unit is used to analyze the problems that occur during the load testing process and generate an analysis report by calling the large model interface based on the load testing indicators and anomaly logs.
[0025] Optionally, the stress test management and analysis module further includes the following units.
[0026] The flame graph generation unit is used to collect the CPU running status of the application server and generate a flame graph to locate application performance problems.
[0027] The load test report integration unit is used to receive load test results uploaded by users, call Alibaba Cloud interfaces to obtain the performance indicators of the current application server, and generate a comprehensive load test report based on the performance indicators of the current application server and the load test results.
[0028] Optionally, the automated process module specifically includes the following units.
[0029] The current limiting switch unit is used to encapsulate the current limiting switch interface and control the start and stop of the current limiting state.
[0030] The environment switching and restart unit is used to automate the environment switching and restart process.
[0031] Secondly, this application provides a stress testing method based on Alibaba Cloud's fast shadow environment switching. The stress testing method based on Alibaba Cloud's fast shadow environment switching is applied to the stress testing system based on Alibaba Cloud's fast shadow environment switching. The stress testing method based on Alibaba Cloud's fast shadow environment switching includes the following steps.
[0032] Enter the IP addresses of the microservices to be tested and the default application. Create a load test task.
[0033] After submitting the load test task, call the Alibaba Cloud API to switch JVM parameters and restart the application to enter the shadow environment.
[0034] When performing the load test, the current limiting status is dynamically controlled via interface buttons.
[0035] After the load test is completed, clicking the "End" button will trigger the system to switch back to the production environment.
[0036] After uploading the load test results, the system automatically associates performance metrics and calls the large model to generate a comprehensive load test report.
[0037] Optionally, after submitting the load testing task, call the Alibaba Cloud API to switch JVM parameters and restart the application to enter the shadow environment, specifically including the following steps.
[0038] Use Spring.profiles.active to load pre-defined JVM parameters.
[0039] Based on the JVM parameters, call the Alibaba Cloud API to batch modify the database connection parameters of the Nacos configuration center to the shadow database.
[0040] Call the application restart API to switch environments and enter the shadow environment.
[0041] Optionally, after the stress test task is completed, after clicking the end button to trigger the system to switch back to the production environment, and before uploading the stress test results and the system automatically associates performance indicators and calls the large model to generate an analysis report, the stress test method based on Alibaba Cloud to quickly switch shadow environments also includes the following steps.
[0042] Click the flame graph button to generate a flame graph.
[0043] Click the "View Flame Graph" button to see the real-time CPU status of the application server.
[0044] Optionally, the system will upload the load test results, automatically associate performance indicators, and call the large model to generate a comprehensive load test report, which includes the following steps.
[0045] Upload the load test results and call the Alibaba Cloud API to obtain the performance metrics of the current application server.
[0046] A comprehensive stress test report is generated based on the current application server's performance metrics and the stress test results.
[0047] According to the specific embodiments provided in this application, this application has the following technical effects.
[0048] This application provides a stress testing system and method based on Alibaba Cloud for rapid switching between shadow environments. The stress testing system includes a log collection and management module, an environment switching module, a stress testing management and analysis module, and an automated process module. The log collection and management module modifies the application framework's log configuration file to redirect stress testing logs to a temporary path independent of the production environment and automatically deletes the logs after the stress test is completed. The environment switching module uses pre-configured JVM parameters required for the stress test to call Alibaba Cloud APIs for one-click switching between the production and shadow environments and triggers an application restart. The stress testing management and analysis module provides a task management interface for submitting stress testing tasks, records stress testing metrics and exception logs in real time, and calls large model interfaces to analyze problems encountered during the stress test and generate analysis reports. The automated process module encapsulates a rate limiting switch interface to control the start and stop of rate limiting and automates the environment switching and restart process. On the one hand, this application modifies log configuration files and manages load test logs through a log collection and management module, enables one-click switching between the production and shadow environments through an environment switching module, and automates environment switching and restart processes through automated configuration switching and log management. This reduces manual operation time, significantly lowers the time cost of load testing, and improves its efficiency. On the other hand, this application writes load test logs to a temporary path independent of the production environment and automatically deletes them after load testing. It also pre-configures the JVM parameters required for load testing and controls the start and stop of rate limiting by encapsulating a rate limiting switch interface. By utilizing the above-mentioned pre-configured settings and permission restrictions, this application ensures that load testing operations will not affect or interfere with the production environment, guaranteeing the stability and availability of the production system. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 This is a structural framework diagram of a stress testing system based on Alibaba Cloud for quickly switching shadow environments, provided as an embodiment of this application.
[0051] Figure 2 This is an overall architecture diagram of a stress testing system based on Alibaba Cloud for quickly switching shadow environments, provided as an embodiment of this application.
[0052] Figure 3 This is a schematic diagram of a stress testing system based on Alibaba Cloud's fast shadow environment switching, provided as an embodiment of this application.
[0053] Figure 4 This is a schematic diagram of the interface for adding a load testing task provided in an embodiment of this application.
[0054] Figure 5 This is a schematic diagram of the flame graph generation interface provided in one embodiment of this application.
[0055] Figure 6 This is a flowchart illustrating a stress testing method based on Alibaba Cloud for quickly switching shadow environments, as provided in one embodiment of this application. Detailed Implementation
[0056] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0057] This application provides a stress testing system and method based on Alibaba Cloud for rapid switching of shadow environments. The aim is to achieve rapid switching of shadow environments on Alibaba Cloud without cumbersome manual configuration, enabling log collection and management during the stress testing process and avoiding log congestion. The rate limiting operation process is optimized to ensure it operates within safe limits. An efficient stress testing log management system is established, and data analysis is used to improve troubleshooting efficiency, thereby reducing the time cost of stress testing, improving stress testing efficiency, and ensuring the stability and availability of the production environment system.
[0058] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0059] like Figure 1 As shown in the figure, this embodiment provides a stress testing system based on Alibaba Cloud's fast shadow environment switching. The stress testing system based on Alibaba Cloud's fast shadow environment switching includes: a log collection and management module, an environment switching module, a stress testing management and analysis module, and an automated process module.
[0060] The log collection and management module is used to modify the application framework's log configuration file to direct the load test logs to a temporary path independent of the production environment, and to automatically delete the load test logs after the load test is completed.
[0061] The environment switching module is used to switch between the production environment and the shadow environment with one click by calling the Alibaba Cloud API (application programming interface) through the preset JVM (Java Virtual Machine) parameters required for stress testing, and to trigger the application restart.
[0062] The load testing management and analysis module provides a task management interface for submitting load testing tasks, records load testing metrics and exception logs in real time, and calls the large model interface to analyze problems that occur during the load testing process and generate analysis reports.
[0063] The automated process module is used to encapsulate the current limiting switch interface, control the start and stop of the current limiting state, and automatically execute the environment switching and restart process.
[0064] In this embodiment, the production environment refers to the actual business environment used by the user, where all configurations, data, and resources are real business services. The shadow environment refers to an isolated environment built for stress testing, reusing server resources from the production environment but isolating the storage layer and data flow. Key differences between the production environment and the shadow environment are shown in Table 1.
[0065] Table 1 Key differences between production environment and shadow environment Since load testing directly in the production environment can interfere with users, generate dirty data, or cause system failures, this embodiment requires a quick switch from the production environment to a shadow environment for load testing. After the load testing is completed, the system switches back from the shadow environment to the production environment. Load testing in the shadow environment directly simulates high concurrency on the production server, making the load testing results more accurate and not affecting real users and data. It does not require rebuilding the entire environment and can be quickly enabled through configuration switching, which is both safe and efficient.
[0066] In this embodiment, the log collection and management module specifically includes a log path adjustment unit and a log cleanup unit. The log path adjustment unit dynamically adjusts the log path based on Lombak configuration, writing load test logs to a temporary directory to isolate the production log collection channel. The log cleanup unit automatically cleans up the log files in the temporary directory after the load test is completed.
[0067] In this embodiment, the environment switching module specifically includes a JVM parameter loading unit and an Alibaba Cloud API unit. The JVM parameter loading unit is used to load pre-configured JVM parameters using Spring.profiles.active. The Alibaba Cloud API unit is used to call the Alibaba Cloud API based on the JVM parameters to batch modify the database connection parameters of the Nacos configuration center to the shadow database and trigger application restart.
[0068] Spring.profiles.active is the core mechanism in the Spring Boot framework for dynamically switching environment configurations. Spring Boot's multi-environment configuration support mechanism loads the corresponding configuration by activating different profiles.
[0069] This embodiment dynamically loads shadow configurations (such as database connection strings) using Spring.profiles.active and calls the Alibaba Cloud API to achieve a second-level switch from the production environment to the shadow environment. This eliminates the need to manually modify Nacos or restart the service, thereby achieving the goal of quickly switching shadow environments based on Alibaba Cloud and effectively improving load testing efficiency.
[0070] In this embodiment, the load testing management and analysis module specifically includes: a load testing task management unit, a metrics and log recording unit, and a problem analysis and report generation unit. The load testing task management unit is used to generate a task management interface for submitting load testing tasks. The metrics and log recording unit is used to record load testing metrics and anomaly logs in real time. The problem analysis and report generation unit is used to analyze problems occurring during the load testing process and generate an analysis report based on the load testing metrics and anomaly logs by calling a large model interface.
[0071] In this embodiment, the load testing management and analysis module further includes a flame graph generation unit and a load testing report integration unit. The flame graph generation unit collects the CPU operating status of the application server and generates a flame graph to locate application performance issues. The load testing report integration unit receives load testing results uploaded by users, calls the Alibaba Cloud interface to obtain the performance metrics of the current application server, and generates a comprehensive load testing report based on the performance metrics of the current application server and the load testing results.
[0072] In this embodiment, the automated process module specifically includes a current limiting switch unit and an environment switching and restart unit. The current limiting switch unit is used to encapsulate the current limiting switch interface and control the start and stop of the current limiting state. The environment switching and restart unit is used to automatically execute the environment switching and restart process.
[0073] like Figure 2 As shown, the overall architecture of the stress testing system based on Alibaba Cloud's fast shadow environment switching includes a storage layer, an application layer, and an internet layer. The storage layer includes databases, Redis, and OSS (Object Storage Service). The application layer includes stress testing task management services, Alibaba Cloud APIs, Alibaba Cloud, large models, and specific services, including services A, service B, etc. The internet layer includes browsers.
[0074] like Figure 3As shown in the figure, this embodiment uses Alibaba Cloud's fast shadow environment switching stress testing system. During the stress testing process, the system first logs into the stress testing task management system, creates a stress testing service and a stress testing task, respectively. After creating the stress testing task, the system selects the stress testing service and then checks if the service exists. If it does, the stress testing task is created; otherwise, the stress testing service is recreated. After the stress testing task is created, the system clicks the "Start Stress Testing" button to switch to the stress testing environment, i.e., switching from the production environment to the shadow environment for stress testing. Then, a flame graph is generated. Clicking the "End Stress Testing" button ends the stress testing, at which point the system switches back from the shadow environment to the production environment, and server performance metrics are generated. Based on the flame graph and server performance metrics, the system transmits the flame graph and server performance metrics to the large model to generate a performance analysis report, which can be viewed at any time by logging into the stress testing task management system.
[0075] In one exemplary embodiment, a stress testing method based on Alibaba Cloud's fast shadow environment switching is provided. This stress testing method based on Alibaba Cloud's fast shadow environment switching is applied to the stress testing system based on Alibaba Cloud's fast shadow environment switching, and includes the following steps.
[0076] Step 1: Enter the IP addresses of the microservice to be tested and the default application. Step 2: Create a load test task.
[0077] Figure 4 The interface for adding a load testing task is shown. Creating a load testing task in this interface requires filling in information such as the load testing topic, load testing center, load testing application, and load testing interface, and selecting whether to rate limit. After filling in the above information, the load testing task creation is complete.
[0078] Step 3: After submitting the load test task, call the Alibaba Cloud API to switch JVM parameters and restart the application to enter the shadow environment.
[0079] Step 4: When performing the load test, dynamically control the current limiting status through the interface buttons.
[0080] Step 5: After the stress test is completed, click the End button to trigger the system to switch back to the production environment.
[0081] Step 6: Upload the load test results. The system will automatically associate performance indicators and call the large model to generate a comprehensive load test report.
[0082] Step 3 specifically includes the following steps.
[0083] Step 31: Load the pre-defined JVM parameters using Spring.profiles.active.
[0084] Step 32: Based on the JVM parameters, call the Alibaba Cloud API to batch modify the database connection parameters of the Nacos configuration center to the shadow database.
[0085] Step 33: Call the application restart interface to switch environments and enter the shadow environment.
[0086] The stress testing method based on Alibaba Cloud's rapid switching of shadow environments includes the following steps after step 5 and before step 6.
[0087] Click the flame graph button to generate a flame graph. Figure 5 The interface for generating flame graphs is shown.
[0088] Click the "View Flame Graph" button to see the real-time CPU status of the application server.
[0089] Step 6 specifically includes the following steps.
[0090] Step 61: Upload the load test results and call the Alibaba Cloud API to obtain the performance metrics of the current application server.
[0091] Step 62: Generate a comprehensive stress test report based on the current application server's performance metrics and the stress test results.
[0092] To make the technical solution of this embodiment clearer, the following will use examples to illustrate in detail the specific structure and working process of the stress testing system based on Alibaba Cloud's fast switching shadow environment.
[0093] This embodiment proposes a stress testing system based on Alibaba Cloud for rapid switching of shadow environments. This system is applicable to any production environment based on a Java distributed system, provided that the application system is multi-center and stress testing is performed under the premise that one center has no traffic. It is particularly suitable for stress testing scenarios in complex microservice architectures with high concurrency, as well as stress testing scenarios for application systems that require rapid verification of new features or adjustment of performance parameters. The system mainly includes the following functional modules.
[0094] (1) Log collection and management module.
[0095] In production environments, user requests typically generate a large number of request logs. Storing these logs facilitates the analysis of user behavior and provides convenience for troubleshooting. When business requests generate logs in a designated directory, corresponding log collection tools on the server collect them and upload them to a designated log processing server for processing and storage in Elasticsearch. During normal load testing, the large amount of load testing logs generated can congest the normal log collection channels in production.
[0096] This embodiment adjusts the log read / write paths for different environments (such as production and load testing environments) by configuring the log collection management module and modifying the application's Lombak configuration file. For example, in a load testing environment, generated logs are written to a temporary directory instead of the default log path to avoid being captured by log collection tools. Furthermore, the log collection management module also provides the function of automatically deleting load testing environment logs after load testing is completed, ensuring that log collection in the production environment is not affected.
[0097] (2) Environment switching module.
[0098] The microservices use the Spring Boot framework, and the corresponding database connection configurations, as well as some dynamically adjustable configurations for business needs, are managed through Nacos. When the application starts, it first pulls the latest configuration from Nacos. Typically, if we want the application to connect to a shadow repository, we need to modify the database connection configuration in the Nacos configuration center, and then restart the application. This series of operations is not only cumbersome but also prone to errors that could impact the production environment.
[0099] This embodiment utilizes the Spring.profiles.active feature to configure all the JVM parameters required for pre-setting the environment switching module and calls the Alibaba Cloud API to perform the switching. By pre-setting the configuration parameters required for the load testing environment, frequent modifications to the original production configuration are avoided during the load testing process, ensuring a safe switching process without affecting the production environment.
[0100] (3) Stress test management and analysis module.
[0101] This embodiment provides a one-click load testing management interface by setting up a load testing management and analysis module. It supports submitting load testing tasks to be executed and automatically triggers rapid switching of shadow environments and related operations (such as rate limiting adjustments and application restarts). The module handles log recording, result storage, and problem analysis during the load testing process. For example, it records the start and end times of the load test, the change curves of test metrics, and abnormal log information. It automatically analyzes performance bottlenecks encountered during load testing using a large model interface and generates detailed reports to help technical personnel quickly locate the root cause of problems. These performance bottlenecks include issues such as low TPS (Transactions Per Second).
[0102] (4) Automated process module.
[0103] This embodiment achieves automated application restart and rate limiting operations by setting up an automated process module, reducing the time cost of manual intervention and ensuring that the stress testing process is efficient and error-free.
[0104] In this embodiment, load testing management is performed through a load testing management and analysis module. Load testing management mainly includes two aspects: load testing task management and load testing application management. Load testing task management refers to creating tasks for each load testing session. Since the interface and corresponding application differ for each test, the appropriate application service can be selected when creating a task. Load testing application management refers to managing the applications used for load testing, making it convenient to select the appropriate application when creating a load testing task. For example... Figure 6 As shown, the specific implementation steps of the stress testing method based on Alibaba Cloud's rapid switching of shadow environments are as follows.
[0105] S1: Load testing application configuration.
[0106] When configuring the load testing application, first configure the microservice to be tested and the IP address of the default application. The specific configuration items are application name, Alibaba Cloud application APP ID, and default application IP address. Configuring the Alibaba Cloud APP ID is a required parameter for calling Alibaba Cloud interfaces, and configuring the default application IP address is to facilitate the generation of flame graphs.
[0107] S2: Create a load testing task.
[0108] After configuring the load testing application in step S1, you can create a load testing task. First, fill in the load testing topic, select the application to be tested (based on the load testing application created in step S1), describe the purpose of the load testing and the corresponding interface URL, check whether to limit the rate, and provide the option to limit the rate to meet the system's capacity under both rate-limited and no-rate-limited states.
[0109] S3: Submit the load testing task.
[0110] After creating the load testing task in step S2, the user submits the required load testing task and related configuration parameters (such as database, Redis, etc.) through the system interface.
[0111] S4: Quickly switch shadow environments.
[0112] A load testing task will be generated in the load testing task management list. Click the corresponding "Start Load Testing" button, and the system will automatically call the API provided by Alibaba Cloud, complete the JVM parameter switching according to the preset configuration, and call the application restart interface. After the application restarts, the load testing environment will be fully effective, and relevant load testing personnel can use scripts to perform load testing on the production environment.
[0113] S5: Rate limiting operation.
[0114] During load testing, the system can be rate-limited using the "Turn Rate Limiting On / Off" button, achieving load testing effects in both rate-limited and un-rate-limited states. The rate-limiting function is encapsulated as an independent interface, which the load testing management system calls to enable or disable rate limiting.
[0115] S6: End stress test.
[0116] After the load test is completed, by clicking the "End Load Test" button on the interface, the system will also call the Alibaba Cloud interface to switch the environment configuration, thereby restoring the previous production environment.
[0117] S7: Generate a flame graph.
[0118] If application performance issues arise during load testing and the specific cause of the performance degradation at the load testing interface cannot be identified, you can click the "Generate Flame Graph" button on the interface to generate a flame graph. Clicking the "View Flame Graph" button will show the current CPU status of the server at that time, allowing for further analysis of the reasons for the slow interface.
[0119] S8: Upload the load test results.
[0120] After the load test is completed, the relevant load test personnel summarize the load test indicators and generate an Excel report. The report is uploaded by clicking the "Upload Load Test Report" button on the interface, and the report describes the problems that occurred during the entire load test process.
[0121] S9: Results Analysis and Report Generation.
[0122] After the load test is completed, the system obtains the performance indicators of the application server at that time by calling the Alibaba Cloud interface. Combined with the uploaded load test results, the system will automatically generate a load test report, including changes in key indicators and abnormal log records during the test. By calling the large model interface through these indicator parameters, the large model can analyze the data and generate an analysis report to help technical personnel quickly locate the cause of the problem.
[0123] Through the above steps S1 to S9, the effect of quickly switching the load testing environment based on Alibaba Cloud is finally achieved.
[0124] This embodiment reduces manual operation time and significantly lowers the time cost of stress testing by automating configuration switching and log management, thereby improving stress testing efficiency. Furthermore, this embodiment uses pre-configured settings and access restrictions to reduce the risks of stress testing operations, ensuring that stress testing will not affect or interfere with the production environment. This embodiment also utilizes detailed stress testing log records and data analysis functions to quickly locate the root cause of problems and generate complete reports as audit evidence, enhancing the system's traceability.
[0125] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0126] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0127] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0128] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A stress testing system based on Alibaba Cloud for rapid switching of shadow environments, characterized in that, The stress testing system based on Alibaba Cloud's rapid switching of shadow environments includes: a log collection and management module, an environment switching module, a stress testing management and analysis module, and an automated process module; The log collection and management module is used to modify the application framework's log configuration file to direct the load test logs to a temporary path independent of the production environment, and to automatically delete the load test logs after the load test is completed. The environment switching module is used to call Alibaba Cloud API to achieve one-click switching between the production environment and the shadow environment by pre-setting the JVM parameters required for load testing, and to trigger application restart; The load testing management and analysis module provides a task management interface for submitting load testing tasks, records load testing metrics and exception logs in real time, and calls the large model interface to analyze problems that occur during the load testing process and generate analysis reports. The automated process module is used to encapsulate the current limiting switch interface, control the start and stop of the current limiting state, and automatically execute the environment switching and restart process.
2. The stress testing system based on Alibaba Cloud's rapid switching of shadow environments as described in claim 1, characterized in that, The log collection and management module specifically includes: The log path adjustment unit is used to dynamically adjust the log path based on the Lombak configuration, so that the load test logs are written to a temporary directory to isolate the production log collection channel. The log cleanup unit is used to automatically clean up log files in the temporary directory after the load test is completed.
3. The stress testing system based on Alibaba Cloud's rapid switching of shadow environments as described in claim 1, characterized in that, The environment switching module specifically includes: The JVM parameter loading unit is used to load pre-defined JVM parameters using Spring.profiles.active; The Alibaba Cloud API unit is used to call the Alibaba Cloud API based on the JVM parameters to batch modify the database connection parameters of the Nacos configuration center to the shadow library and trigger the application restart.
4. The stress testing system based on Alibaba Cloud's rapid switching of shadow environments as described in claim 1, characterized in that, The stress test management and analysis module specifically includes: The load testing task management unit is used to generate a task management interface for submitting load testing tasks; Metrics and log recording unit, used to record load test metrics and anomaly logs in real time; The problem analysis and report generation unit is used to analyze the problems that occur during the load testing process and generate an analysis report by calling the large model interface based on the load testing indicators and anomaly logs.
5. The stress testing system based on Alibaba Cloud's rapid switching of shadow environments according to claim 4, characterized in that, The stress test management and analysis module also includes: The flame graph generation unit is used to collect the CPU running status of the application server and generate a flame graph to locate application performance problems. The load test report integration unit is used to receive load test results uploaded by users, call Alibaba Cloud interfaces to obtain the performance indicators of the current application server, and generate a comprehensive load test report based on the performance indicators of the current application server and the load test results.
6. The stress testing system based on Alibaba Cloud's rapid switching of shadow environments as described in claim 1, characterized in that, The automated process module specifically includes: A current limiting switch unit is used to encapsulate a current limiting switch interface and control the start and stop of the current limiting state. The environment switching and restart unit is used to automate the environment switching and restart process.
7. A stress testing method based on Alibaba Cloud for quickly switching shadow environments, characterized in that, The stress testing method based on Alibaba Cloud's fast shadow environment switching is applied to the stress testing system based on Alibaba Cloud's fast shadow environment switching as described in any one of claims 1-6, and the stress testing method based on Alibaba Cloud's fast shadow environment switching includes: Enter the IP addresses of the microservices to be stress tested and the default application; create a stress test task; After submitting the load test task, call the Alibaba Cloud API to switch JVM parameters and restart the application to enter the shadow environment; When performing the load test task, the current limiting status is dynamically controlled via interface buttons; After the load test is completed, clicking the "End" button will trigger the system to switch back to the production environment. After uploading the load test results, the system automatically associates performance metrics and calls the large model to generate a comprehensive load test report.
8. The stress testing method based on Alibaba Cloud's rapid switching of shadow environments according to claim 7, characterized in that, After submitting the load testing task, call the Alibaba Cloud API to switch JVM parameters and restart the application, entering the shadow environment, specifically including: Load pre-defined JVM parameters using Spring.profiles.active; Based on the JVM parameters, call the Alibaba Cloud API to batch modify the database connection parameters of the Nacos configuration center to the shadow database; Call the application restart API to switch environments and enter the shadow environment.
9. The stress testing method based on Alibaba Cloud's rapid switching of shadow environments according to claim 7, characterized in that, After the stress test task is completed, and after clicking the "End" button to trigger the system to switch back to the production environment, and before uploading the stress test results and the system automatically associates performance indicators and calls the large model to generate an analysis report, the stress test method based on Alibaba Cloud for quickly switching shadow environments also includes: Click the flame graph button to generate a flame graph; Click the "View Flame Graph" button to see the real-time CPU status of the application server.
10. The stress testing method based on Alibaba Cloud's rapid switching of shadow environments according to claim 7, characterized in that, After uploading the load test results, the system automatically associates performance metrics and calls the large model to generate a comprehensive load test report, which includes: Upload the load test results and call the Alibaba Cloud API to obtain the performance metrics of the current application server; A comprehensive stress test report is generated based on the current application server's performance metrics and the stress test results.