Load balancing method suitable for private deployment cluster and related product

Through the combination of periodic load-aware scheduling and rescheduling, the problem of load imbalance in the privatized deployment cluster is solved, business stability is improved and resources is saved, and it is suitable for load balancing of small private cloud clusters.

CN120256149AActive Publication Date: 2025-07-04BEIJING FEISHU TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510749541.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-07-04
Estimated Expiration
2045-06-05

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively balance the load of the privatized deployment cluster while reducing risks, improving business stability and saving resources. Especially in small private cloud clusters, improper load scheduling strategy design can easily lead to abnormal operation of business modules.

Method used

The periodic load-aware scheduling method is adopted, and through combining rescheduling and load-aware scheduling, the load data of nodes and container groups is evaluated, and the container groups with large loads are evicted, and the load balancing in the cluster is redeployed.

Benefits of technology

It effectively avoids the risks brought by minute-level real-time data scheduling, improves business stability, and saves resources, achieving load balancing requirements for small private cloud clusters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256149A_ABST
    Figure CN120256149A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a load balancing method suitable for a private deployment cluster and a related product. The method comprises the following steps: periodically determining a first score of a node based on load data of the node in a cluster, and determining a second score of a container group based on load data of the container group on the node; based on the first score of the node and the second score of the container group on the node, performing eviction processing on the container group on the node; updating the first score of the node in the cluster based on the second score of the expelled container group to obtain a third score of the node in the cluster; and redeploying the evicted container group based on the third scores of the nodes in the cluster. Therefore, rescheduling and load aware scheduling are combined, so that load balance of the privately deployed cluster is realized on the premise of reducing risks, improving service stability and saving resources, and the characteristics of the privately deployed cluster are better adapted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of computer technology, and in particular, to a load balancing method and related products applicable to a privatized deployment cluster. Background Art

[0002] The cloud computing system derived from the container orchestration system Kubernetes supports more and more software deployments, including not only the public cloud system but also small private cloud clusters directly deployed in the customer's computer room. The process of Kubernetes orchestration and scheduling is static, but the changes in microservice loads are dynamic, so inevitably, there is an imbalance in the loads between nodes.

[0003] For privatized deployment clusters such as small private cloud clusters, due to their relatively small scale and relatively fixed number of machines, once traffic is concentrated on a certain machine, the resulting load pressure is greater and more concentrated. Moreover, since privatized deployment clusters generally face a certain business module directly, if the orchestration and scheduling strategy is not properly designed, it is very easy to cause abnormal operation of the business module. Therefore, when orchestrating and scheduling, it is necessary not only to balance the loads of each node in the cluster, but also to avoid the risks brought by scheduling, improve business stability, and reduce resource consumption as much as possible.

[0004] How to achieve load balancing for privatized deployment clusters under the premise of reducing risks, improving business stability, and saving resources, so as to better adapt to the characteristics of privatized deployment clusters, has become an urgent problem to be solved. Summary of the Invention

[0005] The purpose of the embodiments of this specification is to provide a load balancing method and related products applicable to a privatized deployment cluster, so as to achieve load balancing for the privatized deployment cluster under the premise of reducing risks, improving business stability, and saving resources, and better adapt to the characteristics of private cloud clusters by combining rescheduling and load-aware scheduling.

[0006] To achieve the above purpose, the embodiments of this specification adopt the following technical solutions: In a first aspect, a load balancing method applicable to a privatized deployment cluster is provided, including: Periodically determine a first score of the node based on the load data of the nodes in the cluster, and determine a second score of the container group based on the load data of the container groups on the node; Evict the container groups on the node based on the first score of the node and the second score of the container groups on the node; Update the first score of the nodes in the cluster based on the second score of the evicted container groups to obtain a third score of the nodes in the cluster; Based on the third score of the nodes in the cluster, redeploy the evicted container group.

[0007] In a second aspect, a load balancing device applicable to a privatized deployment cluster is provided, including: A first determination module, configured to periodically determine a first score of the node based on the load data of the nodes in the cluster, and determine a second score of the container group based on the load data of the container groups on the node; An eviction module, configured to perform an eviction process on the container groups on the node based on the first score of the node and the second score of the container groups on the node; An update module, configured to update the first score of the nodes in the cluster based on the second score of the evicted container group to obtain a third score of the nodes in the cluster; A deployment module, configured to redeploy the evicted container group based on the third score of the nodes in the cluster.

[0008] In a third aspect, an electronic device is provided, including: A processor; A memory for storing executable instructions of the processor; Wherein, the processor is configured to execute the instructions to implement the load balancing method applicable to the privatized deployment cluster provided in the first aspect.

[0009] In a fourth aspect, a computer-readable storage medium is provided. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the load balancing method applicable to the privatized deployment cluster provided in the first aspect.

[0010] In a fifth aspect, a computer program product is provided. The computer program product includes a non-transitory computer-readable storage medium storing a computer program. The computer program is operable to cause a computer to execute some or all of the steps in the load balancing method applicable to the privatized deployment cluster provided in the first aspect.

[0011] The solution of the embodiment of this specification periodically evaluates the first score of a node based on the load data of the nodes in the cluster to represent the load size of the node, and evaluates the second score of the container group based on the load data of the container group on the node to represent the load size of the container group. Then, based on the first score of the nodes in the cluster and the second score of the container group on the nodes, eviction processing is performed on the container groups on the nodes in the cluster, realizing periodic centralized rescheduling of the cluster, avoiding the risks brought by normal scheduling based on minute-level real-time data during the business peak period, improving business stability, and saving resources compared with normal scheduling based on minute-level real-time data. On this basis, the first score of the nodes in the cluster is updated based on the second score of the evicted container group to obtain the third score of the nodes in the cluster, and based on the third score of the nodes in the cluster, the evicted container group is redeployed, realizing load-aware scheduling of the evicted container group, which is equivalent to briefly enabling load-aware scheduling after rescheduling and combining the two to better balance the load of each node in the cluster and meet the load balancing requirements of privatized deployment clusters such as small private cloud clusters. Brief Description of the Drawings

[0012] The drawings described herein are used to provide a further understanding of this specification, form a part of this specification, and the schematic embodiments and descriptions thereof are used to explain this specification and do not constitute an improper limitation of this specification. In the drawings: Figure 1 It is a schematic diagram of the architecture of a load balancing system applicable to a privatized deployment cluster provided by an embodiment of this specification; Figure 2 It is a schematic diagram of the structure of a rescheduler provided by an embodiment of this specification; Figure 3 It is a schematic diagram of the interaction between an extender and a scheduler provided by an embodiment of this specification; Figure 4 It is a schematic flowchart of a load balancing method applicable to a privatized deployment cluster provided by an embodiment of this specification; Figure 5 It is a schematic flowchart of a container group eviction method provided by an embodiment of this specification; Figure 6 It is a schematic flowchart of a container group deployment method provided by an embodiment of this specification; Figure 7 It is a schematic flowchart of a container group deployment method provided by another embodiment of this specification; Figure 8 It is a schematic diagram of the structure of a load balancing device applicable to a privatized deployment cluster provided by an embodiment of this specification; Figure 9A schematic structural diagram of an electronic device provided for an embodiment of this specification. Detailed implementation manners

