A distributed performance testing method and system based on dynamic load prediction
By using dynamic load prediction and bidirectional tracking probe technology, the problems of unreasonable resource scheduling and inaccurate data association in traditional distributed performance testing are solved, realizing intelligent and refined performance testing, and improving testing efficiency and result interpretability.
Patent Information
- Application Number
- CN202510941908.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-07-09
AI Technical Summary
Traditional distributed performance testing systems cannot dynamically schedule resources based on real-time system load, resulting in low resource utilization, low testing efficiency, and difficulty in deeply exploring the intrinsic relationship between traffic and resource data, making it impossible to quickly locate performance bottlenecks.
A distributed performance testing method based on dynamic load prediction is adopted. By prioritizing the migration strategy from node resource utilization, combined with bidirectional tracking probes and density clustering algorithms, traffic data and resource data are aligned at the second level and abnormal feature clustering is achieved, and performance indicators and abnormal patterns are displayed in real time.
It improves the response speed and resource scheduling efficiency of performance testing, automatically identifies performance bottlenecks, reduces manual troubleshooting costs, and enhances the interpretability and decision support capabilities of test results.
Smart Images

Figure CN120429217B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer system performance testing technology, and relates to a distributed performance testing method and system based on dynamic load prediction. Background Technology
[0002] With the rapid development of internet technology, distributed systems have been widely used in various fields. To ensure that distributed systems can run stably and efficiently in complex scenarios such as high concurrency and large data volumes, performance testing has become a crucial step.
[0003] Traditional distributed performance testing systems mainly consist of a master node, a cluster of slave nodes, the system under test (SUT), and a monitoring module. The master node distributes stress-bearing tasks to the SUT from the slave nodes using a fixed strategy (such as round-robin or preset weights), without being aware of the nodes' real-time load. The slave node cluster sends stress requests (such as HTTP / TCP requests) to the SUT according to fixed allocation rules. The monitoring module independently collects traffic data (such as QPS and response time) from the slave nodes and resource data (such as CPU and memory utilization) from the SUT.
[0004] Traditional distributed performance testing tools often rely on static configurations or empirical values for resource scheduling, failing to dynamically adjust based on real-time system load. This results in low resource utilization and inefficient testing. For example, when faced with a sudden increase in test tasks, static resource allocation schemes may not respond promptly, causing some test tasks to wait for resources for extended periods, severely impacting test progress.
[0005] In terms of data correlation analysis, traditional distributed performance testing tools typically only display the stress traffic data or the resource data of the service under test independently, making it difficult to delve into the intrinsic relationship between the two and providing a comprehensive and accurate basis for locating performance bottlenecks. When system performance issues occur, developers struggle to quickly determine whether the performance degradation is due to excessive traffic exhausting resources or improper resource configuration. Regarding anomaly diagnosis, most tools lack intelligent diagnostic capabilities, requiring significant manual time and effort to analyze massive amounts of data to pinpoint the root cause of performance problems. This is extremely inefficient in practical applications and prone to oversights.
[0006] Therefore, how to provide a distributed performance testing method and system that can realize intelligent resource scheduling and deep data correlation analysis is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0007] In view of this, the present invention proposes a distributed performance testing method and system based on dynamic load prediction. Based on the priority migration strategy of slave node resource utilization, it greatly improves the response speed of distributed performance testing and the efficiency of slave node resource scheduling. To address the problem of traffic and resources not being correlated, bidirectional tracking probes are used to align traffic data and resource data at the second level for each business request, providing underlying data support for upstream evaluation and analysis.
[0008] To achieve the above objectives, the present invention adopts the following technical solution:
[0009] This invention discloses a distributed performance testing method based on dynamic load prediction. The method involves deploying a master node to assign stress-applying tasks to slave nodes. These stress-applying tasks are business tasks that apply pressure to the system under test. The slave nodes then send stress requests to the test interface of the system under test according to the assigned stress-applying tasks to simulate user behavior or business load. The method includes the following steps:
[0010] S1: Periodically collect the resource utilization data of the current slave node as the data at the current time point, and use the data at the current time point to predict the resource utilization data at the next time point;
[0011] S2: Determine whether the resource utilization data at the next time point is abnormal based on the dynamic threshold verification algorithm. If so, start the process migration mechanism for the process on the current slave node based on the priority migration strategy.
[0012] S3: Deploy bidirectional tracking probes on the slave node and the system under test, and use a unique business task ID to associate the pressure request traffic data of the slave node with the resource data of the system under test;
[0013] S4: Use density clustering algorithm to analyze and cluster the associated pressure request traffic and resource data, obtain abnormal feature clustering results, and identify abnormal problem patterns based on the clustering results;
[0014] S5: Real-time display of the relationship between the pressure request traffic, resource indicators, and abnormal problem patterns of each test interface, forming a full-link diagnostic view of pressure input and system response.
[0015] Preferably, the method of using the sliding window exponential smoothing to predict resource utilization data for the next time point using the current time point data includes:
[0016] F t = α Y t-1 +(1−α)F t−1
[0017] In the formula, F t Y represents the predicted value of resource utilization data for period t. t-1Let be the actual value of resource utilization data for period t-1, and α∈(0~1) be the smoothing coefficient.
[0018] Preferably, the step of determining whether the resource utilization data at the next time point is abnormal based on the dynamic threshold verification algorithm includes:
[0019] Historical resource data from each slave node is continuously collected through a sliding window.
[0020] The N% quantile value is independently calculated for the resource utilization data of each slave node and used as the dynamic threshold for that node, where N>50;
[0021] If the predicted resource utilization data for the next time point is greater than the N% quantile, then the priority migration strategy is triggered.
[0022] Preferably, the steps for initiating a process migration mechanism on the current slave node based on a priority migration strategy include:
[0023] Capture the current process status information on the slave node;
[0024] The processes on the slave nodes are sorted according to the priority of the process status information, and the migration order of the processes is determined according to the priority.
[0025] The current process state data is incrementally serialized, and the process is migrated to an idle slave node in batches. The incrementally serialized data packets are then transmitted to a remote server using a zero-copy method. The data packets received by the remote server are used to restore the process state of the slave node.
[0026] After confirming that the remote server has successfully restored the process state, start releasing local resources from the node.
[0027] Preferably, for HTTP request business tasks, the pressure request traffic data of the slave node includes one or more of the following: query per second (QPS) and response time; the resource data of the tested system associated with the pressure request traffic data includes one or more of the following: CPU inter-core load, JVM young generation GC frequency, and memory fragmentation rate.
[0028] Preferably, the density clustering algorithm includes the DBSCAN density clustering algorithm, used to perform the following steps:
[0029] For each stress request, the stress request traffic data of its associated slave node and the resource data of the system under test are input into the DBSCAN algorithm as multi-dimensional data.
[0030] Clustering is performed based on the density relationship between the multidimensional data inputs to identify data groups with similar behavioral patterns as dense regions, and data points that do not conform to any dense region are marked as anomalous data features.
[0031] Provide a problem description based on the characteristics of the abnormal data;
[0032] The abnormal data features and corresponding problem descriptions are aggregated into JSON, stored in memory as a hash table, and allowed for random access with O(1) time complexity.
[0033] Preferably, the resource metrics are described by adding performance metric values based on a weighted aggregation model with an attention mechanism:
[0034] S agg =∑α i S i
[0035] In the formula, S agg S represents the performance metric value after aggregation. i For each original performance index value, the weighting coefficient α i Adjusted dynamically based on the current testing phase.
[0036] Preferably, the method further includes a step of normalizing the heterogeneous data obtained from the nodes and the heterogeneous data of the system under test:
[0037] For sampling data of different frequencies, a dynamic time warping algorithm is used to align the pressure request traffic data of the slave node with the resource data of the system under test in terms of time.
[0038] Preferably, a dynamic heatmap is used to display the relationship between the pressure request traffic, resource indicators, and abnormal problem modes of each test interface in real time, and to receive and respond to query commands on the relationship between the pressure request traffic, resource indicators, and abnormal problem modes of the test interfaces under a specified time period and a specified business task.
[0039] This invention also provides a distributed performance testing system based on a distributed performance testing method using dynamic load prediction, comprising: a master node, multiple slave nodes, and a system under test; the master node is used to allocate stress testing tasks to the slave nodes, wherein the stress testing tasks are stress testing tasks simulating user behavior or business load; each slave node is used to send stress requests to the test interface of the system under test according to the allocated stress testing tasks to simulate user behavior or business load; and further comprises:
[0040] The resource monitoring module is used to periodically collect the resource utilization data of the current slave node as the data at the current time point, and transmit the data to the load prediction module;
[0041] The load prediction module predicts resource utilization data for the next time point based on the data at the current time point;
[0042] The process migration control module uses a dynamic threshold verification algorithm to determine whether the resource utilization data at the next time point is abnormal. If it is abnormal, it triggers a priority migration strategy and starts the migration of processes on the current slave node.
[0043] The data association module is used to deploy bidirectional embedded probes between slave nodes and the system under test, and associate the pressure request traffic data of slave nodes with the resource data of the system under test through a unique business task ID;
[0044] The anomaly clustering analysis module is used to analyze the associated pressure request traffic and resource data using density clustering algorithm, output the clustering results of abnormal features, and identify the corresponding abnormal problem patterns.
[0045] The visualization diagnostic module is used to display the relationship between the stress request traffic, resource indicators, and abnormal problem patterns of each test interface in real time, and generate a full-link diagnostic view of stress input and system response.
[0046] As can be seen from the above technical solutions, compared with existing technologies, by introducing modules such as load prediction, resource monitoring, process migration control, data correlation analysis, anomaly clustering, and visual diagnostics, the intelligence level and testing efficiency of performance testing are significantly improved, achieving the following technical effects:
[0047] This invention achieves real-time response to changes in test load by periodically collecting node resource utilization data and predicting resource usage at the next time point, combined with a dynamic threshold verification algorithm to determine whether the resource status is abnormal. When a resource bottleneck is predicted to occur on a certain node, a process migration mechanism is promptly initiated, effectively avoiding test interruptions or result distortion caused by local resource overload, improving the adaptability of the performance testing system, and ensuring the stability and robustness of the entire performance testing system.
[0048] This invention deploys bidirectional embedded probes between slave nodes and the system under test, and accurately associates stress request traffic data with the resource indicators of the system under test through a unique business task ID. This solves the problem of difficulty in matching "stress test traffic" and "system response" in traditional performance testing, and provides a high-quality data foundation for subsequent in-depth analysis of system behavior.
[0049] This invention uses a density clustering algorithm to analyze the associated pressure request traffic and resource data, automatically identifying clusters of abnormal behaviors with similar characteristics. This can effectively discover potential problem patterns hidden in massive performance data, thereby assisting testers in quickly locating performance bottlenecks and reducing manual troubleshooting costs.
[0050] This invention uses a visualization diagnostic module to display the pressure request traffic, resource indicators, and identified abnormal problem patterns of each test interface in real time, forming a full-link diagnostic view of "pressure input - system response". This helps users to fully grasp the system's operating status from macro to micro, and improves the interpretability of test results and decision support capabilities.
[0051] In summary, by introducing key technologies such as dynamic load prediction, intelligent resource scheduling, deep data analysis, and visual diagnosis, this invention has achieved automation, intelligence, and refinement of the performance testing process, solving problems such as unreasonable resource scheduling, untimely anomaly detection, and inaccurate data correlation in existing technologies. It has significant technological progress and application value. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0053] Figure 1 A flowchart illustrating a distributed performance testing method based on dynamic load prediction provided in an embodiment of the present invention;
[0054] Figure 2 A flowchart of the priority migration strategy provided in an embodiment of the present invention;
[0055] Figure 3 A flowchart of the process migration mechanism for a slave node provided in an embodiment of the present invention;
[0056] Figure 4 The flowchart illustrates the density clustering algorithm analysis provided in this embodiment of the invention. Detailed Implementation
[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0058] The first aspect of this invention provides a distributed performance testing method based on dynamic load prediction, which first explains the collaborative relationship between the master node, the slave node cluster, and the system under test:
[0059] Master node: This refers to the core control node responsible for managing and allocating test tasks. It can be a standalone server or a high-performance computer. Its main responsibility is to distribute stress tasks to slave nodes using dynamic load forecasting and to monitor the status of the entire testing process. The master node needs to have strong computing and network communication capabilities to process and analyze data from each slave node in real time and make corresponding scheduling decisions.
[0060] Slave nodes: These are the worker nodes that execute the actual stress testing tasks. They can be multiple ordinary servers, virtual machines, or container instances. Slave nodes send requests (such as HTTP / TCP requests) to the system under test according to instructions from the master node, simulating user behavior or business load to perform stress testing. The number of slave nodes can be flexibly increased or decreased according to testing needs to adapt to different test scales.
[0061] The system under test: Loaded on the server under test, i.e., the target system for which performance evaluation is being performed. In the previous example, the server under test receives requests from the stressing node and processes these requests to complete the corresponding business logic.
[0062] The embodiments of the present invention include the following steps:
[0063] S1: Periodically collect the resource utilization data of the current slave node as the data at the current time point, and use the data at the current time point to predict the resource utilization data at the next time point;
[0064] S2: Determine whether the resource utilization data at the next time point is abnormal based on the dynamic threshold verification algorithm. If so, start the process migration mechanism for the process on the current slave node based on the priority migration strategy.
[0065] S3: Deploy bidirectional tracking probes on the slave node and the system under test, and use a unique business task ID to associate the pressure request traffic data of the slave node with the resource data of the system under test;
[0066] S4: Use density clustering algorithm to analyze and cluster the associated pressure request traffic and resource data, obtain abnormal feature clustering results, and identify abnormal problem patterns based on the clustering results;
[0067] S5: Real-time display of the relationship between the pressure request traffic, resource indicators, and abnormal problem patterns of each test interface, forming a full-link diagnostic view of pressure input and system response.
[0068] In one embodiment, using a sliding window exponential smoothing method to predict resource utilization data at the next time point from current time point data includes:
[0069] F t = α Yt-1 +(1−α)F t−1
[0070] In the formula, F t Y represents the predicted value of resource utilization data for period t. t-1 Let be the actual value of resource utilization data for period t-1, and α∈(0~1) be the smoothing coefficient.
[0071] In this embodiment, resource data from each slave node in the distributed system is continuously collected at 5-second intervals, including but not limited to CPU utilization, memory usage, and network bandwidth utilization. The collected data is processed using exponential smoothing, where the smoothing coefficient α was determined to be 0.6 through extensive experimentation. Actual testing shows that the error rate of this prediction method is ≤5%, enabling it to accurately predict resource change trends.
[0072] In one embodiment, the step of determining whether resource utilization data at the next time point is abnormal based on a dynamic threshold verification algorithm includes:
[0073] Historical resource data from each slave node is continuously collected through a sliding window.
[0074] The N% quantile value is independently calculated for the resource utilization data of each slave node and used as the dynamic threshold for that node, where N>50;
[0075] If the predicted resource utilization data for the next time point is greater than the N% quantile, then the priority migration strategy will be triggered.
[0076] In this embodiment, the 90th percentile value is used as the threshold, that is, the value found in historical data that makes 90% of the data less than this value is used as the threshold. This dynamic threshold setting method can better adapt to the resource characteristics and business load changes of different nodes, effectively avoiding the problem of insufficient adaptability of static thresholds in complex scenarios.
[0077] By collecting real-time data on node CPU load, memory saturation, and task queue length through a 5-second sliding window, and combining this with dynamic thresholds (such as a high-pressure threshold: CPU ≥ 75%, memory ≥ 60%, and queue length ≥ 80), the system achieves second-level determination of node stress status (latency < 100ms). Compared to the 500ms prediction period of the LSTM model, the response speed is improved by 80%, making it particularly suitable for simulating sudden traffic surges (peak usage of templates during holidays).
[0078] In one embodiment, the steps of initiating a process migration mechanism for processes on the current slave node based on a priority migration strategy include:
[0079] Capture the current process status information on the slave node;
[0080] The processes on the slave nodes are sorted according to the priority of the process status information, and the migration order of the processes is determined according to the priority.
[0081] The current process state data is incrementally serialized, and the process is migrated to an idle slave node in batches. The incrementally serialized data packets are then transmitted to the remote server using a zero-copy method. The data packets received by the remote server are used to restore the process state of the slave node.
[0082] After confirming that the remote server has successfully restored the process state, start releasing local resources from the node.
[0083] In this embodiment, only a small portion of processes are migrated in each batch to ensure system stability during the migration process. After optimization, the system can complete process reallocation between nodes within 100ms, significantly improving system response speed and resource scheduling efficiency.
[0084] The dynamic priority strategy (levels 1-5) automatically adjusts the task allocation based on the pressure level (reducing tasks by 20% for high-pressure nodes and increasing them by 20% for low-pressure nodes). Combined with the hot task priority migration mechanism (prioritizing the migration of tasks with a time consumption >500ms), the standard deviation of slave node resource utilization is reduced from 25% to 18% of the static allocation, the average CPU idle rate is reduced from 32% to 22%, the average memory idle rate is reduced from 35% to 28%, and the overall hardware resource utilization is improved by about 15%.
[0085] When a node enters a high-pressure state, the system automatically migrates 30% of its tasks to lower-priority normal nodes (migration time <500ms) and records the migration log (such as task ID, source node, and target node). In a simulated 100-node cluster, the system throughput drop during a single node failure was reduced from 30% under static allocation to 12%, and the test interruption time was shortened from 30 minutes under manual handling to within 2 minutes of automatic recovery.
[0086] This embodiment uses pure algorithm logic that does not rely on historical model data. After the master node restarts, data can be re-collected through a sliding window and the load distribution strategy can be quickly restored, avoiding test delays caused by model initialization. It is suitable for CI / CD pipeline scenarios that require frequent start-ups and shutdowns.
[0087] Dynamic thresholds and priority rules can be viewed and adjusted in real time through a visual interface (e.g., changing the memory threshold to 70% under high pressure). Testers do not need machine learning knowledge to understand the load distribution logic, thus lowering the technical threshold.
[0088] It supports manually locking node priority in emergency situations (such as forcing a node to priority level 5 to take on critical tasks) or pausing the automatic migration function to meet the manual control needs of special testing scenarios.
[0089] In one embodiment, for an HTTP request business task, using the unique business task ID in the HTTP header, the stress request traffic data from the node includes one or more of the following: queries per second (QPS) and response time; the resource data of the tested system associated with the stress request traffic data includes one or more of the following: CPU inter-core load, JVM young generation GC frequency, and memory fragmentation rate. This approach achieves nanoscale time alignment with a correlation accuracy of 99.2%, ensuring precise matching of traffic and resource data in the time dimension.
[0090] In one embodiment, when collecting traffic and resource data, the bidirectional tracking probe, in addition to basic performance metrics, also collects network-related data such as handshake latency and packet retransmission rate at the network protocol layer, as well as underlying system data such as process context switching counts and disk I / O queue lengths at the operating system layer. This supplementary data provides richer dimensions for performance analysis. For example, when analyzing issues with excessively long response times, combining network data and underlying system data allows for a more accurate distinction between network transmission problems and performance degradation caused by internal system resource contention.
[0091] In one embodiment, the density clustering algorithm includes the DBSCAN density clustering algorithm, which performs the following steps:
[0092] For each stress request, the stress request traffic data of its associated slave node and the resource data of the system under test are input into the DBSCAN algorithm as multi-dimensional data.
[0093] Clustering is performed based on the density relationship between multidimensional data inputs to identify data groups with similar behavioral patterns as dense regions, and data points that do not conform to any dense region are marked as anomalous data features.
[0094] Provide a problem description based on the characteristics of the abnormal data;
[0095] The abnormal data features and corresponding problem descriptions are aggregated into JSON, stored in memory as a hash table, and allowed for random access with O(1) time complexity.
[0096] It's important to note that the core idea of the DBSCAN algorithm is based on data point density. If the density of data points within a region exceeds a certain threshold, these points are grouped into a cluster. This approach improves efficiency by 60% compared to manual analysis, significantly increasing the speed and accuracy of anomaly diagnosis. Furthermore, it provides preliminary problem descriptions based on data characteristics, such as "memory leak" or "connection pool exhaustion - CPU glitches," to aid in subsequent data analysis of performance issues.
[0097] In this embodiment, the DBSCAN density clustering algorithm incorporates a dynamic parameter adjustment mechanism when applied to the identification of anomalies in performance data. The system automatically adjusts the neighborhood radius ε and the minimum number of samples (MinPts) within the neighborhood based on the characteristics of the data distribution at different testing stages. During the initial test phase, due to the relatively small amount and dispersed distribution of data, the ε value is appropriately increased and the MinPts value is decreased to ensure the capture of early potential anomaly patterns. During the peak stress phase, when the data volume increases significantly and fluctuates drastically, the ε value is dynamically decreased and the MinPts value is increased to improve clustering accuracy and avoid misjudgments.
[0098] In one embodiment, the OPTICS density clustering algorithm can be used to automatically determine the cluster density threshold, making it suitable for heterogeneous systems with uneven data distribution (such as hybrid cloud architectures). Clustering accuracy is improved to 92%, but memory usage increases by 25%, making it suitable for financial-grade testing scenarios with high accuracy requirements.
[0099] In one embodiment, resource metrics are supplemented with a description of performance metric values based on a weighted aggregation model using an attention mechanism:
[0100] S agg =∑α i S i
[0101] In the formula, S agg The aggregated performance metrics, such as CPU, memory, bandwidth utilization, JVM usage, GC frequency, request response time, throughput, etc., S i For each original performance index value, the weighting coefficient α i Adjusted dynamically based on the current testing phase.
[0102] In this embodiment, during the initialization phase, the system mainly performs resource preparation, environment setup, and network connection establishment. At this time, the weight α of network-related metrics (such as network latency and bandwidth utilization) is... network It can be appropriately increased; during peak stress periods, CPU and memory load become critical factors, therefore the weight α of metrics such as CPU context switch count and memory throughput should be increased. CPU α memory Automatic promotion; during the load offloading phase, system resources are gradually released, and the weight α of indicators such as resource release speed is... release Increase. Through this dynamic weighted aggregation, the composite metric of the current service is calculated. The output of the weighted aggregation model mainly includes:
[0103] 1. Comprehensive performance score of system health status.
[0104] 2. A set of sensitive data metrics for each stage, consisting of 3-5 core metrics with high weight in the current stage (such as CPU load and memory throughput during peak periods). This highlights key performance indicators for different testing stages (load testing, peak testing), providing users with more targeted performance data displays.
[0105] Based on the aggregated data, the system offers various visualization methods, such as line charts, bar charts, and pie charts. Users can choose different chart types to display performance data according to their needs. Simultaneously, the visualization interface updates regularly, dynamically reflecting changes in system performance and helping users stay informed about performance dynamics during testing.
[0106] In this embodiment, the attention-based weighted aggregation model further incorporates a context-aware module. This module dynamically adjusts the weight coefficient α by combining contextual data such as test scenario descriptions and business process information. i For example, when conducting performance testing of payment services, the context-aware module will identify that performance metrics related to the payment interface (such as payment success rate and transaction processing time) are of higher importance to the business, thereby significantly increasing the weight of these metrics during peak periods, allowing testers to focus more on the performance of key business operations.
[0107] In one embodiment, the method further includes a step of normalizing the heterogeneous data obtained from the nodes and the heterogeneous data of the system under test:
[0108] For sampling data of different frequencies, a dynamic time warping algorithm is used to align the load request traffic data of the slave node with the resource data of the system under test in terms of time. This embodiment addresses the problem of traffic and resources not being correlated by generating a unique business task ID for each request through bidirectional tracking probes, and aligning traffic data and resource data in time at the second level, providing underlying data support for upstream evaluation and analysis.
[0109] In this embodiment, the system supports access to more than 10 data sources, including Prometheus, JMX, and APM. For different data source formats, custom plugins are developed to standardize the data formats. For sampling data at different frequencies, such as 10ms-level traffic data and 1s-level JVM data, the Dynamic Time Warping (DTW) algorithm is used for time alignment. The basic principle of the DTW algorithm is to find the optimal matching path between two time series using dynamic programming, minimizing their distance on the time axis, thereby achieving effective alignment of data at different frequencies.
[0110] In one embodiment, a dynamic heatmap is used to display the correlation between the request traffic of each interface and metrics such as JVM thread stack depth and CPU cache hit rate in real time. Users can query the relationship between interface requests and resource metrics within a specific time period and under a specific business module, thereby forming a full-link diagnostic view of "pressure input - system response," providing an intuitive and comprehensive basis for locating performance problems.
[0111] In this embodiment, three-dimensional virtual reality (VR) visualization can be used instead of two-dimensional heatmaps. Users can immerse themselves in viewing end-to-end performance data by wearing VR devices, making it suitable for global analysis of large-scale distributed systems. Spatial information representation capabilities are further enhanced, and user immersion is improved, but additional hardware support is required, resulting in higher costs.
[0112] The second aspect of this invention discloses a distributed performance testing system based on a dynamic load prediction distributed performance testing method according to the first aspect of this invention, comprising: a master node, multiple slave nodes, and a system under test; the master node is used to allocate stress testing tasks to the slave nodes, the stress testing tasks being stress testing tasks simulating user behavior or business load; each slave node is used to send stress requests to the test interface of the system under test according to the allocated stress testing tasks to simulate user behavior or business load; and further includes:
[0113] The resource monitoring module is used to periodically collect the resource utilization data of the current slave node as the data at the current time point, and transmit the data to the load prediction module;
[0114] The load forecasting module predicts resource utilization data for the next time point based on data at the current time point;
[0115] The process migration control module uses a dynamic threshold verification algorithm to determine whether the resource utilization data at the next time point is abnormal. If it is abnormal, it triggers a priority migration strategy and starts the migration of processes on the current slave node.
[0116] The data association module is used to deploy bidirectional embedded probes between slave nodes and the system under test, and associate the pressure request traffic data of slave nodes with the resource data of the system under test through a unique business task ID;
[0117] The anomaly clustering analysis module is used to analyze the associated pressure request traffic and resource data using density clustering algorithm, output the clustering results of abnormal features, and identify the corresponding abnormal problem patterns.
[0118] The visualization diagnostic module is used to display the relationship between the stress request traffic, resource indicators, and abnormal problem patterns of each test interface in real time, and generate a full-link diagnostic view of stress input and system response.
[0119] The second aspect of the present invention is used to perform all the steps of the first aspect of the present invention.
[0120] The above provides a detailed description of the distributed performance testing method and system based on dynamic load prediction provided by the present invention. Specific examples are used in this embodiment to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
[0121] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined in these embodiments may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A distributed performance testing method based on dynamic load prediction, characterized in that, The master node is deployed to assign stress-applying tasks to the slave nodes. These stress-applying tasks are business tasks that apply stress to the system under test. The slave nodes then send stress requests to the test interface of the system under test according to the assigned stress-applying tasks to simulate user behavior or business load. This includes the following steps: S1: Periodically collect the resource utilization data of the current slave node as the data at the current time point, and use the data at the current time point to predict the resource utilization data at the next time point; S2: Determine whether the resource utilization data at the next time point is abnormal based on the dynamic threshold verification algorithm. If so, start the process migration mechanism for the process on the current slave node based on the priority migration strategy. S3: Deploy bidirectional tracking probes on the slave node and the system under test, and use a unique business task ID to associate the pressure request traffic data of the slave node with the resource data of the system under test; for HTTP request business tasks, the pressure request traffic data of the slave node includes one or more of the following: query per second (QPS) and response time; the resource data of the system under test associated with the pressure request traffic data includes one or more of the following: CPU inter-core load, JVM young generation GC frequency, and memory fragmentation rate; S4: A density clustering algorithm is used to analyze and cluster the associated pressure request traffic and resource data to obtain abnormal feature clustering results, and abnormal problem patterns are identified based on the clustering results; the density clustering algorithm includes the DBSCAN density clustering algorithm, used to perform the following steps: For each stress request, the stress request traffic data of its associated slave node and the resource data of the system under test are input into the DBSCAN algorithm as multi-dimensional data. Clustering is performed based on the density relationship between the multidimensional data inputs to identify data groups with similar behavioral patterns as dense regions, and data points that do not conform to any dense region are marked as anomalous data features. Provide a problem description based on the characteristics of the abnormal data; The abnormal data features and corresponding problem descriptions are aggregated into JSON, stored in memory as a hash table, and allowed for random access with O(1) time complexity. S5: Real-time display of the relationship between stress request traffic, resource metrics, and abnormal problem patterns for each test interface, forming a full-link diagnostic view of stress input and system response; the resource metrics are described by adding performance indicator values based on a weighted aggregation model with an attention mechanism. S agg =∑α i S i In the formula, S agg S represents the performance metric value after aggregation. i For each original performance index value, the weighting coefficient α i Adjusted dynamically based on the current testing phase; The dynamic heatmap displays the relationship between the pressure request traffic, resource metrics, and abnormal problem patterns of each test interface in real time. It can receive and respond to query commands on the relationship between the pressure request traffic, resource metrics, and abnormal problem patterns of test interfaces under a specified time period and a specified business task.
2. The distributed performance testing method based on dynamic load prediction according to claim 1, characterized in that, The method of using a sliding window exponential smoothing to predict resource utilization data for the next time point using the current time point data includes: F t = α Y t-1 +(1−α)F t−1 In the formula, F t Y represents the predicted value of resource utilization data for period t. t-1 Let be the actual value of resource utilization data for period t-1, and α∈(0~1) be the smoothing coefficient.
3. The distributed performance testing method based on dynamic load prediction according to claim 1, characterized in that, The steps for determining whether the resource utilization data at the next time point is abnormal based on the dynamic threshold verification algorithm include: Historical resource data from each slave node is continuously collected through a sliding window. The N% quantile value is independently calculated for the resource utilization data of each slave node and used as the dynamic threshold for that node, where N>50; If the predicted resource utilization data for the next time point is greater than the N% quantile, then the priority migration strategy is triggered.
4. The distributed performance testing method based on dynamic load prediction according to claim 1, characterized in that, The steps for initiating a process migration mechanism on the current slave node based on a priority migration strategy include: Capture the current process status information on the slave node; The processes on the slave nodes are sorted according to the priority of the process status information, and the migration order of the processes is determined according to the priority. The current process state data is incrementally serialized, and the process is migrated to an idle slave node in batches. The incrementally serialized data packets are then transmitted to a remote server using a zero-copy method. The data packets received by the remote server are used to restore the process state of the slave node. After confirming that the remote server has successfully restored the process state, start releasing local resources from the node.
5. A distributed performance testing method based on dynamic load prediction according to claim 1, characterized in that, It also includes the step of normalizing the heterogeneous data obtained from the nodes and the heterogeneous data of the system under test: For sampling data of different frequencies, a dynamic time warping algorithm is used to align the pressure request traffic data of the slave node with the resource data of the system under test in terms of time.
6. A distributed performance testing system based on a distributed performance testing method according to any one of claims 1-5, comprising: Master node, multiple slave nodes, and the system under test; The master node is used to assign stress-exerting tasks to the slave nodes, and the stress-exerting tasks are stress test tasks that simulate user behavior or business load. Each slave node is used to send stress requests to the test interface of the system under test according to the assigned stress task, in order to simulate user behavior or business load; it also includes: The resource monitoring module is used to periodically collect the resource utilization data of the current slave node as the data at the current time point, and transmit the data to the load prediction module; The load prediction module predicts resource utilization data for the next time point based on the data at the current time point; The process migration control module uses a dynamic threshold verification algorithm to determine whether the resource utilization data at the next time point is abnormal. If it is abnormal, it triggers a priority migration strategy and starts the migration of processes on the current slave node. The data association module is used to deploy bidirectional embedded probes between slave nodes and the system under test, and associate the pressure request traffic data of slave nodes with the resource data of the system under test through a unique business task ID; The anomaly clustering analysis module is used to analyze the associated pressure request traffic and resource data using density clustering algorithm, output the clustering results of abnormal features, and identify the corresponding abnormal problem patterns. The visualization diagnostic module is used to display the relationship between the stress request traffic, resource indicators, and abnormal problem patterns of each test interface in real time, and generate a full-link diagnostic view of stress input and system response.
Citation Information
Patent Citations
Full-link performance test method and system
CN113965502A
HBase client main and standby switching method and system based on fault perception
CN119537484A