Big data computing framework-based double-layer coordination load balancing scheduling method and system
Through the dual-layer coordination load balancing scheduling method, the load priority of the Flink cluster TaskManager nodes and slots is dynamically adjusted, which solves the problem of load imbalance on the big data processing platform and improves resource utilization and system performance.
Patent Information
- Application Number
- CN202410687454.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-10-15
AI Technical Summary
Big data processing platforms have load imbalance problems when processing massive data, which leads to resource polarization and affects system throughput and delay. Existing scheduling algorithms such as first-come, first-served policy cannot effectively balance resource allocation.
A two-layer coordinated load balancing scheduling method is proposed. By initializing the load information of the Flink cluster TaskManager node, calculating the load area, evaluating the comprehensive evaluation indicators of nodes and slots, dynamically adjusting the task scheduling priority, priority is given to placing tasks in areas with low resource utilization. On the nodes and slots, load information is updated periodically to achieve load balancing.
It effectively improves the load balancing degree of the cluster, avoids load tilt, and improves resource utilization and system performance.
Smart Images

Figure CN118779094A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data streaming processing, and in particular to a double-layer coordinated load balancing scheduling method and system based on a big data computing framework. Background Art
[0002] As a strategic resource, big data is becoming the main engine driving social and economic development. With the rise of technologies such as 5G commercialization, artificial intelligence, cloud computing, and the Internet of Things, as well as the transformation of traditional industries to digitalization and informatization, the amount of data is growing exponentially. The development of these technologies has not only brought about massive amounts of data, but also spawned a steady stream of various data types. According to the "Data Age 2025 Report" released by Seagate and IDC, by 2025, the total amount of data will reach 163ZB, of which more than 25% will be real-time data. The report predicts that by 2030, major data industries will account for 15% of the total economy, and China's total data will exceed 4 billion, accounting for 30% of the global total.
[0003] With the continuous growth of massive data, the real-time requirements for data processing have become increasingly important, which requires big data processing platforms to have real-time processing capabilities, and the main goal of big data stream processing platforms is the timeliness of data processing. In recent years, many excellent stream processing platforms have emerged, including Apache Storm, Apache Spark, TwitterHeron, Apache Flink, etc. Apache Flink is a distributed big data computing engine with high performance and high availability that integrates batch and stream processing based on data streams. It provides distributed computing functions for data distribution, communication and fault tolerance on data streams. In terms of fault tolerance, Flink uses Chandy-Chandy-Lamport Algorithm to make asynchronous distributed snapshots, which is essentially a checkpoint mechanism. However, Flink's checkpoint mechanism is more lightweight. Compared with Storm, which needs to Ack each piece of data, the cost of fault tolerance is much smaller, and more importantly, it guarantees exactly once. In terms of throughput, Flink's lightweight fault tolerance mechanism has little impact on throughput, and it has some optimization mechanisms in graphs and scheduling, so Flink can also achieve very high throughput. In terms of latency, Flink is also based on Native Streaming and can also achieve latency of hundreds of milliseconds. In summary, Flink is a real-time stream computing framework with high throughput, low latency, and high performance.
[0004] The surge in tasks that need to be processed in the era of big data has led to a more serious load skew in big data clusters, and load imbalance has seriously affected cluster performance. The resource polarization caused by load skew has further aggravated system throughput and latency problems, thereby increasing unnecessary overhead, so it is necessary to study the load balancing of big data processing clusters. Flink's default scheduling algorithm uses a first-come, first-served approach to assign tasks. This strategy does not consider the balanced allocation of resources. It selects the first slot from the set of available slots that meet the conditions to place tasks, which can easily lead to excessive load on some nodes in a heterogeneous cluster, while the load on some nodes is too low, resulting in a load skew in the cluster, which seriously affects the performance of the cluster. Summary of the invention
[0005] In order to solve the problems existing in the background technology, the present invention provides a double-layer coordinated load balancing scheduling method and system based on a big data computing framework, which effectively improves the load balancing degree of the cluster.
[0006] In order to achieve the above technical objectives, one aspect of the present invention provides a two-layer coordinated load balancing scheduling method based on a big data computing framework, comprising:
[0007] S1: Initialize the load information of the TaskManager node in the Flink cluster;
[0008] S2: Generates a set of tasks to be scheduled based on the Flink Job submitted by the client;
[0009] S3: Calculate the maximum and minimum values of the cluster load and divide the load area according to the node load size;
[0010] S4: Determine whether the low-load area is empty. If not, calculate the comprehensive evaluation index of all nodes in the current low-load area to obtain the scheduling priority list of the TaskManager node;
[0011] S5: Calculate the comprehensive evaluation index of all nodes in the current normal load area and obtain the scheduling priority list of TaskManager nodes;
[0012] S6: traverse the task list to be scheduled, determine whether the scheduling priority list of the low-load area is empty, if so, add the nodes in the normal load area to the low-load area, select the node with the highest priority in the scheduling priority list, obtain all resource slots of the current TaskManager node and the resource utilization rate of each resource slot, obtain the load priority list of the resource slot, and select the resource slot with the highest priority in the load priority list to place the task;
[0013] S7: Update the load information of the selected TaskManager node according to the runtime data of the selected TaskManager node during the task scheduling execution process; repeat steps S2-S7 to execute the task scheduling.
[0014] Preferably, the initializing the load information of the TaskManager node in the Flink cluster includes: using a polling scheduling strategy to assign tasks to the TaskManager nodes in the Flink cluster and execute them, and initializing the load information of the TaskManager nodes after the scheduling is completed.
[0015] Preferably, the performance of the TaskManager node includes:
[0016]
[0017] ω1+ω2=1
[0018] Where u represents the number of CPU cores of the TaskManager node. represents the CPU utilization of the i-th TaskManager node, ω1 and ω2 represent weight parameters.
[0019] Preferably, the load of the TaskManager node includes:
[0020]
[0021] α+β=1
[0022] in, Indicates the CPU utilization of the i-th TaskManager node, represents the memory utilization of the i-th TaskManager node, and α and β represent weight parameters.
[0023] Preferably, the average load value of the cluster includes:
[0024]
[0025] Preferably, the load offset of the cluster includes:
[0026]
[0027] Preferably, the load weight of the TaskManager node includes:
[0028]
[0029] Preferably, the threshold value of the system load range includes:
[0030]
[0031] Among them, Load max Indicates the maximum value of the cluster load, Load min Indicates the minimum value of cluster load, L(N i ) represents the load of the i-th TaskManager node in the cluster, and n represents the number of slave nodes in the cluster.
[0032] Preferably, the range of the maximum value of the cluster load and the minimum value of the cluster load includes:
[0033]
[0034] Another aspect of the present invention provides a two-layer coordinated load balancing scheduling system based on a big data computing framework, wherein the system applies a two-layer coordinated load balancing scheduling method under a Flink framework, including: a Flink architecture, a load monitoring module and a MySQL database;
[0035] The Flink architecture includes: a JobManager node and multiple TaskManager nodes;
[0036] The load monitoring module is used to calculate the load information of the TaskManager node according to the runtime data of the TaskManager node during task scheduling and execution, and store the load information of the TaskManager node in the MySQL database to update the load priority list of the TaskManager node.
[0037] Preferably, the method of assigning tasks to the TaskManager node according to the load priority list of the current TaskManager node includes: traversing the task list to be scheduled, selecting the task that needs to be allocated resources, selecting the node with the highest priority in the scheduling priority list, obtaining all the slots of the current TaskManager node and the resource utilization of each slot, obtaining the load priority list of the slot, and selecting the slot with the highest priority in the load priority list to place the task.
[0038] The present invention has at least the following beneficial effects
[0039] The present invention proposes a load calculation method for TaskManager nodes. When a Flink job is executed, the TaskManager node that is most suitable for executing the task is selected according to the load priority list, all slots of the current TaskManager node and the resource utilization of each slot are obtained, and tasks are placed on slots with low resource utilization first, so as to achieve load balancing between and within nodes, thereby effectively improving the load balancing degree of the cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0041] Figure 2 A resource allocation diagram for load tilting of the present invention;
[0042] Figure 3 It is a cluster load area division diagram of the present invention;
[0043] Figure 4 This is a resource allocation diagram for cluster load balancing of the present invention. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and comprehensively describe the technical solution of the present invention. It should be pointed out that the described embodiments only represent a part of the implementation methods of the present invention, not all. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0045] See also Figure 1 , a load balancing model is constructed to solve the load imbalance problem caused by task scheduling in Flink clusters deployed in heterogeneous cloud environments. The model takes into account the different resource requirements of different task types in heterogeneous clusters and defines the performance of resource nodes in different task scenarios by setting weights. Based on the above-mentioned load balancing model, a two-layer coordinated load balancing scheduling algorithm based on Flink is proposed, which effectively improves the load balancing degree of the cluster. In order to improve the load balancing degree of the cluster, this embodiment proposes a two-layer coordinated load balancing scheduling method under the Flink framework, including:
[0046] S1: Initialize the load information of the TaskManager node in the Flink cluster;
[0047] S2: Generates a set of tasks to be scheduled based on the Flink Job submitted by the client;
[0048] S3: Calculate the maximum and minimum values of the cluster load and divide the load area according to the node load size;
[0049] S4: Determine whether the low-load area is empty. If not, calculate the comprehensive evaluation index of all nodes in the current low-load area to obtain the scheduling priority list of the TaskManager node;
[0050] S5: Calculate the comprehensive evaluation index of all nodes in the current normal load area and obtain the scheduling priority list of TaskManager nodes;
[0051] S6: traverse the task list to be scheduled, determine whether the scheduling priority list of the low-load area is empty, if so, add the nodes in the normal load area to the low-load area, select the node with the highest priority in the scheduling priority list, obtain all the slots of the current TaskManager node and the resource utilization of each slot, obtain the slot load priority list, and select the slot with the highest priority in the load priority list to place the task;
[0052] S7: Update the load information of the selected TaskManager node according to the runtime data of the selected TaskManager node during the task scheduling execution process; repeat steps S2-S7 to execute the task scheduling.
[0053] See also Figure 2 , Figure 2 The resource allocation diagram is represented as a load-skewed graph. Assume that the cluster consists of 8 TaskManager (TM) nodes, each TM node has 4 slots, and the parallelism of the task is set to 20. The result of using traditional task scheduling may be as follows: Figure 2 As shown. It can be seen from the figure that in a certain period of time, due to the relatively low priority of TM4, TM5 and TM7, the tasks are preferentially placed on other nodes with higher priorities. At this moment, the cluster load is unbalanced. For example, the load of TM1 or TM2 is too high, while the load of TM5 and TM7 is too low. The resources are not fully utilized, which ultimately affects the cluster performance such as the time and throughput of job execution. After being processed by the method of the present invention, tasks will be preferentially assigned to nodes with high load levels. The maximum and minimum values of the system load are calculated through the pre-defined system load threshold, and the node load area is divided. The node load area is not fixed after division, but changes periodically with the change of the node load. The node load area division process is as follows Figure 3As shown in the figure, the CPU and memory resources of the node are monitored and stored in the database through the resource monitoring system, and then the node load is calculated, and the load area of the cluster is updated periodically. According to the divided load area, the comprehensive evaluation index of all nodes in the load area is calculated, and the scheduling priority list of the TaskManager node is obtained. The node with the highest priority in the scheduling priority list is selected, and all slots of the current TaskManager node and the resource utilization of each slot are obtained. The load priority list of the slot is obtained, and the slot with the highest priority in the load priority list is selected to place the task, as shown in the figure. Figure 4 As shown, tasks are evenly distributed to TaskManager nodes. This distribution method of the method of the present invention can effectively improve the load balancing degree of the cluster.
[0054] Preferably, the initializing the load information of the TaskManager node in the Flink cluster includes: using a polling scheduling strategy to assign tasks to the TaskManager nodes in the Flink cluster and execute them, and initializing the load information of the TaskManager nodes after the scheduling is completed.
[0055] Preferably, the performance of the TaskManager node includes:
[0056]
[0057] ω1+ω2=1
[0058] Where u represents the number of CPU cores of the TaskManager node. represents the CPU utilization of the i-th TaskManager node, ω1 and ω2 represent weight parameters.
[0059] Preferably, the load of the TaskManager node includes:
[0060]
[0061] α+β=1
[0062] in, Indicates the CPU utilization of the i-th TaskManager node, represents the memory utilization of the i-th TaskManager node, and α and β represent weight parameters.
[0063] Preferably, the average load value of the cluster includes:
[0064]
[0065] Preferably, the load offset of the cluster includes:
[0066]
[0067] Preferably, the load weight of the TaskManager node includes:
[0068]
[0069] Preferably, the threshold value of the system load range includes:
[0070]
[0071] Among them, Load max Indicates the maximum value of the cluster load, Load min Indicates the minimum value of cluster load, L(N i ) represents the load of the i-th TaskManager node in the cluster, and n represents the number of slave nodes in the cluster.
[0072] Preferably, the maximum value of the cluster load and the minimum value of the cluster load include:
[0073]
[0074] Another aspect of the present invention provides a two-layer coordinated load balancing scheduling system based on a big data computing framework, the system is applied to a two-layer coordinated load balancing scheduling method based on a big data computing framework, including: a Flink architecture, a load monitoring module and a MySQL database;
[0075] The Flink architecture includes: a JobManager node and multiple TaskManager nodes;
[0076] The load monitoring module is used to calculate the load information of the TaskManager node according to the runtime data of the TaskManager node during the task scheduling execution process, and store the load information of the TaskManager node in the MySQL database to update the load priority list of the TaskManager node.
[0077] Preferably, the method of assigning tasks to the TaskManager node according to the load priority list of the current TaskManager node includes: traversing the task list to be scheduled, selecting the task that needs to be allocated resources, selecting the node with the highest priority in the scheduling priority list, obtaining all the slots of the current TaskManager node and the resource utilization of each slot, obtaining the load priority list of the slot, and selecting the slot with the highest priority in the load priority list to place the task.
[0078] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the present invention can be modified, replaced by equivalents or improved without departing from the purpose and scope of the present technical solution. These modifications or replacements should still fall within the scope of the claims of the present invention.
Claims
1. A two-layer coordinated load balancing scheduling method based on a big data computing framework, characterized in that: include: S1: Initialize the load information of the TaskManager node in the Flink cluster; S2: Generates a set of tasks to be scheduled based on the Flink Job submitted by the client; S3: Calculate the maximum and minimum values of the cluster load and divide the load area according to the node load size; S4: Determine whether the low-load area is empty. If not, calculate the comprehensive evaluation index of all nodes in the current low-load area to obtain the scheduling priority list of the TaskManager node; S5: Calculate the comprehensive evaluation index of all nodes in the current normal load area and obtain the scheduling priority list of TaskManager nodes; S6: traverse the task list to be scheduled, select the task to be allocated resources, determine whether the scheduling priority list of the low-load area is empty, if so, add the nodes in the normal load area to the low-load area, select the node with the highest priority in the scheduling priority list, obtain all the slots of the current TaskManager node and the resource utilization of each slot, obtain the slot load priority list, select the slot with the highest priority in the load priority list to place the task; S7: updating the load information of the selected TaskManager node according to the runtime data of the selected TaskManager node during the task scheduling execution process; Repeat steps S2-S7 to schedule the task.
2. According to the double-layer coordinated load balancing scheduling method based on the big data computing framework of claim 1, it is characterized in that: Initializing the load information of the TaskManager node in the Flink cluster includes: using a polling scheduling strategy to assign tasks to the TaskManager nodes in the Flink cluster and execute them, and initializing the load information of the TaskManager nodes after the scheduling is completed.
3. According to the double-layer coordinated load balancing scheduling method based on the big data computing framework of claim 2, it is characterized in that: The performance of the TaskManager node includes: ω1+ω2=1 Where u represents the number of CPU cores of the TaskManager node. represents the CPU utilization of the i-th TaskManager node, ω1 and ω2 represent weight parameters.
4. According to the double-layer coordinated load balancing scheduling method based on the big data computing framework of claim 3, it is characterized in that: The load of the TaskManager node includes: α+β=1 in, Indicates the CPU utilization of the i-th TaskManager node, represents the memory utilization of the i-th TaskManager node, and α and β represent weight parameters.
5. According to the double-layer coordinated load balancing scheduling method based on the big data computing framework of claim 4, it is characterized in that: The average load value of the cluster includes:
6. According to the double-layer coordinated load balancing scheduling method based on the big data computing framework of claim 5, it is characterized in that: The load offset of the cluster includes:
7. According to claim 6, a double-layer coordinated load balancing scheduling method based on a big data computing framework is characterized in that: The load weight of the TaskManager node includes:
8. According to claim 7, a double-layer coordinated load balancing scheduling method based on a big data computing framework is characterized in that: The thresholds of the system load range include: Among them, Load max Indicates the maximum value of the cluster load, Load min Indicates the minimum value of cluster load, L(N i ) represents the load of the i-th TaskManager node in the cluster, and n represents the number of slave nodes in the cluster.
9. A two-layer coordinated load balancing scheduling method based on a big data computing framework according to claim 8, characterized in that: The range of the maximum value of the cluster load and the minimum value of the cluster load includes:
10. A two-layer coordinated load balancing scheduling system based on a big data computing framework, the system is applied to a two-layer coordinated load balancing scheduling method based on a big data computing framework according to any one of claims 1 to 9, comprising: Flink architecture, load monitoring module and MySQL database; The Flink architecture includes: a JobManager node and multiple TaskManager nodes; The load monitoring module is used to calculate the load information of the TaskManager node according to the runtime data of the TaskManager node during task scheduling and execution, and store the load information of the TaskManager node in the MySQL database to update the load priority list of the TaskManager node.
11. The double-layer coordinated load balancing scheduling method based on the big data computing framework according to claim 10 is characterized in that: The method of allocating tasks to the TaskManager node according to the load priority list of the current TaskManager node includes: traversing the task list to be scheduled, selecting the task that needs to be allocated resources, selecting the node with the highest priority in the scheduling priority list, obtaining all the slots of the current TaskManager node and the resource utilization of each slot, obtaining the load priority list of the slot, and selecting the slot with the highest priority in the load priority list to place the task.
Citation Information
Cited By
FPGA channel simulation-oriented cluster dynamic scheduling method and system and medium
CN119629674A