[0013] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this document.

[0014] The term "including" and its variants used in this document are open-ended, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description. The term "in response to" is used to indicate the conditions or states on which the operations performed depend. When the dependent conditions or states are met, one or more of the operations performed may be real-time or may have a set delay. Without special instructions, there is no limitation on the order of the multiple operations performed.

[0015] It should be noted that the concepts such as "first" and "second" mentioned in this document are only used to distinguish different devices, modules, or units, and are not used to limit the order of the functions performed by these devices, modules, or units or their interdependent relationships.

[0016] It should be noted that the modifiers such as "one" and "multiple" mentioned in this document are illustrative rather than restrictive. Those skilled in the art should understand that unless clearly stated otherwise in the context, it should be understood as "one or more".

[0017] The names of the messages or information exchanged between multiple devices in the implementation manners of this document are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0018] As mentioned above, currently, the load balancing solutions for Kubernetes are generally provided by cloud providers or the community, and are more designed from the perspective of the cloud provider's base. There are problems such as poor stability and high risks, and it is impossible to better adapt to the characteristics of privatized deployment clusters such as small private cloud clusters.

[0019] The inventors found through a large amount of research that privatized deployment clusters have the following characteristics: (1) Closer to the business. The cluster can refine and provide rules at the microservice dimension and is responsible for the SLA (Service Level Agreement) of the business in terms of responsibilities.

[0020] (2) Relatively small in scale, with more limited resources, concentrated peak periods, and obvious business characteristics. Therefore, more attention needs to be paid to the risks that each scheduling may bring. At the same time, with fixed resources, it is only necessary to balance the loads of each node as much as possible in the long term.

[0021] (3) The nodes within the cluster can adopt virtualized deployment, that is, over-provision virtual machines on physical machines, with each virtual machine being a node, and the cluster and storage components are deployed in a hybrid manner. This requires considering the actual load situation of the underlying physical machines in the virtualized scenario.

[0022] Based on the above findings, from the perspective of reducing risks, under this limitation, considering specific scenarios, embodiments of this specification propose a new load balancing strategy. Periodically evaluate the first score of a node based on the load data of the nodes within the cluster to represent the load size of the node, and evaluate the second score of a container group based on the load data of the container group on the node to represent the load size of the container group. Then, based on the first score of the nodes within the cluster and the second score of the container groups on the nodes, perform eviction processing on the container groups on the nodes within the cluster, realizing periodic centralized rescheduling of the cluster, avoiding the risks brought by minute-level real-time data normalized scheduling during the business peak period, improving business stability, and saving resources compared with minute-level real-time data normalized scheduling. On this basis, update the first score of the nodes within the cluster based on the second score of the evicted container groups to obtain the third score of the nodes within the cluster, and based on the third score of the nodes within the cluster, redeploy the evicted container groups, realizing load-aware scheduling of the evicted container groups, which is equivalent to briefly enabling load-aware scheduling after rescheduling and combining the two to better balance the loads of each node within the cluster and meet the load balancing requirements of privatized deployment clusters such as small private cloud clusters.

[0023] In addition, for the case where the nodes within the privatized deployment cluster adopt virtualized deployment, embodiments of this specification also propose an eviction mechanism for container groups on such nodes. When evicting a container group, not only consider the load situation of each virtual machine serving as a node, but also consider the load situation of the physical machine where each virtual machine is located, so as to not only control the overall load of the physical machines within the cluster within the same water level range as much as possible, but also control the load of the virtual machines below the threshold, better meeting the load balancing requirements in the virtualized deployment environment.

[0024] It should be understood that the load balancing method applicable to the privatized deployment cluster provided in the embodiments of this specification can be executed by an electronic device or software installed in the electronic device. The electronic device here can be a terminal device or a server device.

[0025] Before introducing in detail the load balancing method applicable to the privatized deployment cluster provided in the embodiments of this specification, a brief introduction to the architecture of the load balancing system involved in the embodiments of this specification will be given first. Please refer to Figure 1 , which is a schematic diagram of the architecture of a load balancing system for a cluster provided in an embodiment of this specification. The system includes: an API (Application Programming Interface) server of the cluster, a native scheduler (Scheduler) in the cluster, a descheduler (Descheduler), a scheduler extender (Scheduler Extender), and a monitoring device.

[0026] The API server is responsible for the communication between the various functional modules of the cluster. The scheduler is responsible for monitoring newly created containers that are not specified to be deployed on a suitable node for running.

[0027] The monitoring device is used to monitor the load data of each node in the cluster and the load data of the container groups on the nodes, and store these load data. The monitoring device can include various components or plugins with monitoring, data collection, and storage functions, such as Prometheus, influxdb, etc., and the embodiments of this specification do not limit this.

[0028] The descheduler provides a series of strategies to evict the container groups on the nodes with heavy loads to rebalance the cluster state. The extender interacts with the descheduler and the scheduler, and passes the load conditions of the nodes and the container groups on them obtained by the descheduler to the scheduler, providing a reference for the scheduler so that the scheduler can deploy the container groups to suitable nodes.

[0029] In one implementation, when the API server receives a newly created container group, it sends the container group to the scheduler. The scheduler, based on the preset scheduling policy, deploys these container groups to suitable nodes. The descheduler periodically obtains the load data of the nodes in the cluster and the load data of the container groups on the nodes from the monitoring device, and evaluates the scores of the nodes based on the load data of the nodes, and evaluates the scores of the container groups based on the load data of the container groups. Further, the descheduler determines the first node to be rescheduled and the first container group to be rescheduled on the first node based on the scores of the nodes and the scores of the container groups on the nodes, and requests the scheduler to evict the first container group from the first node through the API server, thereby completing the rescheduling of the nodes in the cluster.

[0030] After determining the first container group, the rescheduler also passes the scores of each node in the cluster and the scores of the container groups on the nodes to the extender, and the extender sorts the nodes according to these scores. In response to the scoring request sent by the scheduler via the webhook method, the extender sends the sorting result to the scheduler, and the scheduler redeploys the first container group to a suitable node to achieve load-aware scheduling of the first container group. In this way, it is equivalent to the rescheduler briefly enabling load-aware scheduling after rescheduling and combining rescheduling with load-aware scheduling to better balance the loads of each node in the cluster and meet the load balancing requirements of privatized deployment clusters such as small private cloud clusters.

[0031] In the embodiments of this specification, the rescheduler can be implemented through a plug-in mechanism. In one implementation, as Figure 2 shown, the rescheduler includes a first eviction plug-in, a balancing plug-in, a rescheduling plug-in, and a second eviction plug-in. The first eviction plug-in preliminarily screens out the nodes in the cluster that can be rescheduled and the container groups on the nodes that can be rescheduled. The balancing plug-in determines the first node to be rescheduled from the preliminarily screened nodes from the perspective of balancing the loads of each node in the cluster as much as possible. The rescheduling plug-in determines the candidate container groups from the container groups on the first node that can be rescheduled. The second eviction plug-in selects the container groups that meet the preset rescheduling conditions from the candidate container groups as the container groups to be evicted, so as to pass through the scheduler.

