CN120256149B - Load balancing method suitable for privatized deployment cluster and related products - Google Patents
Load balancing method suitable for privatized deployment cluster and related productsInfo
- Publication number
- CN120256149B CN120256149B CN202510749541.2A CN202510749541A CN120256149B CN 120256149 B CN120256149 B CN 120256149B CN 202510749541 A CN202510749541 A CN 202510749541A CN 120256149 B CN120256149 B CN 120256149B
- Authority
- CN
- China
- Prior art keywords
- node
- score
- cluster
- container group
- physical machine
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/505—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the specification discloses a load balancing method suitable for a privatized deployment cluster and related products. The method comprises the steps of periodically determining a first score of a node based on load data of the node in a cluster, determining a second score of a container group based on load data of the container group on the node, performing eviction processing 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 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, and redeploying the evicted container group based on the third score of the node in the cluster. Therefore, by combining rescheduling with load-aware scheduling, the load balancing of the privately-allocated clusters is realized on the premise of reducing risk, improving service stability and saving resources, so that the characteristics of the privately-allocated clusters are better adapted.
Description
Technical Field
The present document relates to the field of computer technologies, and in particular, to a load balancing method and related products suitable for a privatized deployment cluster.
Background
Cloud computing systems derived based on the containerized orchestration system Kubernetes support more and more software deployments, including not only public cloud systems, but also small private cloud clusters deployed directly to customer premises. The Kubernetes orchestration scheduling process is static, but the change in micro-service load is dynamic, thus inevitably creating an imbalance between the loads of the nodes.
For a privatized deployment cluster such as a small privatized cloud cluster, because the privatized deployment cluster has the characteristics of small relative scale, relatively fixed machine quantity and the like, once traffic is concentrated to a certain machine, the load pressure is larger and more concentrated, and because the privatized deployment cluster is generally directly oriented to a certain service module, if the scheduling strategy is improperly designed, the abnormal operation of the service module is extremely easy to be caused, so that the load of each node in the cluster is required to be balanced when scheduling is performed, the risk caused by scheduling is also required to be avoided, the service stability is improved, and the resource consumption is reduced as much as possible.
How to realize the load balance of the privately-allocated clusters on the premise of reducing the risk, improving the service stability and saving the resources so as to better adapt to the characteristics of the privately-allocated clusters becomes a problem to be solved.
Disclosure of Invention
The embodiment of the specification aims to provide a load balancing method and related products suitable for a privatized deployment cluster, which are used for realizing the load balancing of the privatized deployment cluster on the premise of reducing risk, improving service stability and saving resources by combining rescheduling with load-aware scheduling so as to better adapt to the characteristics of a private cloud cluster.
In order to achieve the above object, the embodiment of the present specification adopts the following technical solutions:
In a first aspect, a load balancing method applicable to a privatized deployment cluster is provided, including:
Periodically determining a first score for a node within a cluster based on load data of the node, and determining a second score for a container group based on 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 scores of the nodes in the cluster based on the second scores of the evicted container groups to obtain third scores of the nodes in the cluster;
And redeploying the evicted container group based on a third score of a node within the cluster.
In a second aspect, a load balancing apparatus suitable for privatized deployment clusters is provided, comprising:
a first determining module configured to periodically determine a first score for a node within a cluster based on load data of the node, and determine a second score for a container group based on load data of the container group on the node;
An eviction module, configured to perform an eviction process on a container group on the node based on the first score of the node and the second score of the container group on the node;
The updating module is used for updating the first scores of the nodes in the cluster based on the second scores of the evicted container groups to obtain third scores of the nodes in the cluster;
and the deployment module is used for redeploying the evicted container group based on a third score of the nodes in the cluster.
In a third aspect, there is provided an electronic device comprising:
A processor;
A memory for storing the processor-executable instructions;
Wherein the processor is configured to execute the instructions to implement a load balancing method applicable to a privately deployed cluster as provided in the first aspect.
In a fourth aspect, a computer readable storage medium is provided, which when executed by a processor of an electronic device, enables the electronic device to perform the load balancing method as provided in the first aspect, suitable for privatized deployment clusters.
In a fifth aspect, there is provided a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps in a load balancing method applicable to privately deployed clusters as provided in the first aspect.
According to the scheme of the embodiment of the specification, the first score of the node is periodically evaluated based on the load data of the node in the cluster to represent the load size of the node, the second score of the container group is evaluated based on the load data of the container group on the node to represent the load size of the container group, and then the container group on the node in the cluster is evicted based on the first score of the node in the cluster and the second score of the container group on the node, so that the periodic centralized rescheduling of the cluster is realized, the risk caused by the normal scheduling of the real-time data based on the minute level in the service peak period is avoided, the service stability is improved, and compared with the normal scheduling of the real-time data based on the minute level, the resource can be saved. On the basis, the first scores of the nodes in the cluster are updated based on the second scores of the evicted container groups, the third scores of the nodes in the cluster are obtained, the evicted container groups are redeployed based on the third scores of the nodes in the cluster, load sensing scheduling of the evicted container groups is achieved, the load sensing scheduling is started briefly after rescheduling, the load sensing scheduling and the load sensing scheduling are combined, the loads of all the nodes in the cluster are balanced better, and the load balancing requirement of the privately deployed clusters such as small private cloud clusters is met.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification, illustrate and explain the exemplary embodiments of the present specification and their description, are not intended to limit the specification unduly. In the drawings:
FIG. 1 is a schematic diagram of an architecture of a load balancing system suitable for privating deployment clusters provided in one embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a rescheduling device according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of interactions between an expander and a scheduler provided by one embodiment of the present description;
FIG. 4 is a flow chart of a load balancing method applicable to a privately deployed cluster according to an embodiment of the present disclosure;
FIG. 5 is a flow chart of a method for evicting a set of containers according to one embodiment of the disclosure;
FIG. 6 is a flow chart of a method for deploying a container group according to one embodiment of the present disclosure;
FIG. 7 is a flow chart of a method for deploying a container group according to another embodiment of the present disclosure;
FIG. 8 is a schematic structural diagram of a load balancing device suitable for a privately deployed cluster according to an embodiment of the present disclosure;
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present specification more apparent, the technical solutions of the present specification will be clearly and completely described below with reference to specific embodiments of the present specification and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present specification. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
The term "comprising" and variations thereof as used in this document is meant to be open ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment," another embodiment "means" at least one additional embodiment, "and" some embodiments "means" at least some embodiments. Related definitions of other terms will be given in the description below. The term "responsive to" is used to indicate a condition or state upon which an operation is performed, and one or more operations performed may be in real-time or with a set delay when the condition or state upon which the operation is dependent is satisfied, and there is no restriction of the order in which the operations are performed without specific explanation.
It should be noted that the terms "first," "second," and the like herein are merely used for distinguishing between different devices, modules, or units and not for limiting the order or interdependence of the functions performed by such devices, modules, or units.
It should be noted that references to "one", "a plurality", etc. in this document are intended to be illustrative rather than limiting, and those skilled in the art will appreciate that "one or more" is intended to be interpreted as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the devices in the present document embodiment are for illustrative purposes only and are not intended to limit the scope of such messages or information.
As described above, the current load balancing scheme for Kubernetes is generally provided by cloud manufacturers or communities, and is designed from the base of the cloud manufacturers, so that the problems of poor stability, high risk and the like exist, and the method cannot be well adapted to the characteristics of the privately deployed clusters such as small-sized private cloud clusters.
The inventor finds that the privately-arranged cluster has the following characteristics through a large number of researches:
(1) Closer to the traffic. Clusters can refine rules that provide micro-service dimensions and are responsible for the business' SLA (SERVICE LEVEL AGREEMENT, service level agreements) in responsibility.
(2) The scale is relatively smaller, the resources are more tense, the peak period is concentrated, and the service characteristics are obvious. For this reason, the risk possibly caused by each scheduling needs to be paid more attention, and the resources are fixed, so long as the load of each node can be balanced as much as possible.
(3) The nodes in the cluster can be deployed in a virtualization way, namely super-division virtual machines on physical machines, each virtual machine is a node, and the cluster and the storage components are deployed in a mixed way. This requires consideration of the actual load situation of the underlying physical machine in the virtualization scenario.
Based on the above findings, the embodiments of the present disclosure, from the perspective of risk reduction, under this limitation, consider a specific scenario, propose a new load balancing policy, periodically evaluate a first score of a node based on load data of the node in the cluster to represent the load size of the node, and evaluate a second score of a container group based on load data of the container group on the node to represent the load size of the container group, and further perform an eviction process on the container group on the node in the cluster based on the first score of the node in the cluster and the second score of the container group on the node, so as to implement periodic centralized rescheduling of the cluster, avoid the risk caused by the scheduling based on the real-time data normalization of the minute level in the service peak period, improve the service stability, and save resources compared with the scheduling based on the real-time data normalization of the minute level. On the basis, the first scores of the nodes in the cluster are updated based on the second scores of the evicted container groups, the third scores of the nodes in the cluster are obtained, the evicted container groups are redeployed based on the third scores of the nodes in the cluster, load sensing scheduling of the evicted container groups is achieved, the load sensing scheduling is started briefly after rescheduling, the load sensing scheduling and the load sensing scheduling are combined, the loads of all the nodes in the cluster are balanced better, and the load balancing requirement of the privately deployed clusters such as small private cloud clusters is met.
In addition, for the situation that the nodes in the privately-arranged cluster adopt a virtualized arrangement mode, the embodiment of the specification also provides a container group expelling mechanism for the nodes, when the container group is expelled, the load condition of each virtual machine serving as the node is considered, and the load condition of the physical machine where each virtual machine is located is considered, so that the whole load of the physical machines in the cluster is controlled within the same water line range as much as possible, the load of the virtual machines is controlled below a threshold value, and the load balance requirement under the virtualized arrangement environment is better met.
It should be understood that the load balancing method applicable to the privately deployed cluster provided in the embodiments of the present disclosure may be executed by an electronic device or software installed in the electronic device. The electronic device may be a terminal device or a server device.
Before describing in detail the load balancing method applicable to the privately deployed cluster provided in the embodiments of the present specification, a brief description is first given of an architecture of the load balancing system related to the embodiments of the present specification. Referring to fig. 1, a schematic diagram of an architecture of a load balancing system of a cluster according to an embodiment of the present disclosure includes an API (Application Programming Interface ) server of the cluster, a native Scheduler (Scheduler) within the cluster, a reschedule (Descheduler), an expander (Scheduler Extender), and a monitoring device.
The API server is responsible for communication between the functional modules of the cluster. The scheduler is responsible for monitoring the deployment of newly created, unspecified nodes to run on the appropriate nodes.
The monitoring device is used for monitoring load data of each node in the cluster and load data of the container group on the node, and storing the load data. The monitoring device may include various components or plug-ins having monitoring, data acquisition and storage functions, such as Prometheus, influxdb, etc., which are not limited in this description.
Rescheduling provides a series of strategies to evict a set of containers on a more heavily loaded node to rebalance the cluster state. The expander interacts with the rescheduler and the scheduler, and transmits the load conditions of the nodes and the container groups on the nodes acquired by the rescheduler to the scheduler, so that references are provided for the scheduler, and the scheduler can deploy the container groups on the proper nodes.
In one implementation, the API server, in response to receiving the newly created container groups, sends the container groups to the scheduler, which deploys the container groups onto the appropriate nodes based on a preset scheduling policy. The rescheduler periodically acquires load data of nodes in the cluster and load data of container groups on the nodes from the monitoring device, 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 rescheduling device determines a first node to reschedule and a first container group to reschedule on the first node based on the node score and the node score, and requests the rescheduling device to expel the first container group from the first node through the API server, thereby completing rescheduling of the nodes in the cluster.
The rescheduler also transmits the scores of the nodes in the cluster and the scores of the container groups on the nodes to the extender after determining the first container group, and the extender sorts the nodes according to the scores. The expander responds to the scoring request sent by the scheduler in the webhook mode, sends the sorting result to the scheduler, and the scheduler redeploys the first container group to a proper node to realize the load sensing scheduling of the first container group, so that the load sensing scheduling is started briefly after the rescheduling, and the rescheduling and the load sensing scheduling are combined to better balance the loads of all nodes in the cluster and meet the load balancing requirement of the privately deployed clusters such as small private cloud clusters.
In the embodiment of the present specification, the rescheduler may be implemented through a plug-in mechanism. In one implementation, as shown in FIG. 2, the reschedule 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 initially screens out nodes in the cluster that can be rescheduled and container groups on the nodes that can be rescheduled. The balancing plugin determines a first node to be rescheduled from the preliminarily screened nodes from the viewpoint of balancing the load of each node in the cluster as much as possible. The rescheduling plug-in determines a candidate container group from among the container groups that can be rescheduled on the first node. And the second eviction plug-in selects a container group meeting the preset heavy-drop scheduling condition from the candidate container groups as a container group to be evicted, so as to pass through the scheduler pair.
The expander may be implemented based on a cluster-based expansion mechanism. In one implementation, as shown in FIG. 3 (a), a cluster may include, in addition to API servers and schedulers, control managers (e.g., kube-controlller-manager), node proxy servers (e.g., kubelet), network proxy services (Kube-proxy), and the like. The expander and the dispatcher communicate in an http (HyperText Transfer Protocol ) or https (Hypertext Transfer Protocol Secure, hypertext transfer security protocol) mode. Specifically, as shown in fig. 3 (b), the deployment of the container set by the scheduler includes a filtering stage, a scoring stage and a binding stage, and in these three stages, data interaction can be performed between the scheduler and the expander, for example, the scheduler sends a request to the expander to obtain the required information from the expander, the expander returns a response message to the scheduler, and the response message carries the information required by the scheduler. Wherein, in the filtering stage, the scheduler selects all nodes in the cluster meeting the deployment requirement of the evicted container group. In the scoring stage, the scheduler scores each candidate node in the candidate node list according to a preset scoring rule. During the binding phase, the scheduler will redeploy the evicted container group onto the second node.
Based on the architecture of the load balancing system applicable to the privately deployed cluster described above, the load balancing method applicable to the privately deployed cluster provided in the embodiments of the present specification is described in detail below with reference to the accompanying drawings.
Referring to fig. 4, a flowchart of a load balancing method suitable for a privately-arranged cluster according to an embodiment of the present disclosure is provided, where the method includes the following steps:
S402, periodically determining a first score of a node based on load data of the nodes in the cluster, and determining a second score of the container group based on load data of the container group on the node.
The cluster may refer to a Kubernetes cluster. Illustratively, the cluster may be a privately deployed cluster such as a small private cloud Kubernetes cluster. Nodes within a cluster may refer to working nodes (workbench nodes) within a Kubernetes cluster. In the embodiment of the present disclosure, the cluster may adopt a virtualized deployment manner or a non-virtualized deployment manner. In the non-virtualized deployment mode, each node is a physical Machine, and in the virtualized deployment mode, each node is a Virtual Machine (VM) on a physical Machine. The physical machine refers to an actual hardware device, and has independent physical resources (such as a CPU, a memory, and the like). The virtual machine is a logical computer simulated on the physical machine through a virtualization technology, and shares the resources of the physical machine. Multiple virtual machines may exist on a single physical machine.
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, CPU (Central Processing Unit ) load data of the node, memory load data, disk I/O (Input/Output) load data, network load data, and other multi-dimensional load data. CPU load data may include, but is not limited to, CPU utilization, CPU core count, CPU latency, and the like. Memory load data may include, but is not limited to, memory usage, memory allocation/release rate, cache hit rate, and the like. Disk I/O payload data may include, for example, but is not limited to, disk read/write rates, IOPS (Input/Output Operations Per Second, input/output operands per second), disk latency, and the like. The network load data may include, for example, but is not limited to, network bandwidth usage, packet loss rate, network delay, and the like.
After obtaining the load data of each node, for each node, the first score of the node may be obtained by analyzing the load data of the node. The first score of a node reflects the load size of the node. The greater the first score, the greater the load on the node. In an implementation manner, weighted average processing is performed on load data of the node in each dimension to obtain a first score of the node, which is denoted as score=sum (weight×resource percentage)/sum (weight), where resource percentage represents load data of each dimension, and weight represents a weight corresponding to each dimension. The weight of each dimension may be set according to actual requirements, which is not limited in the embodiment of the present specification. For example, assuming that the CPU usage rate of a 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, the first score of the node= (80% ×0.5+70% ×0.4+60% ×0.1)/1=0.74.
The set of containers includes at least one container. A container group may refer to a Pod of Kubernetes clusters, pod being the smallest deployable computing unit that Kubernetes create and manage, one Pod consisting of at least one container that shares storage, networks, and declarations of how to run the containers. At least one container group is deployed on the node, and the container group is obtained by scheduling by a Scheduler (Scheduler) of the cluster. Each container group has corresponding load data. The load data of the container group reflects the resource usage and performance of the container group, and may include, but is not limited to, CPU load data, memory load data, disk I/O load data, network load data, and other multi-dimensional load data of the container group.
After the load data of each container group is obtained, a second score of the container group may be obtained by analyzing the load data of the container group for each container group. The second score of the container group reflects the load size of the container group. The larger the second score, the more loaded the group of containers. In one implementation, the weighted average process is performed on the load data of the container group in each dimension to obtain a second score of the container group. The specific implementation of determining the second score of the container group is similar to the specific implementation of determining the first score of the first node, and will not be described in detail herein.
In the application, the load data of the nodes and the load data of the container groups on the nodes can be obtained by inquiring from the monitoring equipment. Illustratively, the rescheduler periodically queries the load data of each node in the cluster in the last period from the monitoring system and the load data of the container group on each node in the last period according to a preset period. And then, calculating percentile values such as P99, P98 and the like of the load data of each dimension aiming at the load data of each node to obtain final load data of the dimension, and further, determining a first score of the node according to the final load data of the node in all dimensions. Similarly, for each dimension of the load data of each container group, the final load data of the dimension is obtained by dispersing the P99, P98 and other percentile positions of the load data of the dimension, and further, the second score of the container group is determined according to the final load data of the container group in all dimensions. Wherein, P99 refers to the percentile value that is less than or equal to 99% of the load data in the previous period, and P98 refers to the percentile value that is less than or equal to 98% of the load data in the previous period. Therefore, the influence of the abnormal value in the load data on the score estimation can be avoided, and the accuracy of the first score of each node and the second score estimation of the container group on the node is improved.
In addition, considering that the resources of the privatized deployment cluster are limited and generally directly face to the service module, the real-time rescheduling of the minute level not only consumes a great amount of resources and causes pressure to the cluster, but also possibly brings risk in a service high risk period and influences service stability. For example, rescheduling is started once every 1:11 a day, i.e., the above-described step S402 is performed every 1:11 a day, and the subsequent steps S404 to S408 are performed according to the first score of each node and the second score of the container group on the node. Therefore, the risk brought by scheduling in the service peak period can be avoided, the service stability is improved, and the resources are saved, so that the load balance requirement of the privately deployed cluster is better met.
S404, performing eviction processing 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.
Because the first score of a node reflects the load size of the node, and the second score of a container group on the node reflects the load size of the container group, the node with larger load in the cluster and the container group with larger load on the node can be determined based on the first score of the node and the second score of the container group on the node, and the container group is ejected from the node so as to be redeployed on other nodes with smaller load, thereby achieving the effect of load balance among different nodes in the cluster, reducing the load pressure of the high-load node and increasing the resource utilization rate of the low-load node.
In a first implementation, the step S404 includes determining a node with a first score greater than a first threshold in the cluster as a first node to be rescheduled, determining a container group with a second score greater than a third threshold on the first node as a first container group to be rescheduled, and further evicting the first container group from the first node.
Considering that the above-mentioned method of screening and performing eviction on nodes and container groups on nodes in the cluster directly according to the threshold value is rough, neglecting the load type and dynamic property of cluster operation, it may cause that the key container groups are misevicted, and further affect the service stability and usability. To this end, in a second implementation, the step 404 includes the steps of:
S4041, ordering the nodes in the cluster according to the order of the first scores from high to low to obtain a first priority queue.
S4042, traversing the first priority queue.
Since the node with the first highest score is located in the first priority queue at a forward position, the high load node is traversed preferentially.
S4043, in the case of traversing to a node in the first priority queue, if the first score of the node is greater than or equal to the first threshold, determining the node as the first node to be rescheduled.
And S4044, 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 value between the first score of the first node and the first threshold.
As one example, a difference between a first score of a first node and a first threshold is determined to be an evictable margin of the first node, then, from among container groups on the first node, a container group with a first score greater than the evictable margin of the first node is determined to be a first container group to be rescheduled, and then the first container group is evicted from the first node, and if second scores of the container groups on the first node are both smaller than the evictable margin of the first node, at least two container groups with a sum of the second scores greater than the evictable margin are selected as the first container group to be rescheduled, and then the first container group is evicted from the first node.
For example, assuming that m nodes are included in the cluster, where m is an integer greater than 1, the nodes are ordered in the order of the first score from high to low, resulting in a first priority queue as shown in fig. 5. Traversing the first priority queue, when traversing to node 1, determining node 1 as a first node if the first score for node 1 is 74% that is greater than a first threshold of 50%. Assuming that p container groups are deployed on the first node, the container groups are marked as container groups 1-container groups p, and p is an integer greater than 1. Assuming that the first score of the first node is 74% and the first threshold is 50%, the eviction margin of the first node is 74% -50% = 24%. Assuming that only the second score of the container set 1 is greater than 24%, the container set 1 is evicted from the first node, and at this time, the container set on the first node includes the container set 2 to the container set p. Assuming that the second scores of the container groups 1-p are less than 24%, but the sum of the second scores of the container groups 1 and the second scores of the container groups p is greater than 24%, and the sum of the second scores of the container groups 1 and the container groups p is smaller than that of the other container groups, the container groups 1 and the container groups p are evicted from the first node, and at this time, the container groups on the first node comprise container groups 2-p-1. The next node of the next first priority queue is traversed continuously and the above operation is repeated.
As another example, the container groups on the first node are ordered in the order of the second score from high to low to obtain a third priority queue, the third priority queue is traversed, and if one container group in the third priority queue is traversed, the container group is evicted from the first node if the container group meets the preset rescheduling condition.
The rescheduling condition may be set according to actual requirements, which is not limited in the embodiment of the present specification. For example, the rescheduling condition may include at least one of a container group being evicted not being in the blacklist, a container group being evicted being in the whitelist, a Resource demand (Resource Request) of the container group being evicted being less than a demand threshold, a second score of the container group being evicted being less than an eviction margin of a node where the container group is located, a number of container groups being evicted being less than a number threshold, a number of container groups being available on the node where the container group being evicted being greater than 1, and so on. The blacklist is used to record container groups that are not allowed to be evicted, such as container groups that may cause a system failure after being evicted, container groups that may cause an increase in load of other nodes after being evicted, and so on. The whitelist is used to record the set of containers that are allowed to be evicted, such as the set of containers that do not cause a system failure after being evicted, the set of containers that do not greatly increase the load of other nodes after being evicted, etc.
As shown in fig. 5, p container groups are deployed on the first node, and the container groups are ordered in the order from high to low according to the second score, so as to obtain a third priority queue as shown in fig. 5. Traversing a third priority queue, judging whether a container group is in a blacklist or not when one container group is traversed, if not, continuing to traverse the next container group, if yes, judging whether the resource demand of the currently traversed container group is smaller than a preset demand threshold, if the resource demand of the container group is larger than or equal to the demand threshold, continuing to traverse the next container group, if the resource demand of the container group is smaller than the demand threshold, judging whether a second score of the container group is smaller than an evictable allowance of a first node, if the second score of the container group is larger than or equal to the evictable allowance, continuing to traverse the next container group, if the second score of the currently traversed container group is smaller than the evictable allowance, judging whether the number of the currently-evicted container group is smaller than the preset number threshold, if the number of the currently-evicted container group is larger than or equal to the demand threshold, stopping traversing the third priority queue, if the number of the currently-driven container group is smaller than the first threshold, and if the number of the currently-driven container group is larger than the first node, and if the first node is larger than the first node is required to be traversed, and if the first node is larger than the first node is required to be driven.
By means of the method, the container group on the nodes in the cluster is subjected to the expelling process, so that the load of the nodes in the cluster can be finely adjusted, and risks caused by expelling the container group, such as influencing the stability and availability of a system, causing load rising of other nodes and the like, are avoided.
In a third implementation manner, considering that the node is a virtual machine on the physical machine in the manner of virtual deployment in the cluster, in this case, if the eviction is implemented only according to the first score of the node and the second score of the container group on the node, the physical machine on which the node is located may still be overloaded, which affects load balance between the physical machines in the cluster. For the cluster adopting the virtualized deployment mode, the scores of the two-layer structures of the physical machine and the virtual machine are calculated and abstracted into two-layer priority queues, and then the process of node eviction is that the physical machine with high load is popped up first, then the virtual machine (namely the node) with relatively high load on the physical machine with high load is popped up, and the proper container group is selected for eviction processing according to the load size of the container group on the virtual machine, so that the whole load of the physical machine is controlled to be in the same water line range as much as possible, the load of the virtual machine is controlled to be below a threshold value, and therefore limited resources are distributed to the physical machine with high load.
Specifically, before S4041, the method further includes determining a fourth score of the physical machines in the cluster based on load data of the physical machines in the cluster if the node in the cluster is a virtual machine on the physical machines, sorting the physical machines in the cluster in order of the fourth score from high to low to obtain a second priority queue, traversing the second priority queue, and determining the physical machine as the first physical machine to be rescheduled if the fourth score of the physical machine is greater than or equal to a second threshold value in a case of traversing to one of the second priority queue. Accordingly, in S4041, the nodes on the first physical machine are ordered according to the order of the first score from high to low, so as to obtain a first priority queue corresponding to the first physical machine.
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, CPU load data, memory load data, disk I/O load data, network data, and other load data of multiple dimensions of the physical machine. After the load data of each physical machine is obtained, the load data of each physical machine is analyzed to obtain a fourth score of the physical machine. The fourth score reflects the load size of the physical machine. The larger the fourth score, the more loaded the physical machine is.
It should be noted that, the specific implementation manner of determining the fourth score of the physical machine is similar to the specific implementation manner of determining the first score of the first node, and will not be described herein. Secondly, the load data of the physical machine can be inquired from the monitoring equipment. In addition, the second threshold may be less than the first threshold.
For example, as shown in fig. 5, the first cluster includes n physical machines, where n is an integer greater than 1, and the physical machines are ordered in the order from high to low according to the fourth score, so as to obtain a second priority queue as shown in fig. 5, and traverse the second priority queue.
When traversing to the physical machine 1, if the fourth score of the physical machine 1 is less than or equal to the second threshold, which means that the load of the physical machine 1 is not high, it is not necessary to perform container group eviction on the nodes on the physical machine 1, and then the next physical machine is continuously traversed. If the fourth score of the physical machine 1 is greater than the second threshold, which means that the load of the physical machine 1 is too high, the physical machine 1 is determined as the first physical machine to be rescheduled, and further, the nodes (i.e. virtual machines) on the physical machine 1 are ordered according to the order from the high score to the low score to obtain a first priority queue corresponding to the physical machine 1, and the above steps S4042 to S4044 are executed to complete the container group eviction processing of the nodes on the physical machine 1.
Then, the next physical machine is continuously traversed, and the above operation is repeated.
Thus, the overall load of the physical machines in the cluster is controlled to be within the same water line range as much as possible, and the load of the virtual machines is also controlled to be below a first threshold value.
For the third implementation manner, after traversing to one node in the first priority queue corresponding to the first physical machine each time, determining the node as the first node to be rescheduled, and performing the eviction processing on the container group on the first node, 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, and stopping traversing the first priority queue corresponding to the first physical machine if the fifth score of the first physical machine is smaller than the second threshold.
For example, taking the first priority queue and the second priority queue shown in fig. 5 as examples, traversing to the physical machine 1 in the first priority queue, determining the physical machine 1 as the first physical machine, and determining the fourth score of the physical machine 1 as 90%, and in the process of traversing the first priority queue corresponding to the first physical machine, if the current traversing to the node 1, determining the node 1 as the first node, and determining the first score of the first node as 70%, deducting the first score of the first node on the basis of the fourth score of the physical machine 1, so as to obtain the fifth score of the physical machine 1 as 20%. Since the fifth score is smaller than the second threshold value of 50%, which means that the load of the physical machine 1 is not high, and it is unnecessary to perform container group eviction on other nodes on the physical machine 1, the traversal of the first priority queue corresponding to the physical machine 1 is stopped, and the traversal of the next physical machine 2 in the second priority queue is continued.
Therefore, the limited resources of the clusters can be distributed to the high-load physical machines, and the optimal utilization of the resources of the clusters is realized.
For the third implementation manner, after updating the fourth score of the first physical machine based on the first score of the first node and obtaining the fifth score of the first physical machine, the method may further include the step of adjusting the order of the physical machines in the second priority queue based on the fifth score of the first physical machine. For example, the first physical machine is re-pressed into place in the second priority queue in order of the score from high to low.
Therefore, the dynamic adjustment of the rescheduling sequence of the physical machines in the cluster can be realized, and the physical machines with higher loads are guaranteed to be preferentially rescheduled, so that the limited resources of the cluster are guaranteed to be distributed to the physical machines with high loads, and the further optimal utilization of the resources of the cluster is realized.
The above shows a partial implementation of S404 described above. Of course, it should be understood that S404 may be implemented in other manners, which are not limited in this embodiment of the present disclosure.
And S406, updating the first scores of the nodes in the cluster based on the second scores of the evicted container groups to obtain third scores of the nodes in the cluster.
In one implementation, after the container group eviction process is completed for all the nodes in the cluster, for each node, if the evicted container group exists on the node, updating the first score of the node based on the second score of the container group, and obtaining a third score of the node. For example, the second score for the container group is deducted based on the first score for the node.
In another implementation, in the case where the second implementation is used to perform the eviction process on the container group on the nodes in the cluster in S404, S406 includes updating the first score of the first node based on the second score of the evicted container group on the first node after S4044, to obtain the third score of the first node. For example, subtracting the second score of the evicted container group based on the first score of the first node results in a third score for the first node.
Further, after S406, the method may further include stopping traversing the third priority queue if the third score of the first node is less than the first threshold, and adjusting an order of nodes in the first priority queue based on the third score of the first node.
Under the condition that the third score of the first node is smaller than the first threshold value, the load of the first node is controlled to be lower than the threshold value, and the container group eviction processing is not needed to be carried out on the first node, so that the effect of saving resources of the cluster can be achieved. In addition, the order of the nodes in the first priority queue is adjusted based on the third score of the first node, so that dynamic adjustment of rescheduling order of the nodes in the cluster can be realized, the nodes with higher loads are guaranteed to be preferentially rescheduled, limited resources of the cluster are guaranteed to be distributed to the nodes with high loads, and further optimal utilization of the resources of the cluster is realized.
The above shows a partial implementation of S406 described above. Of course, it should be understood that S406 may be implemented in other manners, which are not limited in this embodiment of the present disclosure.
And S408, redeploying the evicted container group based on the third score of the nodes in the cluster.
In one implementation, the step S408 includes selecting a node with a smaller third score from other nodes in the cluster except for the node where the evicted container is originally located as a second node for deploying the evicted container group, and further deploying the evicted container group on the second node.
Considering that the load of the nodes in the cluster may be unbalanced after the container groups to be evicted are redeployed by the implementation manner, in another implementation manner, the step S408 includes the steps of ordering the nodes in the cluster from high to low according to the third score to obtain a fourth priority queue, determining a second node for deploying the evicted container groups from the cluster based on the fourth priority queue, and deploying the evicted container groups to the second node, wherein the step S4081.
Specifically, the rescheduler transmits a third score of each node in the cluster to the expander, the expander sorts each node in the cluster to obtain a fourth priority queue, the fourth priority queue is sent to the original scheduler of the cluster, the scheduler combines a default static arrangement strategy and the fourth priority queue to determine a second node from the cluster, and the scheduler deploys the evicted container group to the second node. In this way, the load sensing function is started by the rescheduler, and the node score obtained through load data evaluation and the container group score on the node are indirectly transmitted to the native schedulers in the cluster through the expander to be scheduled, so that the load sensing scheduling of the evicted container group is realized.
Fig. 6 shows the scheduler's scheduling logic, which includes three phases of filtering, scoring, and binding. In the filtering stage, the scheduler selects all nodes meeting the deployment requirement of the evicted container group in the cluster, for example, selects the nodes with the available resource quantity meeting the resource requirement of the evicted container group, and obtains a candidate node list, wherein the candidate node list comprises all schedulable candidate nodes.
In the scoring stage, the scheduler may score each candidate node in the candidate node list according to a preset scoring rule, for example, combine a minimum request priority policy, an affinity priority policy, a load sensing policy and the like with a weight corresponding to each policy, and determine a score of each candidate node. The minimum request priority policy refers to higher priority of the node with smaller minimum request quantity, the affinity priority policy refers to higher priority of the node if affinity exists between the currently deployed container group and the evicted container group on the node, and the load sensing policy refers to determining the priority of the node according to a fourth priority queue sent by the expander. For example, if a node has a priority of 2 under the minimum request priority policy, a priority of 1 under the affinity priority policy, a priority of 1 under the load-aware policy, a weight of 1 under the minimum request priority policy, a weight of 1 under the affinity priority policy, and a priority of 100 under the load-aware priority policy, the final score of the node= (2+1+1)/(1+1+100) =0.039.
Further, the scheduler selects a most suitable node for the evicted container group as the second node based on the score of each node, such as the node with the highest score. If there are multiple nodes with highest scores, the scheduler randomly selects one node from the nodes as the second node.
During the binding phase, the scheduler will redeploy the evicted container group onto the second node.
Thus, redeployment of the evicted container group is achieved.
In another embodiment, after the step S4083, the method may further include the steps of updating the third score of the nodes in the cluster based on the second score of the evicted container group to obtain a sixth score of the nodes in the cluster in response to monitoring that the evicted container group is deployed successfully, and adjusting the order of the nodes in the fourth priority queue based on the sixth score of the nodes in the cluster.
Specifically, if the second node is a physical machine, the third score of the second node is updated based on the second score of the evicted container group, and a sixth score of the second node is obtained. For example, the second score of the evicted container group is increased based on the third score of the second node, resulting in a sixth score of the second node.
And 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 group to obtain a sixth score of the second node and a sixth score of other nodes. For example, assuming that the container group 1 is redeployed to the node 2 after being evicted from the node 1, and the node 2 is distributed with the node 2, the node 3 and the node 4 on the physical machine where the node 2 is located, the second score of the container group 1 is increased on the basis of the third score of the node 2, so as to obtain a sixth score of the node 2. In addition, the second score of the container group 1 is increased based on the third score of the node 3 to obtain a sixth score of the node 3, and the second score of the container group 4 is increased based on the third score of the node 4 to obtain a sixth score of the node 4. It can be understood that the object carrying the load in the cluster is a physical machine, after the container group to be evicted is redeployed on a certain node, the container is added to the physical machine where the node is located, based on this, the load condition of the physical machine can be reflected on the node by updating the second scores of all the nodes on the physical machine where the node is located, otherwise, when the next container group is scheduled, the load of the physical machine is larger, but the load of a certain node on the physical machine is smaller and deployed on a new container group, and the serious overload condition of the physical machine is caused.
Further, the order of the nodes in the fourth priority queue is adjusted according to the order of the latest scores of the nodes in the cluster from high to low, so that reliable data support is provided for the scheduling of the next container group.
The above shows a partial implementation of S408 described above. Of course, it should be understood that S408 may be implemented in other manners, which are not limited in this embodiment of the present disclosure.
In order to facilitate understanding of the load balancing method applicable to the privately deployed cluster provided in the foregoing embodiment of the present disclosure, in connection with fig. 7, the rescheduler periodically obtains load data of nodes in the cluster and load data of container groups on the nodes from the monitoring device in response to the received open scheduling request, 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 further performs an eviction process on the container group on the node based on the node score and the container group score, and briefly turns on the load sensing switch and maintains the preset time period.
After receiving a scoring request of a scheduler in the cluster, the expander traverses a node list of the cluster, and obtains the score of the node and the score of a container group on the node when traversing to one node in the node list, further sorts the nodes according to the scores of all the nodes in the node list, and returns a sorting result to the scheduler, which is equivalent to transmitting a load sensing result of the scheduler to the scheduler, and the scheduler redeploys the evicted container group. If the expander does not acquire the score of a certain node or the score of a container group on the node, a preset abnormal spam processing strategy is started, and the score of the node or the score of the container group is generated.
In one implementation, the process of acquiring the node score and the node container group score by the expander is that the expander acquires the node score and the node container group score from the cache for each node in the node list, updates the node score based on the dislodged container group score if the original container group on the node is dislodged, monitors whether the dislodged container group is redeployed through a built-in monitoring mechanism, updates the node score of the current node of the dislodged container group based on the dislodged container group score if the dislodged container group score is present, and updates the scores of other nodes on the same physical machine as the node if the dislodged container group is present as the virtual machine.
According to the load balancing method suitable for the privately deployed cluster, the first score of the node is periodically estimated based on the load data of the node in the cluster to represent the load size of the node, the second score of the container group is estimated based on the load data of the container group on the node to represent the load size of the container group, and then the container group on the node in the cluster is evicted based on the first score of the node in the cluster and the second score of the container group on the node, so that the periodic centralized rescheduling of the cluster is realized, the risk caused by the real-time data normalization scheduling based on the minute level in the service peak period is avoided, the service stability is improved, and compared with the real-time data normalization scheduling based on the minute level, the resource can be saved. On the basis, the first scores of the nodes in the cluster are updated based on the second scores of the evicted container groups, the third scores of the nodes in the cluster are obtained, and the evicted container groups are redeployed based on the third scores of the nodes in the cluster, so that the load sensing scheduling of the first container groups is realized, which is equivalent to briefly starting the load sensing scheduling after the rescheduling, and the load sensing scheduling is combined with the load sensing scheduling, the loads of all the nodes in the cluster are balanced better, and the load balancing requirement of the privately deployed clusters such as small-sized private cloud clusters is met.
In addition, corresponding to the load balancing method applicable to the privately-arranged clusters shown in fig. 4, the embodiment of the present disclosure further provides a load balancing device applicable to the privately-arranged clusters. Fig. 8 is a schematic structural diagram of a load balancing apparatus 800 suitable for a privately deployed cluster according to an embodiment of the present disclosure, including a first determining module 810, an eviction module 820, an updating module 830, and a deployment module 840.
The first determining module 810 is configured to periodically determine a first score for a node within a cluster based on load data of the node, and determine a second score for a container group based on load data of the container group on the node.
The eviction module 820 is configured to perform an eviction process on a container group on the node based on the first score of the node and the second score of the container group on the node.
The updating module 830 is configured to update the first score of the node in the cluster based on the second score of the evicted container group, and obtain a third score of the node in the cluster.
The deployment module 840 is configured to redeploy the evicted container group based on a third score of a node within the cluster.
According to the load balancing device suitable for the privatized deployment cluster, the first score of the node is periodically estimated based on the load data of the node in the cluster to represent the load size of the node, the second score of the container group is estimated based on the load data of the container group on the node to represent the load size of the container group, and then the container group on the node in the cluster is evicted based on the first score of the node in the cluster and the second score of the container group on the node, so that the periodic centralized rescheduling of the cluster is realized, the risk caused by the real-time data normalization scheduling based on the minute level in the service peak period is avoided, the service stability is improved, and compared with the real-time data normalization scheduling based on the minute level, the resource can be saved. On the basis, the first scores of the nodes in the cluster are updated based on the second scores of the evicted container groups, the third scores of the nodes in the cluster are obtained, the evicted container groups are redeployed based on the third scores of the nodes in the cluster, load sensing scheduling of the evicted container groups is achieved, the load sensing scheduling is started briefly after rescheduling, the load sensing scheduling and the load sensing scheduling are combined, the loads of all the nodes in the cluster are balanced better, and the load balancing requirement of the privately deployed clusters such as small private cloud clusters is met.
In another embodiment, the eviction module comprises:
the first sequencing submodule is used for sequencing the nodes in the cluster according to the sequence from high to low of the first score to obtain a first priority queue;
a first traversal submodule for traversing the first priority queue;
A first determining sub-module, configured to determine, in a case of traversing to one node in the first priority queue, the node as a first node to be rescheduled if a first score of the node is greater than or equal to a first threshold;
and the eviction submodule is used for performing eviction processing on the container group on the first node based on the second score of the container group on the first node and the difference value between the first score of the first node and the first threshold value.
In another embodiment, the eviction module further comprises:
A second determining submodule, configured to determine a fourth score of the physical machine in the cluster based on load data of the physical machine in the cluster if the node in the cluster is a virtual machine on the physical machine;
the second sequencing submodule is used for sequencing the physical machines in the cluster according to the sequence from high to low of the fourth score to obtain a second priority queue;
A second traversal sub-module for traversing the second priority queue;
a third determining sub-module, configured to determine, in a case of traversing to one physical machine in the second priority queue, the physical machine as a first physical machine to be rescheduled if a fourth score of the physical machine is greater than or equal to a second threshold;
and the first sequencing submodule is used for sequencing the nodes on the first physical machine according to the sequence from high to low of the first score to obtain a first priority queue corresponding to the first physical machine.
In another embodiment, the eviction module further comprises:
the first updating sub-module is used for 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;
and the first traversing sub-module is used for stopping traversing the first priority queue corresponding to the first physical machine if the fifth score of the first physical machine is smaller than the second threshold value.
In another embodiment, the eviction module further comprises:
and the first adjusting sub-module is used for adjusting the order of the physical machines in the second priority queue based on the fifth score of the first physical machine.
In another embodiment, the eviction submodule is to:
sorting the container groups on the first node according to the order of the second score from high to low to obtain a third priority queue;
traversing the third priority queue;
And under the condition of traversing to one container group in the third priority queue, if the container group meets the preset rescheduling condition, expelling the container group from the first node.
In another embodiment, the update 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 that is evicted on the first node, and obtain a third score of the first node;
The eviction submodule is further configured to stop traversing the third priority queue if the third score of the first node is less than the first threshold;
The eviction module further comprises:
And the second adjusting sub-module is used for adjusting the order of the nodes in the first priority queue based on the third score of the first node.
In another embodiment, the deployment module comprises:
The third sorting sub-module is used for sorting the nodes in the cluster according to the order of the third score from high to low to obtain a fourth priority queue;
A fourth determination submodule for determining a second node for deploying the evicted container group from within the cluster based on the fourth priority queue;
a deployment sub-module for deploying the evicted container group onto the second node.
In another embodiment, the deployment module further comprises:
a third updating sub-module, configured to, in response to monitoring that the evicted container group is deployed successfully, update a third score of a node in the cluster based on a second score of the evicted container group, and obtain a sixth score of the node in the cluster;
and the third adjusting sub-module is used for adjusting the order of the nodes in the fourth priority queue based on the sixth score of the nodes in the cluster.
In another embodiment, the third update sub-module is configured to:
If the second node is a physical machine, updating a third score of the second node based on a second score of the evicted container group to obtain a sixth score of the second node;
And if the second node is a virtual machine, updating the third score of the second node and the third scores of other nodes which are positioned on the same physical machine as the second node based on the second score of the evicted container group, and obtaining a sixth score of the second node and a sixth score of the other nodes.
Obviously, the load balancing device applicable to the privately-arranged cluster in the embodiment of the present disclosure may be used as an execution body of the load balancing method applicable to the privately-arranged cluster shown in fig. 4, so that the function implemented in fig. 4 by the load balancing method applicable to the privately-arranged cluster can be implemented. Since the principle is the same, the description is not repeated here.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Referring to fig. 9, at the hardware level, the electronic device includes a processor, and optionally an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory (non-volatile Memory), such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, network interface, and memory may be interconnected by an internal bus, which may be an ISA (Industry Standard Architecture ) bus, a PCI (PERIPHERAL COMPONENT INTERCONNECT, peripheral component interconnect standard) bus, or EISA (Extended Industry Standard Architecture ) bus, among others. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in fig. 9, but not only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code including computer-operating instructions. The memory may include memory and non-volatile storage and provide instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form a load balancing device applicable to the privately-arranged cluster on a logic level. The processor is used for executing the programs stored in the memory and is specifically used for executing the following operations:
Periodically determining a first score for a node within a cluster based on load data of the node, and determining a second score for a container group based on 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 scores of the nodes in the cluster based on the second scores of the evicted container groups to obtain third scores of the nodes in the cluster;
And redeploying the evicted container group based on a third score of a node within the cluster.
The method performed by the load balancing apparatus suitable for privately deployed clusters disclosed in the embodiment shown in fig. 4 of the present specification may be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or by instructions in the form of software. The Processor may be a general-purpose Processor including a central processing unit (Central Processing Unit, CPU), a network Processor (Network Processor, NP), etc., or may be a digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of this specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present specification may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
It should be understood that the electronic device of the embodiments of the present disclosure may implement the functionality of the embodiment shown in fig. 4 of the load balancing apparatus suitable for privatized deployment clusters. Since the principles are the same, the embodiments of the present disclosure are not repeated here.
Of course, in addition to the software implementation, the electronic device in this specification does not exclude other implementations, such as a logic device or a combination of software and hardware, that is, the execution subject of the following process is not limited to each logic unit, but may also be hardware or a logic device.
The present description also proposes a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by an electronic device comprising a plurality of application programs, enable the electronic device to perform the method of the embodiment of fig. 4, and in particular to perform the following operations:
Periodically determining a first score for a node within a cluster based on load data of the node, and determining a second score for a container group based on 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 scores of the nodes in the cluster based on the second scores of the evicted container groups to obtain third scores of the nodes in the cluster;
And redeploying the evicted container group based on a third score of a node within the cluster.
The present description embodiments also provide a computer program product comprising a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps in a load balancing method applicable to privately deployed clusters as provided by the present description embodiments.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following 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 desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In summary, the foregoing description is only a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the protection scope of the present specification.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, 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 a combination of any of these devices.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer 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 technology, 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-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are 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 may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
Claims (13)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510749541.2A CN120256149B (en) | 2025-06-05 | 2025-06-05 | Load balancing method suitable for privatized deployment cluster and related products |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510749541.2A CN120256149B (en) | 2025-06-05 | 2025-06-05 | Load balancing method suitable for privatized deployment cluster and related products |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN120256149A CN120256149A (en) | 2025-07-04 |
| CN120256149B true CN120256149B (en) | 2025-10-28 |
Family
ID=96199083
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202510749541.2A Active CN120256149B (en) | 2025-06-05 | 2025-06-05 | Load balancing method suitable for privatized deployment cluster and related products |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN120256149B (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111694633A (en) * | 2020-04-14 | 2020-09-22 | 新华三大数据技术有限公司 | Cluster node load balancing method and device and computer storage medium |
| CN112015536A (en) * | 2020-08-28 | 2020-12-01 | 北京浪潮数据技术有限公司 | Kubernetes cluster container group scheduling method, device and medium |
| CN113032102A (en) * | 2021-04-07 | 2021-06-25 | 广州虎牙科技有限公司 | Resource rescheduling method, device, equipment and medium |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114035941A (en) * | 2021-10-18 | 2022-02-11 | 阿里巴巴(中国)有限公司 | Resource scheduling system, method and computing device |
| CN114020407A (en) * | 2021-10-28 | 2022-02-08 | 济南浪潮数据技术有限公司 | Container management cluster container group scheduling optimization method, device and equipment |
| CN116360922A (en) * | 2023-03-15 | 2023-06-30 | 广州文远知行科技有限公司 | Cluster resource scheduling method, device, computer equipment and storage medium |
| CN116684258A (en) * | 2023-05-06 | 2023-09-01 | 阿里巴巴(中国)有限公司 | Scheduling method, scheduling system and container cluster |
| CN120086005A (en) * | 2024-09-30 | 2025-06-03 | 北京火山引擎科技有限公司 | Storage resource scheduling method, device, medium, equipment and program product |
-
2025
- 2025-06-05 CN CN202510749541.2A patent/CN120256149B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111694633A (en) * | 2020-04-14 | 2020-09-22 | 新华三大数据技术有限公司 | Cluster node load balancing method and device and computer storage medium |
| CN112015536A (en) * | 2020-08-28 | 2020-12-01 | 北京浪潮数据技术有限公司 | Kubernetes cluster container group scheduling method, device and medium |
| CN113032102A (en) * | 2021-04-07 | 2021-06-25 | 广州虎牙科技有限公司 | Resource rescheduling method, device, equipment and medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN120256149A (en) | 2025-07-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111324427B (en) | Task scheduling method and device based on DSP | |
| CN108173698B (en) | Network service management method, device, server and storage medium | |
| US20200314168A1 (en) | Distributed code execution involving a serverless computing infrastructure | |
| US10432551B1 (en) | Network request throttling | |
| CN103763346B (en) | A kind of distributed resource scheduling method and device | |
| CN115129458A (en) | Container-based process scheduling method, device, equipment and storage medium | |
| WO2024120205A1 (en) | Method and apparatus for optimizing application performance, electronic device, and storage medium | |
| CN111078516A (en) | Distributed performance testing method, device and electronic equipment | |
| CN116157778A (en) | System and method for hybrid centralized and distributed scheduling on shared physical host | |
| Tighe et al. | Topology and application aware dynamic vm management in the cloud | |
| WO2024239865A1 (en) | Hot migration method for virtual machine, and related device | |
| WO2023121768A1 (en) | Switch for managing service meshes | |
| Yang et al. | {GPU-Disaggregated} serving for deep learning recommendation models at scale | |
| US11768704B2 (en) | Increase assignment effectiveness of kubernetes pods by reducing repetitive pod mis-scheduling | |
| US11474868B1 (en) | Sharded polling system | |
| CN115766582B (en) | Flow control method, device and system, medium and computer equipment | |
| CN120256149B (en) | Load balancing method suitable for privatized deployment cluster and related products | |
| CN115774614A (en) | Resource control method, terminal and storage medium | |
| CN119440819A (en) | Task allocation method, device, medium, equipment and product | |
| US20240177050A1 (en) | Neural network-based load balancing in distributed storage systems | |
| US10673937B2 (en) | Dynamic record-level sharing (RLS) provisioning inside a data-sharing subsystem | |
| CN111831390B (en) | Server resource management method, device and server | |
| CN116431336A (en) | Page cache limiting method, page cache limiting system, electronic equipment and storage medium | |
| CN108153685A (en) | It is a kind of to handle the method, apparatus of request and equipment, readable medium | |
| CN116719632B (en) | Task scheduling methods, devices, equipment and media |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |