Distributed stream processing system parameter tuning method based on multi-objective reinforcement learning
By using a multi-objective reinforcement learning approach to dynamically adjust the parameters of a distributed stream processing system, the problem of balancing system performance and resource consumption is solved, achieving efficient tuning and cost savings under dynamic loads.
Patent Information
- Application Number
- CN202511520893.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-10-23
AI Technical Summary
Existing parameter tuning methods for distributed stream processing systems cannot effectively handle a large number of parameters, cannot dynamically balance system performance and resource consumption, and are prone to job restarts and resource waste during online tuning.
We employ a multi-objective reinforcement learning approach, continuously monitor system performance metrics, construct a set of reinforcement learning models, perform multi-objective optimization, select the highest quality Pareto front for online tuning, and dynamically adjust parameters to balance throughput and resource utilization.
It enables efficient tuning of distributed stream processing systems under dynamic workloads, ensuring a balance between system performance and resource consumption, reducing job restarts and resource waste, and improving system adaptability and cost-effectiveness.
Smart Images

Figure CN120973549A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of distributed system optimization technology, specifically relating to a parameter tuning method for distributed stream processing systems based on multi-objective reinforcement learning. Background Technology
[0002] With the rapid development of big data technology and network applications, the demand for real-time computation of massive amounts of rapidly generated data covers multiple fields such as e-commerce, the Internet of Things, and machine learning, giving rise to distributed stream processing systems such as Apache Flink. These systems abstract continuously generated data into data streams and data computation operations into directed acyclic graphs (DAGs) connected by operators. Each operator has multiple parallel replicas running on different physical machines. Data flows into the system from upstream data sources, flows along the edges of the DAG between operators, and finally merges into a data pool. In the cloud computing era, distributed stream processing systems are typically provided as cloud-hosted services on a pay-as-you-go basis. Therefore, users need to minimize the use of resources such as processors and memory while maintaining system processing capacity. Through adaptive parameter tuning, users can dynamically adjust processing capacity and resource consumption according to the current system workload, thereby saving costs.
[0003] Parameter tuning in distributed stream processing systems faces numerous challenges: First, distributed stream processing systems have a vast number of parameters; for example, Apache Flink has over 200 parameters, making it difficult for traditional machine learning models to handle such a large parameter space. Second, parameter tuning in distributed stream processing systems is a multi-objective optimization problem, requiring a balance between system performance and resource consumption. The time-varying nature of the workload necessitates real-time adjustment of the weights of these two objectives, but existing parameter tuning methods typically only consider system performance as an optimization objective, failing to adapt to tuning requirements under different workloads. Furthermore, stream processing jobs are usually long-running; switching system configurations pauses the job and incurs significant overhead. If the new configuration alters the job graph structure, it may lead to unrecoverable operator states, causing job restart failures. Existing methods typically involve online learning of tuning strategies, which involves multiple configuration switches during the learning process and does not consider job graph compatibility issues.
[0004] Chinese patent application CN115934342A discloses a method, apparatus, device, and storage medium for job resource optimization. It obtains user-configured scaling policies through a resource monitor, collects real-time resource information and metrics of the Flink cluster, determines whether job resource optimization is necessary, and if so, sends the scaling policy to the scaling monitor for resource optimization. This method helps increase resource utilization efficiency and reduce user costs by monitoring Flink cluster metrics in real time and dynamically optimizing resources. However, the scaling policy requires manual configuration by the user, which cannot guarantee optimization performance on new jobs; furthermore, the operation only involves resource scaling and does not involve other parameters that may affect the behavior of the stream processing system.
[0005] Chinese patent application CN115687304A discloses a method and apparatus for optimizing Flink state storage. It uses a performance acquisition device to obtain system information and sends it to a tuning controller. The tuning controller determines whether parameter tuning is needed; if so, it sends the parameter model and tuning rules to a machine learning tuner. The machine learning tuner uses a Gaussian process regression model combined with a Bayesian optimization algorithm to derive parameter adjustment results and sends them to the tuning controller. The tuning controller dynamically adjusts the configuration parameters of the Flink state storage. This method uses a Bayesian optimization algorithm to learn optimal parameters and has a certain degree of adaptability. However, the tuning results obtained by Bayesian optimization are probabilistic and may generate invalid parameters, leading to multiple system restart attempts and additional overhead. Furthermore, this method only optimizes system performance and does not involve resource consumption, which can easily lead to resource excess and is not conducive to saving users' job operation costs.
[0006] Therefore, it is evident that existing distributed stream processing system parameter tuning methods only consider a portion of the configurable parameters and lack the ability to adjust all parameters. Secondly, existing distributed stream processing system parameter tuning methods have a single optimization objective and cannot dynamically adjust the balance between processing capacity and resource overhead according to workload. Furthermore, existing distributed stream processing system parameter tuning methods cannot control the number of restarts and job graph compatibility during online operation, resulting in high overhead for online tuning. Summary of the Invention
[0007] In view of the above, the present invention provides a parameter tuning method for distributed stream processing systems based on multi-objective reinforcement learning. This method is based on a multi-objective reinforcement learning framework, which enables efficient tuning of the complete parameter space of the distributed stream processing system, provides rapid adaptability under dynamic workloads, and effectively balances system performance and resource overhead.
[0008] A parameter tuning method for a distributed stream processing system based on multi-objective reinforcement learning includes the following steps: (1) Use an index collector to continuously monitor the performance indicators of each operator in the distributed stream processing system; (2) When training the model offline, maintain a set of reinforcement learning models. Each reinforcement learning model in the set uses different weights to perform multi-objective optimization on the throughput and resource utilization efficiency of the streaming processing job, forming the optimal set of models. (3) Run each model in the optimal model set, collect its actions, rewards and corresponding job graph structures, and group all actions and rewards according to job graph structures; (4) For each group, calculate the Pareto frontier based on the reward, and select the Pareto frontier with the highest quality for online optimization; (5) During the online optimization process, the data source rate of the distributed stream processing system is obtained from the index collector, and the action with the highest quality Pareto front with a throughput greater than the data source rate and the minimum resource consumption is dynamically selected, and the parameter value corresponding to the action is applied to the distributed stream processing system.
[0009] Further, the specific implementation of step (1) is as follows: for any operator in the distributed stream processing system, its performance indicators are collected every 10 seconds, including idle time, busy time, backpressure time, number of input records per second and number of output records per second. The maximum, minimum and average values of the above indicators are collected on all parallel instances. Finally, these performance indicator values of all operators are concatenated to form the state vector of the distributed stream processing system.
[0010] Further, the specific implementation of step (2) is as follows: the parameter tuning process is modeled as a Markov decision process, including states, actions, and rewards, where the states are the state vectors of the distributed stream processing system, the actions are the values of all configurable parameters of the distributed stream processing system, and the rewards are... Among them, throughput t The number of records received per second by the stream processing task, and resource utilization efficiency. The number of CPU cores used by a stream processing task is inversely proportional to the amount of memory; initialization includes or A collection of reinforcement learning models , where the model m i The weighted sum of the rewards is Each model uses different weights. α i , i =1,2,…, or Each reinforcement learning model is trained independently, and a set of optimal models under each reward weight is obtained by solving the Markov decision process.
[0011] Furthermore, the specific implementation of step (3) is as follows: for any model in the optimal model set, execute its strategy for several steps, and perform the action of each step in that round. a ,award r and the structure of the work diagram G Store to history In the above, the operation diagram structure G This refers to the directed acyclic graph formed by all operators in the stream processing job after applying the configuration options; after all models have been executed, all historical records will be... Classify according to the structure of the work diagram to form multiple subsets. .
[0012] Furthermore, the specific implementation of step (4) is as follows: First, calculate the reward for each subset. The Pareto front is calculated, then the hypervolume of each Pareto front is calculated, and finally the Pareto front with the largest hypervolume is selected for online tuning.
[0013] Further, the specific implementation of step (5) is as follows: continuously monitor the data source rate of the distributed stream processing system, and trigger the optimization operation when the data source rate fluctuation exceeds 10% of the data source rate at the time of the last optimization; after the optimization operation is triggered, select the action with the highest throughput and resource utilization efficiency from the selected Pareto front, and apply the parameter value corresponding to the action to the distributed stream processing system.
[0014] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described parameter tuning method for a distributed stream processing system based on multi-objective reinforcement learning.
[0015] A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described parameter tuning method for a distributed stream processing system based on multi-objective reinforcement learning.
[0016] To address the parameter tuning problem of distributed stream processing systems in the field of distributed system optimization technology, this invention designs a method for real-time acquisition of the operator status of stream processing jobs to provide data support for the tuning process. Furthermore, this invention designs an offline multi-objective reinforcement learning method to quickly learn the optimal configuration values of the entire parameter space under different weights of system performance and resource utilization efficiency. In addition, this invention also designs an online dynamic parameter adjustment method to achieve smooth adaptation under dynamic workloads, ensuring job graph compatibility and minimizing the cost of switching configurations in a production environment. Attached Figure Description
[0017] Figure 1This is a schematic diagram of the parameter tuning method for a distributed stream processing system based on multi-objective reinforcement learning, as described in this invention. Detailed Implementation
[0018] To describe the present invention in more detail, the technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0019] This embodiment uses a large-scale real-time traffic flow prediction task as an example to illustrate the specific application of the technical solution of the present invention. In this task, sensors (such as cameras, geomagnetic coils, etc.) deployed throughout the city continuously generate traffic data (such as traffic flow, average vehicle speed, etc.), forming a high-speed data stream. These data streams are uploaded to a data collection gateway, and then sent to a distributed stream processing system for real-time computation via a message queue. In this system, the entire traffic flow prediction task is modeled as a directed acyclic graph, or operation graph, composed of multiple operators, including data input operators, data cleaning operators, data aggregation operators, and model-based prediction operators. To distribute the computational pressure of massive amounts of data, each operator can be deployed as multiple parallel instances distributed across different physical machines. Traffic data flows along the edges of the operation graph between operators, undergoes progressive computation, and finally generates prediction results which are output to downstream application systems.
[0020] It is worth noting that distributed stream processing systems have a large number of configurable operating parameters (such as operator parallelism, memory allocation, network buffer size, job graph optimization strategies, etc.), which directly affect the system's processing capacity and resource consumption. In actual operation, it is necessary to ensure that the system's throughput is always higher than the data input rate to avoid backpressure caused by data accumulation, while at the same time controlling the resource overhead such as processors and memory as much as possible to achieve cost-effectiveness optimization. To address this requirement, this implementation provides a parameter tuning method for distributed stream processing systems based on multi-objective reinforcement learning. This method can dynamically adjust the operating parameters of the distributed stream processing system according to the real-time traffic data load, thereby ensuring an effective balance between system performance and resource utilization in scenarios where the speed of traffic data generation changes dynamically, achieving the goal of energy saving and cost reduction. The specific implementation process of this method is as follows: Figure 1 As shown: Step S11: Use the metrics collector to continuously monitor the performance metrics of each operator in the distributed stream processing system.
[0021] 1-1: Every 10 seconds, a request is sent to the metrics query interface of the distributed stream processing system to query the idle time, busy time, backpressure time, average number of input records per second, and average number of output records per second of all parallel instances of each operator in the past 10 seconds as performance metrics (5 in total).
[0022] 1-2: For each operator, calculate the maximum, minimum, and average values of the above metrics across all parallel instances, and concatenate the metric values of all operators to form the state vector of the entire stream processing system. For example, if the job contains... N If there are 15 operators, then the state vector dimension is 15. N .
[0023] Step S12: When training the model offline, maintain a set of reinforcement learning models. Each model uses different weights to perform multi-objective optimization on throughput and resource utilization efficiency in the reward, and iterates multiple times to form the optimal set of models.
[0024] 2-1: The parameter tuning process is modeled as a Markov decision process, including states, actions, and rewards; the state refers to the state vector of the distributed stream processing system collected by the index collector; the action refers to the values of all configurable parameters of the distributed stream processing system; the reward is... Among them, throughput t The number of records received per second by the stream processing task, and resource utilization efficiency. The number of CPU cores used by a stream processing task is inversely proportional to the amount of memory.
[0025] Specifically, the state vectors collected in step S11 are modeled as the states of a Markov decision process. s Modeling all configurable parameter values of a distributed stream processing system as actions of a Markov decision process. a ; Transform the binary vector Rewards modeled as Markov decision processes r Among them, throughput t Equals the sum of the number of input records per second for all operators directly connected to the upstream data source, representing resource utilization efficiency. ,in c The sum of the number of CPU cores used by all operators. m The sum of memory used by all operators, in GB. β This is a weighted hyperparameter used to balance the importance of CPU and memory.
[0026] 2-2: Initialization includes or A collection of reinforcement learning models , where the model m i The weighted sum of the rewards is Each model uses different weights. α i .
[0027] Specifically, the set M Each model in the algorithm employs the Soft Actor-Critic reinforcement learning algorithm, defining the optimization objective for each round as... ,in t For time steps, For the first t The time step is in the state s t Action as a t Weighted sum of rewards at the time , π As a strategy, For strategy π In state s t The entropy below, oh To control the temperature parameters for the exploration and exploitation tradeoffs. For each model. m i Assign different reward weights α i The calculation formula is: This ensures that the weights are evenly distributed within the interval [0,1].
[0028] 2-3: Train each reinforcement learning model independently to solve the Markov decision process, and obtain a set of optimal models under each reward weight.
[0029] Specifically, each reinforcement learning model is trained independently using the Soft Actor-Critic algorithm. After training, the final policy network parameters of all models are saved, with each model corresponding to a specific weight. α i The following optimization strategy maximizes the reward.
[0030] Step S13: Run each model in the optimal model set, collect its actions, rewards and corresponding task graph structures, and group all actions and rewards according to task graph structures.
[0031] 3-1: For each optimal model, execute its policy. N Step, the action of each step in this round. a ,award r and the structure of the work diagram G Store to history In this context, the job graph refers to the directed acyclic graph composed of all operators in a stream processing job after the application of configuration options.
[0032] Specifically, create an empty collection of history records. This is used to store the execution results of all models; for each model in the optimal model set... m i ,implement N Step-by-step strategy, generating one action per step. a Receive corresponding rewards rAnd record the current job diagram structure. G The work diagram G Indicates application configuration action a A directed acyclic graph consisting of all operators and their connections in the post-stream processing job; the triples of each step... Add to history collection middle.
[0033] 3-2: After all the optimal models have been executed, classify all historical records according to the job graph structure to form multiple subsets. .
[0034] Specifically, extracting historical records All the work diagram structures in the set are used to form a work diagram collection. For each work diagram Create the corresponding subset .
[0035] Step S14: For each group, calculate the Pareto front based on the reward and select the Pareto front with the highest quality.
[0036] 4-1: Extract each subset Calculate the Pareto front for all rewards. Defined as A subset of, for all Does not exist Make and .
[0037] 4-2: Calculate the hypervolume for each Pareto front, where the Pareto front... super volume ,in n Pareto frontier Size, The subscripts of the elements are arranged in ascending order of throughput.
[0038] 4-3: Select the set of motions corresponding to the Pareto front with the largest supervolume. ,in It is used for online optimization.
[0039] Step S15: During the online tuning process, obtain the data source rate of the stream processing system from the index collector, dynamically select the action with a throughput greater than the data source rate and the minimum resource consumption from the highest quality Pareto front, and apply the parameter value corresponding to the action to the distributed stream processing system.
[0040] 5-1: Continuously monitor the data source rate of the stream processing job. When the data source rate fluctuates by more than 10% of the data source rate at the time of the last optimization, trigger the optimization operation.
[0041] Specifically, every 10 seconds, the metric collector collects the average number of input records per second from all data source nodes, and the sum is recorded as follows: l If the current data source rate l t lie in Outside the range, parameter tuning is triggered.
[0042] 5-2: When a tuning operation is triggered, select the action with the highest throughput and resource utilization efficiency from the selected action set, and apply the parameter value corresponding to that action.
[0043] Specifically, from the selected optimal set of actions A Select the subset of actions that satisfy the throughput constraints. ;from Select resource utilization efficiency Biggest movement , will the action The corresponding parameter configurations are applied to the distributed stream processing system to update system operating parameters; the current data source rate is recorded. l Waiting for the next workload change.
[0044] The above description of the embodiments is provided to enable those skilled in the art to understand and apply the present invention. Those skilled in the art can readily make various modifications to the above embodiments and apply the general principles described herein to other embodiments without creative effort. Therefore, the present invention is not limited to the above embodiments, and any improvements and modifications made to the present invention by those skilled in the art based on the disclosure thereof should be within the scope of protection of the present invention.
Claims
1. A parameter tuning method for a distributed stream processing system based on multi-objective reinforcement learning, characterized in that, Includes the following steps: (1) Use an index collector to continuously monitor the performance indicators of each operator in the distributed stream processing system; (2) When training the model offline, maintain a set of reinforcement learning models. Each reinforcement learning model in the set uses different weights to perform multi-objective optimization on the throughput and resource utilization efficiency of the streaming processing job, forming the optimal set of models. (3) Run each model in the optimal model set, collect its actions, rewards and corresponding job graph structures, and group all actions and rewards according to job graph structures; (4) For each group, calculate the Pareto frontier based on the reward, and select the Pareto frontier with the highest quality for online optimization; (5) During the online optimization process, the data source rate of the distributed stream processing system is obtained from the index collector, and the action with the highest quality Pareto front with a throughput greater than the data source rate and the minimum resource consumption is dynamically selected, and the parameter value corresponding to the action is applied to the distributed stream processing system.
2. The parameter tuning method for a distributed stream processing system based on multi-objective reinforcement learning according to claim 1, characterized in that, The specific implementation of step (1) is as follows: For any operator in the distributed stream processing system, its performance indicators are collected every 10 seconds, including idle time, busy time, backpressure time, number of input records per second and number of output records per second. The maximum, minimum and average values of the above indicators are collected on all parallel instances. Finally, these performance indicator values of all operators are concatenated to form the state vector of the distributed stream processing system.
3. The parameter tuning method for a distributed stream processing system based on multi-objective reinforcement learning according to claim 1, characterized in that, The specific implementation of step (2) is as follows: the parameter tuning process is modeled as a Markov decision process, including state, action, and reward. The state is the state vector of the distributed stream processing system, the action is the value of all configurable parameters of the distributed stream processing system, and the reward is... Among them, throughput τ The number of records received per second by the stream processing task, and resource utilization efficiency. The number of CPU cores used by a stream processing task is inversely proportional to the amount of memory; initialization includes η A collection of reinforcement learning models , where the model m i The weighted sum of the rewards is Each model uses different weights. α i , i =1,2,…, η ; Each reinforcement learning model is trained independently, and a set of optimal models under each reward weight is obtained by solving the Markov decision process.
4. The parameter tuning method for a distributed stream processing system based on multi-objective reinforcement learning according to claim 1, characterized in that, The specific implementation of step (3) is as follows: For any model in the optimal model set, execute its strategy in several steps, and perform the action of each step in that round. a ,award r and the structure of the work diagram G Store to history In the above, the operation diagram structure G This refers to the directed acyclic graph formed by all operators in the stream processing job after applying the configuration options; after all models have been executed, all historical records will be... Classify according to the structure of the work diagram to form multiple subsets. .
5. The parameter tuning method for a distributed stream processing system based on multi-objective reinforcement learning according to claim 1, characterized in that, The specific implementation method of step (4) is as follows: First, calculate the reward for each subset. The Pareto front is calculated, then the hypervolume of each Pareto front is calculated, and finally the Pareto front with the largest hypervolume is selected for online tuning.
6. The parameter tuning method for a distributed stream processing system based on multi-objective reinforcement learning according to claim 1, characterized in that, The specific implementation of step (5) is as follows: continuously monitor the data source rate of the distributed stream processing system. When the data source rate fluctuates by more than 10% of the data source rate at the time of the last optimization, trigger the optimization operation. After the optimization operation is triggered, select the action with the highest throughput and resource utilization efficiency from the selected Pareto front, and apply the parameter value corresponding to the action to the distributed stream processing system.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: The processor is used to execute the computer program to implement the parameter tuning method for a distributed stream processing system based on multi-objective reinforcement learning as described in any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, it implements the parameter tuning method for a distributed stream processing system based on multi-objective reinforcement learning as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Flink state storage optimization method and device
CN115687304A
Job resource tuning method and device, equipment and storage medium
CN115934342A
Intelligent computing resource allocation method based on reinforcement learning
CN120104323A
Intelligent telescoping and tuning method for reinforcement learning driving in big data pipeline
CN120315903A
Distributed component dynamic resource allocation method based on multi-objective optimization
CN120469799A