[0032] The extender can be implemented based on the extension mechanism of the cluster. In one implementation, as Figure 3 shown in (a) below, in addition to including an API server and a scheduler, the cluster can also include a control manager (such as Kube-controlller-manager), a node proxy server (such as Kubelet), a network proxy service (Kube-proxy), etc. The extender communicates with the scheduler using the http (HyperText Transfer Protocol) or https (Hypertext TransferProtocol Secure) method. Specifically, as Figure 3As shown in (b) of the figure, the deployment of the container group by the scheduler includes a filtering stage, a scoring stage, and a binding stage. During these three stages, data interaction can occur between the scheduler and the extender. For example, the scheduler sends a request to the extender to obtain the required information from the extender, and the extender returns a response message to the scheduler, with the information required by the scheduler carried in the response message. Among them, in the filtering stage, the scheduler selects all the nodes in the cluster that meet the deployment requirements of the container groups to be evicted. In the scoring stage, the scheduler scores each candidate node in the candidate node list according to the preset scoring rules. In the binding stage, the scheduler redeploys the evicted container group to the second node.

[0033] Based on the architecture of the load balancing system applicable to the privately deployed cluster introduced above, the load balancing method applicable to the privately deployed cluster provided in the embodiments of this specification will be introduced in detail below with reference to the accompanying drawings.

[0034] Please refer to Figure 4 , which is a schematic flowchart of a load balancing method applicable to a privately deployed cluster provided in an embodiment of this specification. The method includes the following steps: S402, periodically determine the first score of the node based on the load data of the nodes in the cluster, and determine the second score of the container group based on the load data of the container groups on the nodes.

[0035] The cluster may refer to a Kubernetes cluster. Exemplarily, the cluster may be a privately deployed cluster such as a small private cloud Kubernetes cluster. Each node in the cluster may refer to each worker node in the Kubernetes cluster. In the embodiments of this specification, the cluster may adopt a virtualized deployment method or a non-virtualized deployment method. In the non-virtualized deployment method, each node is a physical machine, and in the virtualized deployment method, each node is a virtual machine (Virtual Machine, VM) on a physical machine. Among them, a physical machine refers to an actual hardware device with independent physical resources (such as CPU, memory, etc.). A virtual machine refers to a logical computer simulated on a physical machine through virtualization technology, sharing the resources of the physical machine. There can be multiple virtual machines on a physical machine.

[0036] For each node in the cluster, the load data of the node reflects the resource usage and performance of the node, and may include, but is not limited to, load data in multiple dimensions such as the CPU (Central Processing Unit) load data, memory load data, disk I / O (Input / Output) load data, and network load data of the node. The CPU load data may include, but is not limited to, CPU usage rate, number of CPU cores, CPU waiting time, etc. The memory load data may include, but is not limited to, memory usage rate, memory allocation / release rate, cache hit rate, etc. The disk I / O load data may, for example, include, but is not limited to, disk read / write rate, IOPS (Input / Output Operations Per Second), disk waiting time, etc. The network load data may, for example, include, but is not limited to, network bandwidth usage rate, packet loss rate, network latency, etc.

[0037] After obtaining the load data of each node, for each node, by analyzing the load data of the node, a first score of the node can be obtained. The first score of the node reflects the load size of the node. The larger the first score, the greater the load of the node. In one implementation, the load data of the node in each dimension is weighted and averaged to obtain the first score of the node, denoted as score = sum(weight × resource percent) / sum(weight), where resource percent represents the load data in each dimension, and weight represents the weight corresponding to each dimension. Among them, the weight of each dimension can be set according to actual needs, and the embodiments of this specification do not limit this. For example, assume that the CPU usage rate of the node is 80%, the weight corresponding to the CPU usage rate is 0.5, the memory usage rate is 70%, the weight corresponding to the memory usage rate is 0.4, the network bandwidth usage rate is 60%, and the weight corresponding to the network bandwidth usage rate is 0.1. Then the first score of the node = (80% × 0.5 + 70% × 0.4 + 60% × 0.1) / 1 = 0.74.

[0038] A container group includes at least one container. A container group can refer to a Pod in a Kubernetes cluster. A Pod is the smallest deployable computing unit created and managed by Kubernetes. A Pod consists of at least one container, and these containers share storage, network, and the declarations of how to run these containers. At least one container group is deployed on a node, and these container groups are orchestrated and scheduled by the Scheduler of the cluster. Each container group has corresponding load data. The load data of a container group reflects the resource usage and performance of the container group, and can include, but is not limited to, load data in multiple dimensions such as CPU load data, memory load data, disk I / O load data, and network load data of the container group.

[0039] After obtaining the load data of each container group, for each container group, by analyzing the load data of the container group, a second score of the container group can be obtained. The second score of the container group reflects the load size of the container group. The larger the second score, the greater the load of the container group. In one implementation, weighted average processing is performed on the load data of each dimension of the container group to obtain the second score of the container group. The specific implementation method for determining the second score of the container group is similar to the specific implementation method for determining the first score of the first node, and will not be elaborated here.

[0040] In the application, the load data of the node and the load data of the container groups on the node can be queried from the monitoring device. Exemplarily, the rescheduler periodically queries, according to a preset period, the load data of each node in the cluster in the previous period, and the load data of the container groups on each node in the previous period from the monitoring system. Then, for the load data of each dimension of each node, the percentile values such as P99 and P98 of the load data of this dimension are calculated to obtain the final load data of this dimension; further, according to the final load data of the node in all dimensions, the first score of the node is determined. Similarly, for the load data of each dimension of each container group, the percentile values such as P99 and P98 of the load data of this dimension are calculated to obtain the final load data of this dimension; further, according to the final load data of the container group in all dimensions, the second score of the container group is determined. Among them, P99 refers to the percentile value such that 99% or less of the load data in the previous period is less than or equal to it, and P98 refers to the percentile value such that 98% or less of the load data in the previous period is less than or equal to it. Thus, the influence of outliers in the load data on the score estimation can be avoided, thereby improving the accuracy of the estimation of the first score of each node and the second score of the container groups on the node.

[0041] In addition, considering that the resources of the privatized deployment cluster are limited and it generally faces business modules directly, real-time rescheduling at the minute level not only consumes a large amount of resources and puts pressure on the cluster, but may also bring risks during the high-risk period of the business, affecting business stability. Therefore, the cycle duration can be set to a relatively long value, and the timing point can be set during non-peak business hours to achieve long-cycle, low-frequency, and low-risk rescheduling. For example, start a rescheduling at 1:11 am every day, that is, execute the above step S402 at 1:11 am every day, and execute the subsequent steps S404 to S408 according to the first score of each node and the second score of the container group on the node. In this way, the risks brought by scheduling during the peak business period can be avoided, business stability can be improved, resources can be saved, and thus the load balancing requirements of the privatized deployment cluster can be better met.

[0042] S404. Based on the first score of the node and the second score of the container group on the node, perform an eviction process on the container group on the node.

