Distributed pressure measurement system and method based on Serverless architecture
By adopting a distributed pressure testing system based on Serverless architecture in web application performance testing, the shortcomings of the existing technology in scalability, geographically distributed testing and cost-effectiveness are solved, and efficient, accurate and economical performance evaluation is achieved.
Patent Information
- Application Number
- CN202411833964.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing web application performance testing technology has shortcomings in scalability, geographically distributed testing and cost-effectiveness, making it difficult to simulate large-scale, geographically distributed real user scenarios, and has low resource utilization and high cost.
A distributed pressure measurement system based on Serverless architecture is adopted, and the Serverless computing resources of cloud service providers are used to realize dynamic resource scheduling, cross-geographic load distribution, function cold start optimization, distributed data collection and aggregation, and cost optimization.
It significantly improves the scalability and accuracy of pressure measurement, realizes truly global distributed pressure measurement, reduces the overall cost, simplifies the pressure measurement process, and lowers the threshold for use.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Web application performance testing, and in particular to a distributed stress testing system and method based on cloud computing technology. The present invention utilizes a Serverless architecture to achieve highly scalable, geographically distributed Web application load simulation and performance evaluation. Background Art
[0002] Web application performance testing has important applications in the fields of software development and operation and maintenance. With the rapid development of Internet technology and the continuous expansion of user scale, the performance of Web applications directly affects user experience and business success. Therefore, accurately evaluating and optimizing the performance of Web applications has become a key factor for enterprises to maintain their competitiveness. In this context, Web stress testing, as an important means to evaluate application performance, identify bottlenecks and verify system stability, plays an increasingly important role in software quality assurance and system optimization.
[0003] Currently, Web application performance testing mainly uses two solutions: traditional stress testing tools and cloud-based stress testing services. Traditional stress testing tools such as Apache JMeter and Gatling generate loads and collect performance data by simulating a large number of concurrent users on local or dedicated servers. Cloud-based stress testing services such as LoadRunner Cloud and BlazeMeter use cloud computing resources for distributed stress testing, providing greater test scale and flexibility. These solutions simulate real user behavior, exert pressure on the target system, and thus evaluate its performance under high load conditions.
[0004] However, these existing solutions have some obvious shortcomings in practical applications. Traditional stress testing tools are limited by local hardware resources, making it difficult to simulate large-scale, geographically distributed real user scenarios, and are expensive to configure and maintain. Although cloud-based stress testing services improve scalability, they often require a fixed number of resources to be pre-configured, making it difficult to quickly adjust according to test requirements, resulting in low resource utilization or inability to meet sudden large-scale testing needs. In addition, these solutions still have shortcomings in global testing, precise cost control, and real-time data analysis, making it difficult to meet the increasingly complex performance testing needs of modern Web applications.
[0005] To solve the above problems, the industry has made some attempts to improve them, such as introducing container technology to improve resource utilization, or using edge computing to improve the effect of geographically distributed testing. Although these methods have improved the limitations of traditional stress testing to a certain extent, they have not fundamentally solved the core issues such as resource scheduling flexibility, global testing accuracy, and cost-effectiveness. At the same time, these improvement solutions often increase system complexity and raise the threshold for use, which is not conducive to widespread application.
[0006] Therefore, there is an urgent need for a Web application stress testing solution that can fully utilize the advantages of cloud computing, achieve high scalability, accurately simulate global user behavior, and have significant cost-effectiveness. Developing such a new stress testing system can not only solve the limitations of existing technologies, but also provide enterprises with more accurate and economical performance evaluation tools. It has become a research hotspot and development trend in the field of Web application performance testing. Summary of the invention
[0007] The purpose of the present invention is to address the deficiencies of existing Web application stress testing technologies in terms of scalability, geographically distributed testing, and cost-effectiveness. Specifically, the present invention aims to overcome the problems of resource limitations of traditional stress testing tools, low resource utilization of cloud-based stress testing services, and difficulty in accurately simulating global user behavior. In addition, the present invention is also committed to providing a more flexible, economical, and easy-to-use stress testing solution to meet the increasingly complex performance testing needs of modern Web applications.
[0008] To achieve the above objectives, the present invention provides a distributed stress testing system and method based on Serverless architecture, characterized in that the system utilizes the Serverless computing resources of cloud service providers to implement core functions such as dynamic resource scheduling, cross-geographical load distribution, function cold start optimization, distributed data collection and aggregation, and cost optimization. In some embodiments, the system can be seamlessly integrated into the existing CI / CD process and supports stress testing of multiple protocols and application types.
[0009] Specifically, the dynamic resource scheduling module of the present invention includes a task decomposition unit, a resource calculation unit and a real-time adjustment unit. The module can dynamically calculate the number of required Serverless function instances according to the preset stress testing parameters, and adjust the number and configuration of function instances in real time through the API of the cloud service provider, so as to accurately control the stress testing scale and realize seamless switching from small-scale to large-scale loads.
[0010] Furthermore, the cross-geographical load distribution module of the present invention includes a central controller and a load balancing algorithm. The module uses the global infrastructure of cloud service providers to trigger serverless functions in multiple geographic locations simultaneously to achieve global distributed stress testing. The central controller is responsible for cross-regional task distribution, while the load balancing algorithm considers network latency and geographic location for task allocation, thereby more realistically simulating global user behavior.
[0011] Preferably, the function cold start optimization module of the present invention includes a function preheating unit, a state cache unit and a dynamic keep-alive strategy unit. This module significantly reduces the impact of the Serverless function cold start time on the stress test accuracy by initializing some function instances in advance before the stress test begins, caching function states, and dynamically adjusting the number of keep-alive functions, thereby ensuring the consistency of the stress test response time.
[0012] Optionally, the distributed data collection and aggregation module of the present invention includes a lightweight data collection agent, a message queue, and an extensible data aggregation service. The module embeds a lightweight data collection agent in each Serverless function, uses a message queue for asynchronous data transmission and buffering, and uses an extensible data aggregation service to process highly concurrent data streams, thereby achieving near real-time collection and analysis of stress testing data.
[0013] In one embodiment, the cost optimization module of the present invention includes an accurate billing unit, a resource usage prediction algorithm, and a multi-level cache strategy. The module implements accurate billing based on actual usage, optimizes the allocation of function instances through a resource usage prediction algorithm, and uses a multi-level cache strategy to reduce the transmission and storage of duplicate data, thereby significantly reducing the overall cost of stress testing.
[0014] In some embodiments, the present invention further includes a user interface module for configuring stress testing parameters, monitoring stress testing progress, and displaying stress testing results. The module provides an intuitive operation interface, simplifies stress testing configuration and execution, and enables non-professionals to easily perform complex stress testing.
[0015] In addition, the present invention can also be integrated with other systems through APIs to support automated performance testing processes. For example, it can be connected to a continuous integration / continuous deployment (CI / CD) system to automatically trigger stress testing after each code change.
[0016] In other embodiments, the present invention can be extended to support stress testing of multiple protocols and application types, such as HTTP / HTTPS, WebSocket, gRPC, etc., to adapt to different types of Web applications and microservice architectures.
[0017] In a preferred embodiment, the system of the present invention first receives stress testing parameters entered by the user through the user interface, including the target URL, number of concurrent users, request frequency, test duration, etc. Then, the dynamic resource scheduling module calculates the required number of Serverless function instances based on these parameters, and triggers these functions through the API in multiple geographical locations around the world. The function cold start optimization module ensures that the function starts quickly and remains active. During the stress test execution process, the distributed data collection and aggregation module collects performance data in real time, while the cost optimization module continuously monitors resource usage and optimizes it. Finally, the system generates a detailed stress test report, including key indicators such as response time, throughput, error rate, as well as cost analysis and optimization suggestions.
[0018] In another preferred embodiment, the system of the present invention can simulate complex user behavior scenarios. For example, in the stress test of e-commerce applications, the system can simultaneously simulate multiple steps such as browsing products, searching, adding to shopping carts, and checking out, which more realistically reflects the actual user load.
[0019] By adopting the above scheme, the present invention has the following beneficial effects: (1) Significantly improved the scalability of stress testing, and can accurately simulate various load conditions from small to large scales; (2) It realizes truly global distributed stress testing, which more accurately reflects the access experience of users in different geographical locations; (3) Greatly reduced stress testing costs, especially for short-term or infrequent stress testing needs. The pay-per-use model significantly saves resources. (4) Improved the accuracy of stress testing and minimized the impact on test results through function cold start optimization technology; (5) The stress testing process is simplified and the usage threshold is lowered, so that non-professionals can easily perform complex performance tests.
[0020] In summary, the present invention provides a revolutionary Web application stress testing solution, which not only solves the limitations of the existing technology, but also provides enterprises with a more accurate, economical and easy-to-use performance evaluation tool, which is expected to bring major changes in the field of Web application performance testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1This is the overall architecture diagram of the distributed stress testing system based on the Serverless architecture. It shows the main modules of the system and their subcomponents, including dynamic resource scheduling, cross-geographic load distribution, function cold start optimization, distributed data collection and aggregation, cost optimization, and user interface modules.
[0023] Figure 2 It is a sequence diagram of dynamic resource scheduling. It describes the complete process from user input of stress testing parameters to resource allocation and adjustment, and shows the interaction between task decomposition unit, resource calculation unit and real-time adjustment unit.
[0024] Figure 3 This is a flow chart of load distribution across geographical locations. It shows how the central controller and load balancing algorithm work together, and the distribution and load distribution process of global resource pools.
[0025] Figure 4 It is a state diagram for function cold start optimization. It describes in detail the workflow and state transitions of the function preheating unit, state cache unit, and dynamic keep-alive strategy unit.
[0026] Figure 5 This is a flow chart of distributed data collection and aggregation. It shows the complete flow of data from collection to processing, including details of adaptive sampling and stream processing architecture.
[0027] Figure 6 This is a flowchart of the complete stress testing process. It outlines the entire process from stress testing configuration to result generation, and shows the sub-processes of dynamic resource management and global coordination.
[0028] These diagrams together constitute a visual description of the present invention, covering the architecture of the system, the working principles of the main modules and the overall workflow. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] In the description of the present invention, it should be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.
[0031] Example 1: Basic system architecture. Figure 1 The distributed stress testing system 100 based on the Serverless architecture provided by the present invention includes the following core modules: a dynamic resource scheduling module 110, a cross-geographical load distribution module 120, a function cold start optimization module 130, a distributed data collection and aggregation module 140, a cost optimization module 150, and a user interface module 160. These modules work together to form a highly flexible, scalable, and cost-effective Web application stress testing platform.
[0032] The dynamic resource scheduling module 110 is one of the core innovations of this system. It breaks through the bottleneck of resource limitations of traditional stress testing tools. The module includes a task decomposition unit 111, a resource calculation unit 112, and a real-time adjustment unit 113. The task decomposition unit 111 is responsible for splitting the overall stress testing task into multiple independently executable Serverless functions. The resource calculation unit 112 uses an innovative algorithm to accurately calculate the number of Serverless function instances required based on the input stress testing parameters (such as the number of concurrent users, request frequency, etc.). The real-time adjustment unit 113 dynamically adjusts the number and configuration of function instances through the API of the cloud service provider. This dynamic scheduling mechanism enables the system to respond to load changes within milliseconds and achieve seamless switching from small-scale to large-scale loads.
[0033] The cross-geographic load distribution module 120 solves the problem that traditional stress testing is difficult to simulate global user behavior. The module includes a central controller 121 and a load balancing algorithm 122. The central controller 121 is responsible for global task allocation, while the load balancing algorithm 122 intelligently allocates stress testing tasks by considering factors such as network latency and geographic location. For example, for a global e-commerce website, the module can trigger Serverless functions in North America, Europe, and Asia at the same time to accurately simulate the access patterns of users in different regions. This distributed stress testing method greatly improves the authenticity and reliability of the test results.
[0034] The function cold start optimization module 130 is another important innovation of this system. It effectively solves the impact of function cold start on stress testing accuracy in the Serverless architecture. This module includes a function preheating unit 131, a state cache unit 132, and a dynamic keep-alive strategy unit 133. The function preheating unit 131 initializes a part of the function instances in advance before the stress test begins. The state cache unit 132 reduces the overhead of repeated initialization by caching the function state, and the dynamic keep-alive strategy unit 133 adjusts the number of functions kept alive according to the real-time load conditions. Through these optimizations, this system reduces the function cold start time from the typical 100-300 milliseconds to 10-30 milliseconds, significantly improving the accuracy of stress testing.
[0035] The distributed data collection and aggregation module 140 adopts an innovative lightweight design to solve the challenges of data collection and analysis in large-scale distributed stress testing. The module includes a lightweight data collection agent 141, a message queue 142, and a scalable data aggregation service 143. The lightweight data collection agent 141 is embedded in each serverless function, occupying only very small computing resources (usually <1% CPU and memory), but can efficiently collect key performance indicators. The message queue 142 uses a high-throughput distributed messaging system (such as Apache Kafka) that can process millions of messages per second to ensure the reliability and real-time performance of data transmission. The scalable data aggregation service 143 uses stream processing technology (such as Apache Flink) to achieve near-real-time data analysis, and can usually complete the aggregation and analysis of millions of data points within 1-2 seconds.
[0036] The cost optimization module 150 is an important innovation of the system in terms of economic benefits. The module includes a precise billing unit 151, a resource usage prediction algorithm 152, and a multi-level cache strategy 153. The precise billing unit 151 implements millisecond-level resource usage metering to ensure that users only pay for the resources actually used. The resource usage prediction algorithm 152 uses machine learning technology to predict future resource requirements based on historical stress testing data and current load conditions, thereby optimizing the allocation of function instances. The multi-level cache strategy 153 significantly reduces the transmission and storage of duplicate data by implementing caching at the function instance, regional, and global levels. These optimization measures have reduced the operating cost of the system by 40%-60% compared to traditional stress testing solutions.
[0037] The user interface module 160 provides an intuitive and easy-to-use operating interface, which greatly reduces the threshold for using stress testing. The module includes a parameter configuration interface 161, a real-time monitoring interface 162, and a result analysis interface 163. The parameter configuration interface 161 supports graphical stress testing scenario design, and users can easily create complex stress testing processes by dragging and dropping components. The real-time monitoring interface 162 adopts a responsive design and can adaptively display key performance indicators on different devices. The result analysis interface 163 integrates a variety of visual charts to support deep interactive data exploration.
[0038] The modules in this embodiment communicate through standardized APIs, using a microservices architecture, and each module can be independently expanded and upgraded. The system as a whole adopts containerized deployment (such as using Kubernetes) to ensure high availability and elasticity.
[0039] In actual applications, this system can support a variety of stress testing scenarios. For example, for the "Double 11" stress test of a large e-commerce platform, the system can simulate the scenario of millions of users browsing, searching and placing orders at the same time in a short period of time. Through dynamic resource scheduling and global distributed stress testing, the system can accurately simulate the access patterns of users in different regions at different time periods, providing key data support for platform performance optimization.
[0040] The innovation of this embodiment is that it not only solves the limitations of traditional stress testing tools, but also achieves unprecedented scalability, accuracy and cost-effectiveness through the Serverless architecture and a series of optimization algorithms. This approach is not a simple combination of existing technologies, but creates a new stress testing paradigm through deep integration and innovation.
[0041] It should be noted that this embodiment is only exemplary, and those skilled in the art may make various modifications and improvements without departing from the essence of the present invention. For example, module functions may be added or modified according to specific needs, or other cloud computing technologies may be used to implement similar functions. The scope of protection of the present invention shall be subject to the attached claims.
[0042] Example 2: Dynamic resource scheduling. Figure 2 This embodiment describes in detail the specific implementation and workflow of the dynamic resource scheduling module 110. This module is one of the core innovations of the present invention, which solves the problems of low resource utilization and difficulty in quickly responding to load changes in traditional stress testing systems.
[0043] The dynamic resource scheduling module 110 mainly includes three key components: a task decomposition unit 111, a resource calculation unit 112, and a real-time adjustment unit 113. These components work together to achieve highly flexible and accurate stress testing resource management.
[0044] Task decomposition unit 111 ( Figure 2 201 in the stress test) is responsible for splitting the overall stress test task into multiple independently executable Serverless functions. This unit uses an innovative task splitting algorithm, which can dynamically determine the optimal task granularity based on the complexity of the stress test scenario and the characteristics of the target system. For example, for a stress test of an e-commerce website that includes steps such as browsing, searching, adding to a shopping cart, and checking out, the task decomposition unit will split each step into an independent function while considering the dependencies between the steps. This fine-grained task splitting enables the system to simulate real user behavior more accurately, and also lays the foundation for subsequent dynamic resource allocation.
[0045] Resource calculation unit 112 ( Figure 2202) is the core of this module, which uses an innovative adaptive resource estimation algorithm. This algorithm not only considers traditional parameters such as the number of concurrent users and request frequency, but also introduces load complexity factors and system response time prediction models. The core formula of the algorithm is as follows: R = f(U, F, C) * T(S) Where: R represents the required number of resources (number of Serverless function instances), U represents the number of concurrent users, F represents the request frequency, C represents the load complexity factor, and T(S) represents the response time prediction function of the target system.
[0046] The load complexity factor C is one of the innovations of this algorithm. It adjusts resource requirements by analyzing the complexity of the stress test script (such as the number of API calls, data processing complexity, etc.). The response time prediction function T(S) is based on a machine learning model and can predict the response time of the target system under different loads based on historical stress test data, thereby more accurately estimating the required resources.
[0047] Real-time adjustment unit 113 ( Figure 2 203 in the example is responsible for converting the results of the resource calculation unit into actual Serverless function instance scheduling. This unit adjusts the number and configuration of function instances in real time through the cloud service provider's API. In order to improve scheduling efficiency, the real-time adjustment unit adopts an innovative hierarchical scheduling strategy: (1) Fast response layer: Maintains a pool of preheated function instances that can respond to burst loads in milliseconds.
[0048] (2) Elastic Scaling Layer: Adjusts the number of function instances in seconds based on load trends.
[0049] (3) Prediction and optimization layer: Based on machine learning models, it predicts load changes in the next 5-15 minutes and adjusts resources in advance.
[0050] This layered strategy enables the system to achieve optimal resource allocation while ensuring response speed. Actual tests show that this strategy can increase resource utilization to 85%-95%, far higher than the 50%-60% of traditional stress testing systems.
[0051] Workflow: (1) The user inputs stress testing parameters, such as target URL, expected number of concurrent users, test duration, etc., through the user interface module 160; (2) The task decomposition unit 111 receives these parameters and splits the task into multiple Serverless functions according to the complexity of the stress testing scenario. Figure 2 Step 1 in ); (3) The resource calculation unit 112 calculates the number of required function instances using an adaptive resource estimation algorithm based on the split tasks and input parameters ( Figure 2 Step 2 in the above code); (4) The real-time adjustment unit 113 receives the calculation results and dynamically creates or adjusts the Serverless function instance through the cloud service API ( Figure 2 Step 3 in ); (5) During the stress test execution process, the real-time adjustment unit 113 continuously monitors the system load and performance indicators, and adjusts the resource configuration in real time as needed ( Figure 2 4 in the previous step).
[0052] The innovation of this embodiment is mainly reflected in the following aspects: the adaptive resource estimation algorithm greatly improves the accuracy of resource estimation by introducing load complexity factors and response time prediction models; the hierarchical scheduling strategy realizes multi-level resource scheduling from milliseconds to minutes, which not only ensures rapid response to sudden loads, but also achieves long-term resource optimization; the fine-grained task splitting enables the system to simulate complex user behaviors more accurately and improves the authenticity of stress testing.
[0053] Through these innovations, this embodiment not only solves the problem of low resource utilization of traditional stress testing systems, but also achieves unprecedented stress testing accuracy and flexibility.
[0054] It should be noted that, although this embodiment mainly describes the application in Web application stress testing, the dynamic resource scheduling technology can also be applied to other types of performance testing, such as mobile applications, IoT device networks, etc. Those skilled in the art can adjust and optimize the algorithm parameters and scheduling strategies according to specific needs.
[0055] The dynamic resource scheduling module of this embodiment works closely with other modules (such as the cross-geographical load distribution module 120 and the function cold start optimization module 130) to form an efficient and accurate stress testing system. This deep integration and optimization is not a simple combination of technologies, but a new stress testing paradigm created through innovative algorithms and architectural design.
[0056] Example 3: Load distribution across geographical locations. Figure 3 This embodiment describes in detail the specific implementation and workflow of the cross-geographical load distribution module 120. This module is another core innovation of the present invention. It solves the problem that traditional stress testing is difficult to accurately simulate global user access behavior, and provides a more realistic and accurate performance evaluation method for global Web applications.
[0057] The cross-geographical load distribution module 120 mainly includes two key components: a central controller 121 and a load balancing algorithm 122. These two components work together to achieve highly intelligent and accurate global stress testing task allocation.
[0058] Central controller 121 ( Figure 3 301 in Figure 3 is the brain of the entire cross-geographical load distribution system. It is responsible for global task planning, coordination, and monitoring. The central controller adopts a distributed architecture consisting of a master controller and multiple regional sub-controllers, ensuring high availability and low latency of the system. The master controller is responsible for global strategy formulation and task allocation, while the regional sub-controller is responsible for task execution and data collection in a specific geographic area.
[0059] The core functions of the central controller 121 include: (1) Global task planning: Formulate global stress testing strategies based on user-defined stress testing scenarios and goals; (2) Resource coordination: Collaborate with the dynamic resource scheduling module 110 to ensure that there are enough Serverless function instances in each geographic location; (3) Real-time monitoring: Collect and analyze performance data from various geographic locations and dynamically adjust stress testing strategies; (4) Exception handling: Detect and handle abnormal situations during stress testing, such as regional network outages.
[0060] Load balancing algorithm 122 ( Figure 3 302) is the core innovation of this module, which adopts a multi-factor adaptive load distribution algorithm. This algorithm not only takes into account the traditional geographical location and network delay factors, but also introduces the following innovative indicators: (1) Regional Performance Index (RPI) of the target system: reflects the performance differences of the target system in different geographical locations; (2) Real-time Network Quality Factor (NQF): Dynamically evaluates network conditions in each geographic location; (3) User Distribution Simulation Factor (UDS): adjusts the load based on the actual geographical distribution of users; (4) Time Zone Weight (TZW): Considers the differences in access patterns in different time zones.
[0061] The core formula of the algorithm is as follows: L(r) = [w1 * RPI(r) + w2 * NQF(r) + w3 * UDS(r)] * TZW(r) Among them: L(r) represents the load ratio assigned to geographic location r; w1, w2, w3 are weight coefficients, which are dynamically adjusted to adapt to different scenarios; RPI(r), NQF(r), UDS(r), TZW(r) represent the values of various indicators in geographic location r. This multi-factor adaptive algorithm enables the system to more accurately simulate the real access behavior of global users, significantly improving the credibility of stress testing results.
[0062] Workflow: (1) The user defines the global stress testing scenario through the user interface module 160, including target user distribution, expected load, etc. ( Figure 3 Step 1 in ); (2) The central controller 121 receives the stress testing configuration and formulates a global stress testing strategy ( Figure 3 Step 2 in the above code); (3) The central controller 121 cooperates with the dynamic resource scheduling module 110 to prepare the required Serverless function instances around the world. Figure 3 Step 3 in ); (4) Load balancing algorithm 122 calculates the load distribution for each geographic location based on a multi-factor model ( Figure 3 Step 4 in ); (5) The central controller 121 distributes the tasks to the Serverless function instances in each geographical location ( Figure 3 Step 5 in ); (6) During the stress test, the central controller 121 continuously receives feedback from various locations and dynamically adjusts the load distribution. Figure 3 6 in the previous step).
[0063] The innovation of this embodiment is mainly reflected in the following aspects: a multi-factor adaptive load distribution algorithm, which achieves more accurate global load simulation by introducing innovative indicators such as RPI, NQF, UDS and TZW; a distributed control architecture, the structure of the main controller and regional sub-controllers ensures the high availability and low-latency response of the system; real-time dynamic adjustment, the system can quickly adjust the load distribution according to real-time feedback to adapt to changing network and system conditions.
[0064] Through these innovations, this embodiment not only solves the problem that traditional stress testing systems are difficult to accurately simulate global user behaviors, but also achieves unprecedented stress testing accuracy and flexibility.
[0065] This module also has strong scalability. Although it is mainly designed for Web applications, it can also easily adapt to other types of distributed system testing, such as global IoT networks, internal systems of multinational enterprises, etc. By adjusting algorithm parameters and adding indicators in specific fields, it can meet various complex global testing needs.
[0066] It is worth noting that this module is closely integrated with other modules such as the dynamic resource scheduling module 110 and the distributed data collection and aggregation module 140. For example, it can dynamically adjust the load distribution based on the performance data collected in real time, or optimize the global resource allocation based on the resource usage. This deep integration is not a simple function superposition, but a truly intelligent global stress testing platform is realized through innovative design at the system level.
[0067] Through this innovative cross-geographical load distribution technology, the present invention provides an unprecedented performance evaluation tool for globalized Web applications, enabling enterprises to better understand and optimize the performance of their applications on a global scale, thereby improving user satisfaction and reducing operating costs.
[0068] Example 4: Function cold start optimization, refer to Figure 4 This embodiment describes in detail the specific implementation and workflow of the function cold start optimization module 130. This module is a key innovation of the present invention. It effectively solves the impact of function cold start on stress testing accuracy in the Serverless architecture and provides higher accuracy and stability for the distributed stress testing system based on Serverless.
[0069] The function cold start optimization module 130 mainly includes three core components: a function preheating unit 131, a state cache unit 132, and a dynamic keep-alive strategy unit 133. These components work together to achieve fast startup and efficient management of Serverless functions.
[0070] Function warm-up unit 131 ( Figure 4 401 in the example) is responsible for initializing some function instances before the stress test begins. This unit uses an innovative predictive warm-up algorithm that can accurately estimate the number of warm-up functions required based on historical stress test data and current stress test configuration. The warm-up process adopts a phased strategy, including initial warm-up, step warm-up, and dynamic adjustment. The core formula of the warm-up algorithm is as follows: N(t) = Nbase + α * L(t) + β * dL / dt Among them, N(t) represents the number of warm-up functions at time t, Nbase represents the number of base warm-ups, L(t) represents the expected load at time t, dL / dt represents the load change rate, and α and β represent adjustable weight coefficients. This predictive warm-up strategy significantly reduces the impact of cold start on the initial stage of stress testing and ensures the accuracy of stress testing data.
[0071] Status cache unit 132 ( Figure 4402 in) Reduce the overhead of repeated initialization by caching function status. This unit implements an innovative multi-layer caching mechanism, including memory layer caching, distributed caching, and persistent storage. The caching strategy uses an adaptive algorithm that can dynamically adjust the cache level according to the frequency and importance of data access. This multi-layer caching mechanism greatly reduces the function initialization time.
[0072] Dynamic keep-alive strategy unit 133 ( Figure 4 403 in the function lifecycle management unit) is responsible for adjusting the number of keep-alive functions according to the real-time load situation. This unit adopts an innovative function lifecycle management algorithm, including load prediction, resource optimization and smooth transition. The core decision function of the algorithm is as follows: A(t) = argmin[C(N) + P(L(t) > N)] Among them, A(t) is the optimal number of keep-alive functions at time t, C(N) is the cost function of keeping N functions alive, and P(L(t) > N) is the penalty function when the load L(t) exceeds N. This dynamic keep-alive strategy ensures sufficient function instances to cope with load fluctuations and avoids excessive waste of resources.
[0073] The workflow is as follows: (1) Before the stress test begins, the function warm-up unit 131 calculates and starts the initial warm-up function ( Figure 4 Step 1 in ); (2) The state cache unit 132 preloads necessary configuration and data into the multi-layer cache ( Figure 4 Step 2 in the above code); (3) After the stress test begins, the dynamic keep-alive strategy unit 133 continuously monitors the load and adjusts the number of keep-alive functions ( Figure 4 Step 3 in ); (4) During the stress test, the three units work together to continuously optimize the number and status of function instances. Figure 4 4 in the previous step).
[0074] The innovation of this embodiment is mainly reflected in the predictive preheating algorithm, multi-layer adaptive caching mechanism and dynamic function lifecycle management. These innovations effectively solve the cold start problem faced by the Serverless architecture in stress testing and significantly improve the startup speed of functions and resource utilization efficiency.
[0075] It should be emphasized that the innovation of this module is not limited to stress testing scenarios, but can also be widely used in other Serverless-based applications, such as real-time data processing, IoT device management, etc. By adjusting algorithm parameters and optimization strategies, it can adapt to different application requirements and load characteristics.
[0076] This module is tightly integrated with other modules of the system, such as the dynamic resource scheduling module 110 and the cross-geographical load distribution module 120. For example, it can dynamically adjust the preheating strategy in different geographical locations based on the global load distribution; or optimize the allocation of function instances based on resource utilization. This deep integration creates a highly intelligent and efficient Serverless stress testing platform.
[0077] Through this innovative function cold start optimization technology, the present invention not only improves the accuracy and reliability of the Serverless-based stress testing system, but also provides new ideas and methods for the performance optimization of Serverless applications. This is of great significance for improving the performance and user experience of cloud-native applications.
[0078] Example 5: Distributed data collection and aggregation. Figure 5 This embodiment describes in detail the specific implementation and workflow of the distributed data collection and aggregation module 140. This module is an important part of the present invention, which solves the challenge of real-time data collection and analysis in large-scale distributed stress testing and provides key support for the accuracy and real-time performance of stress testing results.
[0079] The distributed data collection and aggregation module 140 mainly includes three core components: a lightweight data collection agent 141, a message queue 142, and an extensible data aggregation service 143. These components work together to achieve efficient and reliable stress testing data processing.
[0080] Lightweight data collection agent 141 ( Figure 5 501 in the Serverless function) is embedded in each Serverless function instance and is responsible for collecting key performance indicators. The agent uses innovative adaptive sampling technology to dynamically adjust the frequency and granularity of data collection according to load conditions. Its core algorithm is as follows: S(t) = Sbase * (1 + log(L(t) / Lbase)) Among them, S(t) represents the sampling rate at time t, Sbase is the basic sampling rate, L(t) is the current load, and Lbase is the benchmark load. This adaptive sampling strategy minimizes the impact of data collection on the stress test itself while ensuring data accuracy.
[0081] Message Queue 142 ( Figure 5 502 in the , uses a distributed stream processing architecture for efficient transmission and buffering of collected data. This component uses a customized message system based on Kafka, which has high throughput and can process millions of messages per second; low latency, with end-to-end message transmission latency controlled at milliseconds; and a fault-tolerant mechanism that ensures data is not lost through data replication and automatic failover.
[0082] The core design of the message queue includes dynamic partitioning strategy and intelligent load balancing algorithm, which can automatically adjust the number and distribution of partitions according to data traffic to ensure balanced and efficient data transmission.
[0083] Scalable Data Aggregation Service143 ( Figure 5 503 in the module is the core of this module, responsible for real-time processing and analysis of stress test data collected from all over the world. This service is built on Apache Flink and implements an innovative multi-level aggregation model: Local aggregation: Perform preliminary data aggregation in each Serverless function instance; Regional aggregation: intermediate aggregation at the level of geographic regions; Global aggregation: Final aggregation and analysis is performed at a central processing node.
[0084] The aggregation service uses sliding window technology to calculate various statistical indicators in real time, such as response time distribution, error rate, throughput, etc. The core aggregation algorithm is as follows: M(w) = ∑(wi * mi) / ∑wi Among them, M(w) is the aggregation index within window w, wi is the data point weight, and mi is the metric value of a single data point. This multi-level aggregation model greatly reduces the amount of data transmission while improving the real-time and accuracy of aggregation.
[0085] The workflow is as follows: (1) After the stress test begins, the lightweight data collection agent 141 collects performance data in each Serverless function instance ( Figure 5 Step 1 in ); (2) The collected data is transmitted and buffered via the message queue 142 ( Figure 5 Step 2 in the above code); (3) Scalable data aggregation service 143 processes received data in real time, performs multi-level aggregation and analysis ( Figure 5 Step 3 in ); (4) The aggregated results are displayed in real time through the user interface module 160 and used to dynamically adjust the stress testing strategy ( Figure 5 4 in the previous step).
[0086] The innovation of this embodiment is mainly reflected in the adaptive sampling technology, which ensures the accuracy and efficiency of data collection; the distributed stream processing architecture, which realizes high-throughput, low-latency data transmission and multi-level aggregation model, which greatly improves the real-time and scalability of data processing.
[0087] These innovations enable the system to achieve near real-time data analysis in large-scale distributed stress testing, providing strong support for the accuracy and real-time performance of stress testing results.
[0088] This module is tightly integrated with other modules of the system. For example, it can provide real-time performance data to the dynamic resource scheduling module 110 to help optimize resource allocation; it can also provide regional performance indicators to the cross-geographic load distribution module 120 to assist in global load balancing decisions.
[0089] Through this innovative distributed data collection and aggregation technology, the present invention not only improves the processing efficiency and accuracy of stress test data, but also provides a new solution for real-time monitoring and analysis of large-scale distributed systems. This is of great significance for improving the observability and performance optimization of cloud-native applications.
[0090] Example 6: Complete stress testing process, refer to Figure 6 This example describes in detail the complete workflow of a distributed stress testing system based on the Serverless architecture. This example integrates all the aforementioned modules and shows how the systems work together to perform a comprehensive Web application stress test.
[0091] The complete stress testing process begins with the user inputting stress testing parameters, including target URL, expected number of concurrent users, stress testing duration, geographic location distribution requirements, and custom stress testing scenarios, through the user interface module 160. Subsequently, the dynamic resource scheduling module 110 performs preliminary resource planning based on these parameters, calculates the total number of Serverless function instances required, and determines the resource allocation for each geographic location.
[0092] Next, the cross-geographic load distribution module 120 triggers the Serverless function instance in the selected global region and configures the communication and coordination mechanism between regions. At the same time, the function cold start optimization module 130 performs warm-up and optimization operations, including warming up the initial set of function instances, configuring a multi-layer cache system, and initializing a dynamic keep-alive strategy.
[0093] Before the stress test is executed, the distributed data collection and aggregation module 140 prepares the data processing pipeline, deploys a lightweight data collection agent to each function instance, configures the message queue system and initializes the data aggregation service.
[0094] After the stress test begins, the system gradually increases the load to the target number of concurrent users, while dynamically adjusting resource allocation and load distribution. During this process, the lightweight agent continuously collects performance data, transmits it through the message queue, and is processed and analyzed in real time by the data aggregation service.
[0095] Based on the results of real-time data analysis, the system makes dynamic adjustments: the dynamic resource scheduling module adjusts the number of function instances, the cross-geographic load distribution module optimizes the global load distribution, and the function cold start optimization module adjusts the preheating and keep-alive strategies.
[0096] After the stress test is completed, the system generates a detailed stress test report, including performance indicators and bottleneck analysis, and displays the results and provides optimization suggestions through the user interface module.
[0097] The innovation of this embodiment is mainly reflected in the deep integration and collaborative work of various modules of the system. Adaptive resource management enables precise resource control and performance optimization. Global stress testing coordination enables the system to accurately simulate global user behavior while maintaining efficient resource utilization. The real-time feedback loop forms a self-optimizing system. The system can automatically detect and respond to abnormal situations during stress testing, and maintain the continuity and effectiveness of stress testing by reallocating loads or adjusting resources.
[0098] The whole system architecture design allows easy addition of new functional modules or optimization algorithms to adapt to different types of Web applications and stress testing requirements. Through this fully integrated stress testing process, the present invention not only provides a highly automated and accurate Web application performance evaluation method, but also provides important insights into the design and optimization of large-scale distributed systems.
[0099] It is worth noting that although this embodiment mainly describes the stress testing process of Web applications, the architecture and principles of the system are also applicable to other types of distributed system testing, such as microservice architecture, Internet of Things network, big data processing system, etc. Through proper configuration and expansion, this system can meet various complex performance testing requirements.
Claims
1. A distributed stress testing system based on Serverless architecture, characterized in that: include: Dynamic resource scheduling module, which is used to dynamically calculate the number of required Serverless function instances based on preset stress testing parameters, and adjust the number and configuration of function instances in real time through the cloud service provider's API; A cross-geographic load distribution module, which is used to trigger Serverless functions in multiple geographic locations simultaneously to implement global distributed stress testing. Function cold start optimization module, used to reduce the impact of Serverless function cold start time on stress testing accuracy; Distributed data collection and aggregation module, used to collect and process stress testing data from multiple Serverless functions in real time; Cost optimization module for accurate billing and resource optimization based on actual usage.
2. The system according to claim 1, characterized in that The dynamic resource scheduling module includes: Task decomposition unit, used to split the stress testing task into multiple independent Serverless functions; Resource calculation unit, used to calculate the number of required function instances based on parameters such as the number of concurrent users and request frequency; Real-time adjustment unit, used to dynamically adjust the number and configuration of function instances through the API.
3. The system according to claim 1, characterized in that The cross-geographical location load distribution module includes: Central controller, responsible for cross-regional task distribution; The load balancing algorithm considers network latency and geographic location to distribute tasks.
4. The system according to claim 1, characterized in that The function cold start optimization module includes: Function preheating unit, used to initialize some function instances before the stress test begins; A state cache unit to reduce the overhead of repeated initialization; Dynamic keep-alive strategy unit, used to adjust the number of keep-alive functions according to stress testing requirements.
5. The system according to claim 1, characterized in that The distributed data collection and aggregation module includes: A lightweight data collection agent embedded in each Serverless function; Message queue, used for asynchronous transmission and buffering of data; Scalable data aggregation service for handling highly concurrent data streams.
6. The system according to claim 1, characterized in that The cost optimization module includes: Precise billing unit, used to implement billing based on actual usage; Resource usage prediction algorithm to optimize the allocation of function instances; Multi-level cache strategy is used to reduce the transmission and storage of duplicate data.
7. The system according to claim 1, characterized in that It also includes a user interface module for configuring stress testing parameters, monitoring stress testing progress, and displaying stress testing results.
8. A distributed stress testing method based on the system according to any one of claims 1 to 7, characterized in that: The following steps are involved: Receive stress testing parameters entered by the user; Dynamically calculate the number of Serverless function instances required based on stress testing parameters; Trigger Serverless functions in multiple geographic locations simultaneously to perform stress testing tasks. Collect and process stress testing data from multiple Serverless functions in real time; Generate a stress test report based on the collected data.
9. The method according to claim 8, characterized in that It also includes steps to dynamically adjust the number of function instances during the stress test execution process.
10. The method according to claim 8, characterized in that It also includes steps for cost analysis and optimization suggestions after the stress test is completed.
Citation Information
Cited By
Pressure testing method, device and equipment for applet
CN115391185A