[0043] Since the first score of the node reflects the load size of the node, and the second score of the container group on the node reflects the load size of the container group, it is possible to determine the nodes with relatively large loads in the cluster and the container groups with relatively large loads on such nodes based on the first score of the node and the second score of the container group on the node. By evicting such container groups from the nodes where they are located, these container groups can be redeployed to other nodes with relatively small loads, achieving a load balancing effect among different nodes in the cluster, thereby reducing the load pressure on high-load nodes and increasing the resource utilization rate of low-load nodes.

[0044] In the first implementation manner, the above S404 includes the following steps: First, determine the nodes in the cluster with a first score greater than the first threshold as the first nodes to be rescheduled; then, determine the container groups on the first nodes with a second score greater than the third threshold as the first container groups to be rescheduled; further, evict the first container groups from the first nodes.

[0045] Considering that the above method of directly screening and evicting nodes and container groups in the cluster based on thresholds is relatively crude, ignoring the load type and dynamics of the cluster operation, it may cause key container groups to be wrongly evicted, thereby affecting business stability and availability. Therefore, in the second implementation manner, the above 404 includes the following steps: S4041. Sort the nodes in the cluster in descending order of the first score to obtain the first priority queue.

[0046] S4042. Traverse the first priority queue.

[0047] Since the nodes with high first scores are located at the front positions in the first priority queue, high-load nodes are traversed first.

[0048] S4043, in the case of traversing each node in the first priority queue, if the first score of the node is greater than or equal to the first threshold, the node is determined as the first node to be rescheduled.

[0049] S4044, based on the second score of the container group on the first node and the difference between the first score of the first node and the first threshold, perform an eviction process on the container group on the first node.

[0050] As an example, first, determine the difference between the first score of the first node and the first threshold as the eviction margin of the first node; then, from the container groups on the first node, determine the container groups with a first score greater than the eviction margin of the first node as the first container groups to be rescheduled, and then evict the first container groups from the first node; if the second scores of all the container groups on the first node are less than the eviction margin of the first node, select at least two container groups with the sum of the second scores greater than the eviction margin as the first container groups to be rescheduled, and then evict the first container groups from the first node.

[0051] For example, assume that there are m nodes in the cluster, where m is an integer greater than 1. Sort these nodes in descending order of the first score to obtain the first priority queue as shown. Figure 5 When traversing the first priority queue, when traversing to node 1, the first score of node 1 is 74%, which is greater than the first threshold of 50%, so node 1 is determined as the first node. Assume that p container groups are deployed on the first node, denoted as container group 1 to container group p, where p is an integer greater than 1. Assume that the first score of the first node is 74% and the first threshold is 50%. Then, the eviction margin of the first node is 74% - 50% = 24%. Assume that only the second score of container group 1 is greater than 24%, then container group 1 is evicted from the first node. At this time, the container groups on the first node include container group 2 to container group p. Assume that the second scores of container group 1 to container group p are all less than 24%, but the sum of the second scores of container group 1 and container group p is greater than 24% and is smaller than the sum of the second scores of other container groups, then container group 1 and container group p are evicted from the first node. At this time, the container groups on the first node include container group 2 to container group p - 1. Continue to traverse the next node in the first priority queue and repeat the above operations.

[0052] As another example, sort the container groups on the first node in descending order of the second score to obtain the third priority queue; traverse the third priority queue; in the case of traversing each container group in the third priority queue, if the container group meets the preset rescheduling condition, evict the container group from the first node.

[0053] Among them, the rescheduling conditions can be set according to actual requirements, and the embodiments of this specification do not limit this. For example, the rescheduling conditions may include at least one of the following conditions: the evicted container group is not in the blacklist, the evicted container group is in the white list, the resource requirement (Resource Request) of the evicted container group is less than the requirement threshold, the second score of the evicted container group is less than the evictable margin of the node where it is located, the number of evicted container groups is less than the quantity threshold, the number of available container groups on the node where the container group to be evicted is located is greater than 1, etc. The blacklist is used to record container groups that are not allowed to be evicted, such as container groups that will cause system failures after being evicted, container groups that will cause an increase in the load of other nodes after being evicted, etc. The white list is used to record container groups that are allowed to be evicted, such as container groups that will not cause system failures after being evicted, container groups that will not cause an increase in the load of other nodes after being evicted, etc.

[0054] As Figure 5 shown, there are p container groups deployed on the first node. These container groups are sorted in descending order of the second score to obtain the third priority queue as Figure 5 shown. Traverse the third priority queue. When traversing each container group, determine whether the container group is in the blacklist. If not, continue to traverse the next container group; if so, determine whether the resource requirement of the currently traversed container group is less than the pre-set requirement threshold. If the resource requirement of the container group is greater than or equal to the requirement threshold, continue to traverse the next container group; if the resource requirement of the container group is less than the requirement threshold, determine whether the second score of the container group is less than the evictable margin of the first node. If the second score of the container group is greater than or equal to the evictable margin, continue to traverse the next container group; if the second score of the currently traversed container group is less than the evictable margin, determine whether the number of currently evicted container groups is less than the preset quantity threshold. If the number of currently evicted container groups is greater than or equal to the quantity threshold, stop traversing the third priority queue; if the number of currently evicted container groups is less than the quantity threshold, determine whether the number of available container groups on the first node is greater than 1. If not, stop traversing the third priority queue; if the number of available container groups on the first node is greater than 1, call the API server to evict the currently traversed container group from the first node.

[0055] By evicting the container groups on the nodes in the cluster in the above manner, fine-grained adjustment of the load of the nodes in the cluster can be achieved, and risks caused by evicting the container groups can be avoided, such as affecting the stability and availability of the system, causing an increase in the load of other nodes, etc.

[0056] In the third implementation, considering that in the case of virtualized deployment in the cluster, the nodes are virtual machines on physical machines. In this situation, if node eviction is only implemented based on the first score of the nodes and the second score of the container groups on the nodes, it may still cause the physical machine where the node is located to be overloaded, affecting the load balance among the physical machines in the cluster. Therefore, the above second implementation is improved. For a cluster with virtualized deployment, the scores of the two-layer structure of the physical machine and the virtual machine are calculated, abstracted into two-layer priority queues, and the process of node eviction is as follows: first, pop out the physical machine with high load, and then pop out the relatively high-load virtual machine (i.e., the node) on the high-load physical machine. According to the load size of the container groups on such virtual machines, select appropriate container groups for eviction processing to control the overall load of the physical machine within the same water level range as much as possible, and control the load of the virtual machine below the threshold, so as to allocate limited resources to the high-load physical machines.

[0057] Specifically, before the above S4041, it further includes: if the nodes in the cluster are virtual machines on physical machines, then based on the load data of the physical machines in the cluster, determine the fourth score of the physical machines in the cluster; sort the physical machines in the cluster in descending order of the fourth score to obtain the second priority queue; traverse the second priority queue; in the case of each physical machine traversed in the second priority queue, if the fourth score of the physical machine is greater than or equal to the second threshold, then determine the physical machine as the first physical machine to be rescheduled. Correspondingly, in the above S4041, sort the nodes on the first physical machine in descending order of the first score to obtain the first priority queue corresponding to the first physical machine.

[0058] Among them, the load data of the physical machine reflects the resource usage and performance of the physical machine, and may include, but is not limited to, load data in multiple dimensions such as the CPU load data, memory load data, disk I / O load data, and network data of the physical machine. After obtaining the load data of each physical machine, for each physical machine, by analyzing the load data of the physical machine, the fourth score of the physical machine can be obtained. The fourth score reflects the load size of the physical machine. The larger the fourth score, the greater the load of the physical machine.

[0059] It should be noted that the specific implementation method for determining the fourth score of the physical machine is similar to the specific implementation method for determining the first score of the first node, and will not be elaborated here. Secondly, the load data of the physical machine can be queried from the monitoring device. In addition, the second threshold can be smaller than the first threshold.

[0060] For example, as Figure 5 shown, the first cluster contains n physical machines, where n is an integer greater than 1. Sort these physical machines in descending order of the fourth score to obtain as Figure 5The second priority queue shown, and traverses the second priority queue.

[0061] When traversing to physical machine 1, if the fourth score of physical machine 1 is less than or equal to the second threshold, it means that the load of physical machine 1 is not high, and there is no need to implement container group eviction for the nodes on physical machine 1, and then continue to traverse the next physical machine. If the fourth score of physical machine 1 is greater than the second threshold, it means that the load of physical machine 1 is too high, and physical machine 1 is determined as the first physical machine to be rescheduled; further, the nodes (i.e., virtual machines) on physical machine 1 are sorted in order from high to low according to the first score, and the first priority queue corresponding to physical machine 1 is obtained, and the above S4042 to S4044 are executed to complete the container group eviction processing of the nodes on physical machine 1.

[0062] Then, continue to traverse the next physical machine and repeat the above operations.

[0063] As a result, the overall load of the physical machines in the cluster is controlled within the same waterline range as much as possible, and the load of the virtual machine is also controlled below the first threshold.

[0064] For the third implementation method mentioned above, after each traversal to a node in the first priority queue corresponding to the first physical machine, and after determining the node as the first node to be rescheduled, and evicting the container group on the first node, it also includes: updating the fourth score of the first physical machine based on the first score of the first node to obtain the fifth score of the first physical machine; if the fifth score of the first physical machine is less than the second threshold, stopping traversal of the first priority queue corresponding to the first physical machine.

[0065] For example, continue with Figure 5 Taking the first priority queue and the second priority queue shown as an example, physical machine 1 in the first priority queue is traversed and determined as the first physical machine, and the fourth score of physical machine 1 is 90%; in the process of traversing the first priority queue corresponding to the first physical machine, if node 1 is currently traversed and node 1 is determined as the first node, and the first score of the first node is 70%, then the first score of the first node is deducted from the fourth score of physical machine 1, and the fifth score of physical machine 1 is 20%. Since the fifth score is less than the second threshold of 50%, it means that the load of physical machine 1 is not high, and there is no need to implement container group expulsion for other nodes on physical machine 1, then stop traversing the first priority queue corresponding to physical machine 1, and continue to traverse the next physical machine 2 in the second priority queue.

[0066] In this way, the limited resources of the cluster can be allocated to high-load physical machines, thereby achieving optimal utilization of the cluster resources.

[0067] For the above-mentioned third implementation method, after updating the fourth score of the first physical machine based on the first score of the first node to obtain the fifth score of the first physical machine, the following steps may further be included: Adjust the order of the physical machines in the second priority queue based on the fifth score of the first physical machine. For example, press the first physical machine into a suitable position in the second priority queue again in the order from high score to low score.

[0068] In this way, the dynamic adjustment of the rescheduling order of the physical machines in the cluster can be realized, ensuring that the physical machines with higher loads are preferentially rescheduled, so as to ensure that the limited resources of the cluster are allocated to the physical machines with high loads, and the further optimized utilization of the resources of the cluster is realized.

[0069] The above shows some implementation methods of the above S404. Of course, it should be understood that the above S404 can also be implemented in other ways, and the embodiments of this specification do not limit this.

[0070] S406: Update the first score of the nodes in the cluster based on the second score of the evicted container group to obtain the third score of the nodes in the cluster.

[0071] In one implementation method, after completing the eviction process of the container groups on all nodes in the cluster, for each node, if there is an evicted container group on the node, update the first score of the node based on the second score of the container group to obtain the third score of the node. For example, deduct the second score of the container group from the first score of the node.

[0072] In another implementation method, in the case where the second implementation method is adopted in S404 to perform the eviction process on the container groups on the nodes in the cluster, the above S406 includes: after the above S4044, update the first score of the first node based on the second score of the evicted container group on the first node to obtain the third score of the first node. For example, deduct the second score of the evicted container group from the first score of the first node to obtain the third score of the first node.

[0073] Further, after S406, the following may further be included: when the third score of the first node is less than the first threshold, stop traversing the third priority queue; adjust the order of the nodes in the first priority queue based on the third score of the first node.

[0074] In the case where the third score of the first node is less than the first threshold, it means that the load of the first node has been controlled below the threshold, and there is no need to perform container group eviction processing on the first node, which can achieve the effect of saving the resources of the cluster. In addition, the order of the nodes in the first priority queue is adjusted based on the third score of the first node, which can realize the dynamic adjustment of the rescheduling order of the nodes in the cluster, ensure that the nodes with higher loads are rescheduled first, so as to ensure that the limited resources of the cluster are allocated to the high-load nodes, and realize the further optimized utilization of the resources of the cluster.

[0075] The above shows some implementation manners of the above S406. Of course, it should be understood that the above S406 can also be implemented in other ways, and the embodiments of this specification do not limit this.

[0076] S408, redeploy the evicted container groups based on the third scores of the nodes in the cluster.

[0077] In one implementation manner, the above S408 includes the following steps: Select a node with a smaller third score from the other nodes in the cluster except the node where the evicted container originally located as the second node for deploying the evicted container group, and then deploy the evicted container group on the second node.

[0078] Considering that in the case of a large number of evicted container groups, after redeploying the evicted container groups through the above implementation manner, the loads of the nodes in the cluster may become unbalanced. For this reason, in another implementation manner, the above S408 includes the following steps: S4081, sort the nodes in the cluster in descending order of the third score to obtain a fourth priority queue; S4082, determine the second node for deploying the evicted container group from the cluster based on the fourth priority queue; S4083, deploy the evicted container group to the second node.

[0079] Specifically, the rescheduler passes the third scores of each node in the cluster to the extender, and the extender sorts each node in the cluster to obtain a fourth priority queue, and sends the fourth priority queue to the native scheduler of the cluster. The scheduler combines the default static scheduling policy and the fourth priority queue to determine the second node from the cluster, and then the scheduler deploys the evicted container group to the second node. In this way, it is equivalent to the rescheduler starting the load awareness function, and indirectly passing the scores of the nodes evaluated according to the load data and the scores of the container groups on the nodes to the native scheduler in the cluster for scheduling through the extender, so as to realize the load awareness scheduling of the evicted container groups.

[0080] Figure 6The scheduling logic of the scheduler is shown, which includes three stages: filtering, scoring, and binding. In the filtering stage, the scheduler selects all the nodes in the cluster that meet the deployment requirements of the evicted container groups. For example, it selects the nodes whose available resource amount meets the resource demand of the evicted container groups, obtaining a list of candidate nodes, and this list contains all schedulable candidate nodes.

[0081] In the scoring stage, the scheduler scores each candidate node in the list of candidate nodes according to the preset scoring rules. For example, it combines strategies such as the minimum request first strategy, the affinity first strategy, the load awareness strategy, etc., and the weights corresponding to each strategy to determine the score of each candidate node. Among them, the minimum request first strategy means that the node with fewer minimum requests has a higher priority; the affinity first strategy means that if there is an affinity between the container groups currently deployed on the node and the evicted container groups, the node has a higher priority; the load awareness strategy means that the priority of the node is determined according to the fourth priority queue sent by the extender. For example, the priority of a certain node is 2 under the minimum request first strategy, 1 under the affinity first strategy, and 1 under the load awareness strategy, and the weight of the minimum request first strategy is 1, the weight of the affinity first strategy is 1, and the priority of the load awareness first strategy is 100. Then the final score of this node = (2 + 1 + 1) / (1 + 1 + 100) = 0.039.

[0082] Furthermore, based on the scores of each node, the scheduler selects a most suitable node for the evicted container group as the second node. For example, it selects the node with the highest score as the second node. If there are multiple nodes with the highest score, the scheduler randomly selects one of them as the second node.

[0083] In the binding stage, the scheduler redeploys the evicted container group to the second node.

[0084] Thus, the redeployment of the evicted container group is achieved.

[0085] In another embodiment, after the above S4083, the following steps may further be included: in response to monitoring that the deployment of the evicted container group is successful, based on the second score of the evicted container group, update the third score of the nodes in the cluster to obtain the sixth score of the nodes in the cluster; based on the sixth score of the nodes in the cluster, adjust the order of the nodes in the fourth priority queue.

[0086] Specifically, if the second node is a physical machine, update the third score of the second node based on the second score of the evicted container group to obtain the sixth score of the second node. For example, increase the second score of the evicted container group on the basis of the third score of the second node to obtain the sixth score of the second node.

[0087] If the second node is a virtual machine, based on the second score of the evicted container group, update the third score of the second node and the third scores of other nodes on the same physical machine as the second node to obtain the sixth score of the second node and the sixth scores of other nodes. For example, assume that after container group 1 is evicted from node 1 and redeployed to node 2, and nodes 2, 3, and 4 are distributed on the physical machine where node 2 is located. Then, increase the second score of container group 1 on the basis of the third score of node 2 to obtain the sixth score of node 2. In addition, increase the second score of container group 1 on the basis of the third score of node 3 to obtain the sixth score of node 3, and increase the second score of container group 4 on the basis of the third score of node 4 to obtain the sixth score of node 4. It can be understood that the object that undertakes the load in the cluster is the physical machine. After redeploying the evicted container group to a certain node, it is equivalent to adding the container to the physical machine where the node is located. Based on this, by updating the second scores of all nodes on the physical machine where the node is located, the load situation of the physical machine can be reflected on the node. Otherwise, when scheduling the next container group, it may occur that the load of the physical machine is large, but the load of a certain node on the physical machine is small and a new container group is deployed, resulting in a serious overload of the physical machine.

[0088] Further, adjust the order of the nodes in the fourth priority queue according to the latest scores of the nodes in the cluster from high to low, so as to provide reliable data support for the scheduling of the next container group.

[0089] The above shows some implementation manners of the above S408. Of course, it should be understood that the above S408 can also be implemented in other ways, and the embodiments of this specification do not limit this.

[0090] To facilitate the understanding of the load balancing method applicable to the privatized deployment cluster provided in the above embodiments of this specification, the following combination of Figure 7 When the rescheduler receives the start scheduling request, it periodically obtains the load data of the nodes in the cluster and the load data of the container groups on the nodes from the monitoring device, evaluates the scores of the nodes based on the load data of the nodes, evaluates the scores of the container groups based on the load data of the container groups, and writes the scores of the nodes and the scores of the container groups into the cache. Further, the rescheduler also performs an eviction process on the container groups on the nodes based on the scores of the nodes and the scores of the container groups, and briefly turns on the load awareness switch and maintains it for a preset time duration.

[0091] After receiving the scoring request from the native scheduler within the cluster, the extender traverses the node list of the cluster. For each node traversed in the node list, the extender obtains the score of the node and the score of the container group on the node. Then, based on the scores of all nodes in the node list, the extender sorts these nodes and returns the sorting result to the scheduler, which is equivalent to passing the load awareness result of the scheduler to the scheduler, and the scheduler redeploys the evicted container group. If the extender fails to obtain the score of a certain node or the score of the container group on the node, the preset exception fallback processing strategy is enabled to generate the score of the node or the score of the container group.

[0092] In one implementation, the process by which the extender obtains the score of the node and the score of the container group on the node is as follows: for each node in the node list, the extender obtains the score of the node and the score of the container group on the node from the cache; if the original container group on the node is evicted, the score of the node is further updated based on the score of the evicted container group, and through the built-in listening mechanism, it is listened whether the evicted container group is redeployed. If so, the score of the node where the evicted container group is currently located is updated based on the score of the evicted container group, and when the node where the evicted container group is currently located is a virtual machine, the scores of other nodes on the same physical machine as the node are also updated.

[0093] The load balancing method applicable to the privatized deployment cluster provided by the embodiments of this specification periodically evaluates the first score of the nodes based on the load data of the nodes within the cluster to represent the load size of the nodes, and evaluates the second score of the container groups based on the load data of the container groups on the nodes to represent the load size of the container groups. Then, based on the first score of the nodes within the cluster and the second score of the container groups on the nodes, the eviction processing of the container groups on the nodes within the cluster is performed to achieve the periodic centralized rescheduling of the cluster, avoid the risks brought by the normal scheduling based on minute-level real-time data during the business peak period, improve the business stability, and compared with the normal scheduling based on minute-level real-time data, resources can be saved. On this basis, the first score of the nodes within the cluster is updated based on the second score of the evicted container groups to obtain the third score of the nodes within the cluster, and based on the third score of the nodes within the cluster, the evicted container groups are redeployed to achieve the load awareness scheduling of the first container group, which is equivalent to briefly enabling the load awareness scheduling after the rescheduling and combining the two to better balance the load of each node within the cluster and meet the load balancing requirements of privatized deployment clusters such as small private cloud clusters.

[0094] In addition, corresponding to the Figure 4 load balancing method applicable to the privatized deployment cluster shown above, the embodiments of this specification further provide a load balancing device applicable to the privatized deployment cluster.Figure 8 This is a schematic structural diagram of a load balancing device 800 applicable to a privatized deployment cluster provided by an embodiment of this specification, including: a first determination module 810, an eviction module 820, an update module 830, and a deployment module 840.

[0095] The first determination module 810 is configured to periodically determine a first score of the node based on the load data of the nodes in the cluster, and determine a second score of the container group based on the load data of the container groups on the node.

[0096] The eviction module 820 is configured to perform an eviction process on the container groups on the node based on the first score of the node and the second score of the container groups on the node.

[0097] The update module 830 is configured to update the first score of the nodes in the cluster based on the second score of the evicted container groups to obtain a third score of the nodes in the cluster.

[0098] The deployment module 840 is configured to redeploy the evicted container groups based on the third score of the nodes in the cluster.

[0099] The load balancing device applicable to a privatized deployment cluster provided by an embodiment of this specification periodically evaluates the first score of the nodes based on the load data of the nodes in the cluster to represent the load magnitude of the nodes, and evaluates the second score of the container groups based on the load data of the container groups on the nodes to represent the load magnitude of the container groups. Furthermore, based on the first score of the nodes in the cluster and the second score of the container groups on the nodes, an eviction process is performed on the container groups on the nodes in the cluster, realizing periodic centralized rescheduling of the cluster, avoiding risks brought by minute-level real-time data normalization scheduling during peak business periods, improving business stability, and saving resources compared with minute-level real-time data normalization scheduling. On this basis, the first score of the nodes in the cluster is updated based on the second score of the evicted container groups to obtain the third score of the nodes in the cluster, and the evicted container groups are redeployed based on the third score of the nodes in the cluster, realizing load-aware scheduling of the evicted container groups, equivalent to briefly enabling load-aware scheduling after rescheduling and combining the two, better balancing the load of each node in the cluster and meeting the load balancing requirements of privatized deployment clusters such as small private cloud clusters.

[0100] In another embodiment, the eviction module includes: A first sorting sub-module, configured to sort the nodes in the cluster in descending order of the first score to obtain a first priority queue; A first traversal sub-module, configured to traverse the first priority queue; A first determination sub-module, configured to, when traversing each node in the first priority queue, if the first score of the node is greater than or equal to a first threshold, determine the node as a first node to be rescheduled; An eviction sub-module, configured to perform an eviction process on the container groups on the first node based on the second score of the container groups on the first node and the difference between the first score of the first node and the first threshold.

[0101] In another embodiment, the eviction module further includes: A second determination sub-module, configured to, if the nodes in the cluster are virtual machines on a physical machine, determine a fourth score of the physical machine in the cluster based on the load data of the physical machine in the cluster; A second sorting sub-module, configured to sort the physical machines in the cluster in descending order of the fourth score to obtain a second priority queue; A second traversal sub-module, configured to traverse the second priority queue; A third determination sub-module, configured to, when traversing each physical machine in the second priority queue, if the fourth score of the physical machine is greater than or equal to a second threshold, determine the physical machine as a first physical machine to be rescheduled; The first sorting sub-module, configured to sort the nodes on the first physical machine in descending order of the first score to obtain a first priority queue corresponding to the first physical machine.

[0102] In another embodiment, the eviction module further includes: A first update sub-module, configured to update the fourth score of the first physical machine based on the first score of the first node to obtain a fifth score of the first physical machine; The first traversal sub-module, configured to stop traversing the first priority queue corresponding to the first physical machine if the fifth score of the first physical machine is less than the second threshold.

[0103] In another embodiment, the eviction module further includes: A first adjustment sub-module, configured to adjust the order of the physical machines in the second priority queue based on the fifth score of the first physical machine.

[0104] In another embodiment, the eviction sub-module is configured to: Sort the container groups on the first node in descending order of the second score to obtain a third priority queue; Traverse the third priority queue; In each case where a container group in the third priority queue is traversed, if the container group meets the preset rescheduling condition, the container group is evicted from the first node.

[0105] In another embodiment, the updating module includes: A second updating sub-module, configured to update the first score of the first node based on the second score of the container group evicted from the first node, to obtain the third score of the first node; The eviction sub-module is further configured to stop traversing the third priority queue when the third score of the first node is less than the first threshold; The eviction module further includes: A second adjustment sub-module, configured to adjust the order of the nodes in the first priority queue based on the third score of the first node.

[0106] In another embodiment, the deployment module includes: A third sorting sub-module, configured to sort the nodes in the cluster in descending order of the third score to obtain a fourth priority queue; A fourth determination sub-module, configured to determine a second node for deploying the evicted container group from within the cluster based on the fourth priority queue; A deployment sub-module, configured to deploy the evicted container group to the second node.

[0107] In another embodiment, the deployment module further includes: A third updating sub-module, configured to, in response to monitoring that the deployment of the evicted container group is successful, update the third score of the nodes in the cluster based on the second score of the evicted container group, to obtain the sixth score of the nodes in the cluster; A third adjustment sub-module, configured to adjust the order of the nodes in the fourth priority queue based on the sixth score of the nodes in the cluster.

[0108] In another embodiment, the third updating sub-module is configured to: If the second node is a physical machine, update the third score of the second node based on the second score of the evicted container group, to obtain the sixth score of the second node; If the second node is a virtual machine, update the third score of the second node and the third scores of other nodes on the same physical machine as the second node based on the second score of the evicted container group, to obtain the sixth score of the second node and the sixth scores of the other nodes.

[0109] Obviously, the load balancing device applicable to the privatized deployment cluster in the embodiments of this specification can serve as the execution subject of the load balancing method applicable to the privatized deployment cluster as described above Figure 4 shown, and thus can implement the functions achieved by the load balancing method applicable to the privatized deployment cluster Figure 4 . Since the principles are the same, they will not be elaborated here.

[0110] Figure 9 FIG. is a schematic structural diagram of an electronic device provided by an embodiment of this specification. Please refer to Figure 9 . At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory, such as at least one disk memory, etc. Of course, the electronic device may also include other hardware required for other services.

[0111] The processor, network interface, and memory can be interconnected through an internal bus, and the internal bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 9 only a bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0112] The memory is used to store programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.

[0113] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, and forms a load balancing device applicable to the privatized deployment cluster at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations: Periodically determine the first score of the node based on the load data of the nodes in the cluster, and determine the second score of the container group based on the load data of the container groups on the node; Evict the container group on the node based on the first score of the node and the second score of the container group on the node; Update the first score of the nodes in the cluster based on the second score of the evicted container group to obtain the third score of the nodes in the cluster; Based on the third score of the nodes in the cluster, redeploy the evicted container group.

[0114] The above as described in this specification Figure 4 The method executed by the load balancing device applicable to the privatized deployment cluster disclosed in the embodiments shown in this specification can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor or the instructions in software form. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this specification. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of this specification can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by the combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method.

[0115] It should be understood that the electronic device in the embodiments of this specification can implement the functions of the load balancing device applicable to the privatized deployment cluster in Figure 4 the embodiments shown. Since the principles are the same, the embodiments of this specification will not be elaborated here.

[0116] Of course, in addition to the software implementation, the electronic devices described in this specification do not exclude other implementation manners, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, and can also be hardware or logic devices.

[0117] An embodiment of this specification also provides a computer-readable storage medium that stores one or more programs. The one or more programs include instructions that, when executed by an electronic device including multiple application programs, can cause the electronic device to execute Figure 4 the method of the illustrated embodiment, and specifically used to perform the following operations: Periodically determine a first score of the node based on the load data of the nodes in the cluster, and determine a second score of the container group based on the load data of the container groups on the node; Based on the first score of the node and the second score of the container group on the node, perform an eviction process on the container group on the node; Update the first score of the nodes in the cluster based on the second score of the evicted container group to obtain a third score of the nodes in the cluster; Based on the third score of the nodes in the cluster, redeploy the evicted container group.

[0118] An embodiment of this specification also provides a computer program product. The computer program product includes a non-transitory computer-readable storage medium storing a computer program. The computer program is operable to cause a computer to execute some or all of the steps in the load balancing method for a privatized deployment cluster provided by the embodiments of this specification.

[0119] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired results. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0120] In summary, the above are only the preferred embodiments of this specification and are not used to limit the protection scope of this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of this specification shall be included in the protection scope of this specification.

[0121] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0122] Computer-readable media includes both permanent and non-permanent, removable and non-removable media and can be implemented by any method or technology for storing information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transitory media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0123] It should also be noted that the term "comprises," "comprising," or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but also other elements not expressly listed, or elements that are inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the statement "comprising a..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0124] Each embodiment in this specification is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.

Claims

1. A load balancing method applicable to a privatized deployment cluster, characterized in that, Including: Periodically determining a first score of the node based on the load data of the nodes in the cluster, and determining a second score of the container group based on the load data of the container group on the node; Performing an eviction process on the container group on the node based on the first score of the node and the second score of the container group on the node; Updating the first score of the nodes in the cluster based on the second score of the evicted container group to obtain a third score of the nodes in the cluster; Redeploying the evicted container group based on the third score of the nodes in the cluster.

2. The method according to claim 1, characterized in that The performing an eviction process on the container group on the node based on the first score of the node and the second score of the container group on the node includes: Sorting the nodes in the cluster in descending order of the first score to obtain a first priority queue; Traversing the first priority queue; When traversing to a node in the first priority queue, if the first score of the node is greater than or equal to a first threshold, determining the node as a first node to be rescheduled; Performing an eviction process on the container group on the first node based on the second score of the container group on the first node and the difference between the first score of the first node and the first threshold.

3. The method according to claim 2, wherein Before the sorting the nodes in the cluster in descending order of the first score to obtain a first priority queue, it further includes: If the nodes in the cluster are virtual machines on a physical machine, determining a fourth score of the physical machines in the cluster based on the load data of the physical machines in the cluster; Sorting the physical machines in the cluster in descending order of the fourth score to obtain a second priority queue; Traversing the second priority queue; When traversing to a physical machine in the second priority queue, if the fourth score of the physical machine is greater than or equal to a second threshold, determining the physical machine as a first physical machine to be rescheduled; The sorting the nodes in the cluster in descending order of the first score to obtain a first priority queue includes: Sorting the nodes on the first physical machine in descending order of the first score to obtain the first priority queue corresponding to the first physical machine.

4. The method according to claim 3, characterized in that, After traversing to a node in the first priority queue corresponding to the first physical machine, and determining the node as a first node to be rescheduled and performing an eviction process on the container group on the first node, it further includes: Updating the fourth score of the first physical machine based on the first score of the first node to obtain a fifth score of the first physical machine; If the fifth score of the first physical machine is less than the second threshold, stopping traversing the first priority queue corresponding to the first physical machine.

5. The method according to claim 4, wherein After the updating the fourth score of the first physical machine based on the first score of the first node to obtain a fifth score of the first physical machine, it further includes: Adjusting the order of the physical machines in the second priority queue based on the fifth score of the first physical machine.

6. The method according to claim 2, wherein Performing eviction processing on the container groups on the first node based on the second score of the container groups on the first node and the difference between the first score of the first node and the first threshold includes: Sorting the container groups on the first node in descending order of the second score to obtain a third priority queue; Traversing the third priority queue; When traversing each container group in the third priority queue, if the container group meets the preset rescheduling condition, evict the container group from the first node.

7. The method according to claim 6, characterized in that, Updating the first score of the nodes in the cluster based on the second score of the evicted container groups to obtain the third score of the nodes in the cluster, includes: Updating the first score of the first node based on the second score of the evicted container groups on the first node to obtain the third score of the first node; After updating the first score of the first node based on the second score of the evicted container groups on the first node to obtain the third score of the first node, further includes: When the third score of the first node is less than the first threshold, stop traversing the third priority queue; Adjusting the order of the nodes in the first priority queue based on the third score of the first node.

8. The method according to any one of claims 1 to 7, characterized in that Redeploying the evicted container groups based on the third score of the nodes in the cluster, includes: Sorting the nodes in the cluster in descending order of the third score to obtain a fourth priority queue; Based on the fourth priority queue, determining a second node in the cluster for deploying the evicted container groups; Deploying the evicted container groups to the second node.

9. The method according to claim 8, wherein After deploying the evicted container groups to the second node, further includes: In response to monitoring that the deployment of the evicted container groups is successful, updating the third score of the nodes in the cluster based on the second score of the evicted container groups to obtain the sixth score of the nodes in the cluster; Adjusting the order of the nodes in the fourth priority queue based on the sixth score of the nodes in the cluster.

10. The method according to claim 9, characterized in that, Updating the third score of the nodes in the cluster based on the second score of the evicted container groups to obtain the sixth score of the nodes in the cluster, includes: If the second node is a physical machine, updating the third score of the second node based on the second score of the evicted container groups to obtain the sixth score of the second node; If the second node is a virtual machine, updating the third score of the second node and the third scores of other nodes on the same physical machine as the second node based on the second score of the evicted container groups to obtain the sixth score of the second node and the sixth scores of the other nodes.

11. A load balancing device applicable to a privatized deployment cluster, characterized in that, Includes: A first determination module, configured to periodically determine the first score of the nodes based on the load data of the nodes in the cluster, and determine the second score of the container groups based on the load data of the container groups on the nodes; An eviction module, configured to perform an eviction process on a container group on the node based on a first score of the node and a second score of the container group on the node; An update module, configured to update a first score of a node in the cluster based on the second score of the evicted container group to obtain a third score of the node in the cluster; A deployment module, configured to redeploy the evicted container group based on the third score of the node in the cluster.

12. An electronic device, characterized in that, Comprising: A processor; A memory for storing executable instructions of the processor; Wherein, the processor is configured to execute the instructions to implement the load balancing method applicable to a privatized deployment cluster according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the load balancing method applicable to a privatized deployment cluster according to any one of claims 1 to 10.

14. A computer program product, characterized in that, The computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps in the load balancing method applicable to a privatized deployment cluster according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Cluster node load balancing method and device, and computer storage medium

    CN111694633A

  • Kubernetes cluster container group scheduling method and device and medium

    CN112015536A

  • Resource rescheduling method, device, equipment and medium

    CN113032102A

  • Container management cluster container group scheduling optimization method and device and equipment

    CN114020407A

  • Resource scheduling system and method, and computing equipment

    CN114035941A