CN111858069B - Cluster resource scheduling method and device and electronic equipment - Google Patents

Cluster resource scheduling method and device and electronic equipment Download PDF

Info

Publication number
CN111858069B
CN111858069B CN202010770119.2A CN202010770119A CN111858069B CN 111858069 B CN111858069 B CN 111858069B CN 202010770119 A CN202010770119 A CN 202010770119A CN 111858069 B CN111858069 B CN 111858069B
Authority
CN
China
Prior art keywords
node
resource
scheduled
nodes
balance degree
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
Application number
CN202010770119.2A
Other languages
Chinese (zh)
Other versions
CN111858069A (en
Inventor
李想成
胡武成
赵增
刘柏
李仁杰
范长杰
程龙
胡志鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202010770119.2A priority Critical patent/CN111858069B/en
Publication of CN111858069A publication Critical patent/CN111858069A/en
Application granted granted Critical
Publication of CN111858069B publication Critical patent/CN111858069B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a method, a device and electronic equipment for dispatching cluster resources, wherein a dispatching server synchronizes the occupied information of resources of all nodes in a cluster, a first node set with the residual quantity of resources meeting the resource demand of an instance to be dispatched is selected from the cluster, the actual balance degree and the virtual balance degree of the nodes in the first node set are calculated, and a target node is selected through the two balance degrees.

Description

Cluster resource scheduling method and device and electronic equipment
Technical Field
The present invention relates to the field of cloud computing technologies, and in particular, to a method and an apparatus for scheduling cluster resources, and an electronic device.
Background
In a distributed system for sharing resources, the scheduling of tasks is divided based on resource predefining, so that the system can schedule the tasks to the most reasonable nodes according to the current cluster resource condition, and the resource utilization rate of the clusters and the load balance among the nodes are increased as much as possible.
At present, in the cluster resource scheduling process, a BalancedResourceAllocation algorithm is commonly used for determining a scheduling node to realize scheduling of examples such as tasks or task sets, but as the algorithm only selects the scheduling node with the most balanced utilization rate of each current resource to perform example scheduling, the scheduled node is extremely easy to generate resource fragmentation, so that the residual resources of the node can not be scheduled, and the problem of resource waste exists to a certain extent.
Disclosure of Invention
Accordingly, the present invention is directed to a method, an apparatus, and an electronic device for scheduling cluster resources, so as to optimize instance scheduling and improve the resource utilization of the cluster.
In a first aspect, an embodiment of the present invention provides a method for scheduling cluster resources, where a scheduling server synchronizes resource occupied information of each node in a cluster, where the resource occupied information includes a first total amount and a first occupied amount of a first resource, and a second total amount and a second occupied amount of a second resource; the method comprises the following steps: selecting a first set of nodes from the cluster; the resource surplus of the nodes in the first node set meets the resource demand of an instance to be scheduled; calculating the actual balance degree and the virtual balance degree of the nodes in the first node set; the actual balance degree is used for representing balance values of the first resource and the second resource corresponding to the current resource occupied information of the node; the virtual balance degree is used for representing a balance value of a first resource and a second resource corresponding to the resource occupied information after the to-be-scheduled instance is scheduled to the node; determining a target node of an instance to be scheduled based on the actual balance degree and the virtual balance degree of the nodes in the first node set; and scheduling the instance to be scheduled to the target node.
The step of determining the target node of the to-be-scheduled instance based on the actual balance degree and the virtual balance degree of the nodes in the first node set includes: dividing nodes in the first node set into an enhanced node group and a weakened node group; the virtual balance degree of the nodes in the enhanced node group is greater than or equal to the actual balance degree, and the nodes in the weakened node group are nodes except the enhanced node group in the first node set; and determining the target node of the instance to be scheduled according to the size of the virtual balance degree according to the principle that the enhanced node group is superior to the weakened node group.
The step of determining the target node of the to-be-scheduled instance according to the virtual balance degree according to the principle that the enhanced node group is superior to the weakened node group comprises the following steps: selecting a node with the maximum virtual balance degree or a node with the virtual balance degree larger than a set threshold value from the enhanced node group as a node to be determined; if the node to be determined meets the preset condition, the node to be determined is used as a target node of the instance to be scheduled; the preset conditions comprise: if the to-be-scheduled instance is scheduled to the to-be-scheduled node, the first occupied amount of the scheduled to-be-scheduled node is smaller than a preset first value, and the second occupied amount is smaller than a preset second value; and/or the virtual balance degree of the undetermined node is larger than the preset tolerance.
At least one value of the preset first value, the preset second value and the preset tolerance is a value corresponding to the service of the cluster.
The step of determining the target node of the to-be-scheduled instance according to the virtual balance degree according to the principle that the enhanced node group is superior to the weakened node group comprises the following steps: and if the undetermined node does not meet the preset condition, selecting the next undetermined node from the enhanced node group based on the magnitude of the virtual balance degree until the selected undetermined node meets the preset condition.
The step of determining the target node of the to-be-scheduled instance according to the virtual balance degree according to the principle that the enhanced node group is superior to the weakened node group comprises the following steps: if the undetermined node does not meet the preset condition, the to-be-scheduled instance is supposed to be scheduled to the nodes in the enhanced node group and the weakened node group one by one; calculating the resource remaining amount ratio of the scheduled node; wherein the ratio of the resource remaining amount is equal to the sum of the ratio of the resource remaining amount of the first resource and the ratio of the resource remaining amount of the second resource of the node; and determining the target node of the to-be-scheduled instance based on the virtual balance degree and the resource remaining amount ratio of the nodes in the enhanced node group and the weakened node group.
The step of determining the target node of the to-be-scheduled instance based on the virtual balance degree and the resource remaining amount ratio of the nodes in the enhanced node group and the weakened node group comprises the following steps: for the nodes in the enhanced node group and the weakened node group, respectively calculating the weighted balance degree of the nodes; weighted balance score=λ×newbalancescore+ω×surfusscore; lambda is a preset first weight, newBalanceScare is the virtual balance degree of the node, omega is a preset second weight, and survivinsScare is the resource remaining amount ratio of the node; and selecting the node with the maximum weighted balance degree as a target node of the to-be-scheduled instance.
The above lambda < omega.
The balance value is inversely related to the difference value between the first occupied information percentage corresponding to the first resource and the second occupied information percentage corresponding to the second resource; the first occupation information percentage is the percentage of the first occupied amount of the first resource and the first total amount; the second occupation information percentage is the percentage of the second occupied amount of the second resource to the second total amount; the first resource is a CPU resource, and the second resource is a memory resource.
In a second aspect, an embodiment of the present invention further provides a device for scheduling cluster resources, where the device is applied to a scheduling server, and the scheduling server synchronizes resource occupied information of each node in the cluster, where the resource occupied information includes a first total amount and a first occupied amount of a first resource, and a second total amount and a second occupied amount of a second resource; the device comprises: a selection module for selecting a first set of nodes from the cluster; the resource surplus of the nodes in the first node set meets the resource demand of an instance to be scheduled; the computing module is used for computing the actual balance degree and the virtual balance degree of the nodes in the first node set; the actual balance degree is used for representing balance values of the first resource and the second resource corresponding to the current resource occupied information of the node; the virtual balance degree is used for representing a balance value of a first resource and a second resource corresponding to the resource occupied information after the to-be-scheduled instance is scheduled to the node; the determining module is used for determining a target node of an instance to be scheduled based on the actual balance degree and the virtual balance degree of the nodes in the first node set; and the scheduling module is used for scheduling the to-be-scheduled instance to the target node.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor executes the steps of the method for scheduling cluster resources.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where a computer program is stored on the computer readable storage medium, and the computer program when executed by a processor performs the steps of the method for scheduling cluster resources.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a method, a device and electronic equipment for dispatching cluster resources, wherein a dispatching server synchronizes the occupied information of resources of all nodes in a cluster, a first node set with the residual quantity of resources meeting the resource demand of an instance to be dispatched is selected from the cluster, the actual balance degree and the virtual balance degree of the nodes in the first node set are calculated, and a target node is selected through the two balance degrees.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and drawings.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are some embodiments of the invention and that other drawings may be obtained from these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a cluster scheduling system according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for scheduling cluster resources according to an embodiment of the present invention;
FIG. 3 is a flowchart of another method for scheduling cluster resources according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a node storage structure according to an embodiment of the present invention;
FIG. 5 is a flowchart of another method for scheduling cluster resources according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a scheduling pod node resource status according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of another scheduling pod node resource status according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a device for scheduling cluster resources according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In general, the scheduling of the cluster resources is implemented on a Kubernetes container cluster system loaded and running with a plurality of nodes, for convenience of understanding, fig. 1 shows a schematic structural diagram of a cluster resource system, and the cluster scheduling system includes a plurality of nodes 100 and a scheduling server 101, as shown in fig. 1, and the cluster scheduling system includes 3 nodes 100, which are illustrated by taking the example of the cluster scheduling system as 3 nodes 100, where the 3 nodes 100 are all connected to the scheduling server 101, and the number of the nodes in the cluster can be selected according to actual needs, which is not limited herein.
Each node 100 has fixed hardware resources, for example, resources such as CPU (central processing unit) resources, memory resources, hard disk and the like, for scheduling the resources, and the scheduling server 101 is a central nerve of the whole cluster scheduling system and is used for managing the plurality of nodes to select a node with a better hardware resource for instance scheduling. Wherein, the actual balance degree refers to the balance degree of the resources calculated according to the total amount and the use amount of each resource of the current node, and the virtual balance degree refers to the balance degree of the resources calculated on the assumption that the to-be-scheduled instance is scheduled to the total amount and the use amount of each resource of the node.
The present embodiment provides a method for scheduling cluster resources, where a scheduling server synchronizes the resource occupied information of each node in a cluster, where the scheduling server is, for example, scheduling server 101 in fig. 1, each node in the cluster is communicatively connected to the scheduling server 101, and the resource occupied information of each node may be synchronized to the scheduling server 101 in real time, where the resource occupied information in this embodiment includes a first total amount and a first occupied amount of a first resource, and a second total amount and a second occupied amount of a second resource. Wherein the first resource and the second resource are two different resources, which may be physical resources of the node. For example, the first resource and the second resource may be a CPU resource and a memory resource, respectively. Referring to a flowchart of a method for scheduling cluster resources shown in fig. 2, the method is described as being applied to the scheduling server, and the method for scheduling cluster resources includes the following steps:
Step S202, selecting a first node set from a cluster; the resource surplus of the nodes in the first node set meets the resource demand of an instance to be scheduled;
the resource surplus comprises the resource surplus of the first resource and the resource surplus of the second resource, wherein the resource surplus of the first resource can be obtained by subtracting a first occupied amount from a first total amount, and the resource surplus of the second resource can be obtained by subtracting a second occupied amount from a second total amount.
The resource requirements of the instance to be scheduled include a first resource requirement and a second resource requirement. Based on the above, when selecting the nodes in the first node set from the cluster, a pre-selection strategy can be utilized to screen out nodes which simultaneously meet that the resource remaining amount of the first resource is not less than the first resource demand and the resource remaining amount of the second resource is not less than the second resource demand from the cluster, and the screened out nodes form the first node set; the above-mentioned pre-selection policy may refer to a pre-selection policy among Kubernetes scheduling policies, which will not be described in detail herein.
Step S204, calculating the actual balance degree and the virtual balance degree of the nodes in the first node set;
the actual balance degree is used for representing balance values of the first resource and the second resource corresponding to the current resource occupied information of the node; the virtual balance degree is used for representing a balance value of a first resource and a second resource corresponding to the resource occupied information after the to-be-scheduled instance is scheduled to the node;
In consideration of the situation that resource fragmentation may occur in a node after an instance is scheduled, and resource waste is caused, in the process of selecting a target node, the embodiment introduces the actual balance degree and the virtual balance degree, and can calculate the actual balance degree of the first resource and the second resource according to the current occupied information of the resource, and calculate the virtual balance degree of the first resource and the second resource according to the occupied information of the resource of the node after the instance is scheduled on the assumption that the instance to be scheduled is scheduled to the node.
The actual balance degree is used for representing balance values of the first resource and the second resource corresponding to the current resource occupied information of the node. The balance value may be referred to as a first balance value, which is inversely related to the difference between a first percentage of occupancy information corresponding to a first resource and a second percentage of occupancy information corresponding to a second resource, e.g., the smaller the difference, the larger the first balance value; the first occupation information percentage is the percentage of the first occupied amount of the first resource (i.e., the actual occupation amount of the first resource) and the first total amount (i.e., the total amount of the first resource); the second occupancy information percentage is a percentage of a second occupied amount of the second resource (i.e., an actual occupancy amount of the second resource) to a second total amount (i.e., a total amount of the second resource).
The virtual balance is used for representing the balance value of the first resource and the second resource corresponding to the resource occupied information after the to-be-scheduled instance is scheduled to the node. The balance value may be referred to as a second balance value that is inversely related to the difference between the first percentage of occupancy information corresponding to the first resource and the second percentage of occupancy information corresponding to the second resource, e.g., the second balance value is inversely proportional to the difference, i.e., the smaller the difference, the larger the second balance value; the first occupancy information percentage is a percentage of a first occupied amount of the first resource (i.e., an occupied amount of the first resource after the to-be-scheduled instance is scheduled to the node) and a first total amount (i.e., a total amount of the first resource); the second occupancy information percentage is a percentage of a second occupied amount of the second resource (i.e., an occupied amount of the second resource after the instance to be scheduled is assumed to be scheduled to the node) to a second total amount (i.e., a total amount of the second resource).
When in actual use, the quality of the balance degree of the actual balance degree or the virtual balance degree of the node can be determined through the difference value between the first occupied information percentage of the first resource and the second occupied information percentage of the second resource, and the smaller the difference value is, the better the balance degree is. For example, the first occupied information percentage of the first resource is 90%, the second occupied information percentage of the second resource is 90%, and the difference value between the first occupied information percentage and the second occupied information percentage is 0, which indicates that the balance degree of the actual balance degree or the virtual balance degree of the node is the best; if the first occupied information percentage of the first resource is 90%, the second occupied information percentage of the second resource is 30%, and the difference value between the first occupied information percentage and the second occupied information percentage is larger, the actual balance degree or the virtual balance degree of the node is not good.
Step S206, determining a target node of an instance to be scheduled based on the actual balance degree and the virtual balance degree of the nodes in the first node set;
when the target node is determined based on the actual balance degree and the virtual balance degree of the node, the node with the virtual balance degree being better than the actual balance degree can be used as the target node, or the node with the virtual balance degree and the actual balance degree being in a relatively reasonable range can be used as the target node, or other modes can be adopted. If more than one target node is determined, the target nodes may be ranked according to virtual balance and/or actual balance, and the final target node may be selected based on the ranking.
Step S208, the to-be-scheduled instance is scheduled to the target node.
An example is a task or a task set, and as an implementation manner, the example to be scheduled may be a pod to be scheduled, where the pod is a minimum unit that can be created and deployed in the Kubernetes container cluster system, is an application example in the Kubernetes container cluster system, is deployed on the same node, includes one or more containers in the pod, and further includes resources shared by each container such as storage, network, and the like.
The pod is used as a service unit capable of running independently, so that the difficulty of application deployment is simplified, great convenience is provided for application deployment pipes at a higher level of abstraction, the pod can be used as a minimum application instance and can run independently, deployment, horizontal expansion and contraction are convenient, scheduling management and resource allocation are convenient, containers in the pod share the same data and network address space, and uniform resource management and allocation are also performed among the pods. However, the pod does not provide the capability of ensuring normal operation, because it may be affected by physical failure of the node, network partition, etc., in this embodiment, the overall high availability may be achieved by selecting a target node from the first node set to schedule the pod based on the actual balance and the virtual balance in the Kubernetes container cluster system, so as to achieve normal operation of the pod.
According to the cluster resource scheduling method, the scheduling server synchronizes the occupied information of the resources of all the nodes in the cluster, a first node set with the residual quantity of the resources meeting the resource demand of an instance to be scheduled is selected from the cluster, the actual balance degree and the virtual balance degree of the nodes in the first node set are calculated, and the target node is selected through the two balance degrees.
In the following, a first resource is taken as a CPU resource, a second resource is taken as a memory resource, the first total amount is the total amount of the CPU resource, the first occupied amount is the current usage amount of the CPU resource, the second total amount is the total amount of the memory resource, and the second occupied amount is the current usage amount of the memory resource. In this embodiment, the actual degree of balance of the node can be calculated by the following formula:
BalanceScore=10-abs(curUsedCpu/cpuCapacity-curUsedMem/memCapacity)*10;
Wherein, balanceScare represents the actual balance degree, curUsedCpu represents the first occupied amount, curUsedMem represents the second occupied amount, cpu capacity represents the first total amount, memCapacity represents the second total amount, abs represents taking absolute value operation.
Based on the above-mentioned actual balance formula, the virtual balance of the node is represented by newbalance score=10-abs (newcurUsedCpu/cpu capability-newcurusedcem/memcapability) 10;
where newcurusedcpu=reqcpu+ curUsedCpu, newcurUsedMem =reqmem+curusedcem, reqCpu represents the first resource requirement, reqMem represents the second resource requirement, and the physical meaning of the remaining variables is as described above and not described here again.
According to the two formulas, the actual balance and the virtual balance corresponding to each node in the first node set can be accurately calculated, the target node is selected through the two balance parameters, and the selected target node is used for example scheduling, so that the balance of the first resource and the second resource of the target node after scheduling the example is still good.
The embodiment provides another cluster resource scheduling method, which is realized on the basis of the embodiment; this embodiment focuses on a specific implementation of determining a target node of an instance to be scheduled. As shown in fig. 3, the method for scheduling cluster resources in this embodiment includes the following steps:
Step S302, selecting a first node set from a cluster; the resource surplus of the nodes in the first node set meets the resource demand of an instance to be scheduled;
step S304, calculating the actual balance degree and the virtual balance degree of the nodes in the first node set; the actual balance degree is used for representing balance values of the first resource and the second resource corresponding to the current resource occupied information of the node; the virtual balance degree is used for representing a balance value of a first resource and a second resource corresponding to the resource occupied information after the to-be-scheduled instance is scheduled to the node;
step S306, dividing the nodes in the first node set into an enhanced node group and a weakened node group; the virtual balance degree of the nodes in the enhanced node group is greater than or equal to the actual balance degree, and the nodes in the weakened node group are nodes except the enhanced node group in the first node set;
when the first node set is divided into node groups, the magnitude relation between the virtual balance degree and the actual balance degree of each node can be compared, and the nodes are classified into the corresponding node groups based on the magnitude relation. The specific division mode is as follows:
(1) If the virtual balance of a node is greater than the actual balance, indicating that the node is better balanced with the second resource after being scheduled, the node may be placed in the enhanced node group.
(2) If the virtual balance degree of a node is equal to the actual balance degree, after the node is scheduled, the balance degree of the first resource and the second resource is the same as before, and the node can be put into the enhanced node group without deterioration; of course, as an implementation manner, such a node may also be placed in a weakening node group, and this embodiment will be described by taking the example of placing such a node in an enhancement node group.
(3) If the virtual balance of a node is less than the actual balance, indicating that the node is less balanced with the second resource after being scheduled, the node may be placed in the impaired node group.
By the aid of the partition mode of the enhanced node group and the weakened node group, the fact that after the nodes in the first node set are scheduled to be instances, the balance degree of the first resource and the second resource tends to be good can be effectively distinguished, and after the nodes are scheduled to be instances, the balance degree of the first resource and the second resource tends to be poor, and a powerful reference basis is provided for subsequent selection of target nodes.
Step S308, determining a target node of an instance to be scheduled according to the size of the virtual balance degree according to the principle that the enhanced node group is superior to the weakened node group;
Because the resource balance of the nodes in the enhanced node group after the instance scheduling is better than the resource balance of the nodes in the weakened node group after the instance scheduling is performed, the nodes in the first node set can be subjected to scheduling priority ranking based on the principle that the enhanced node group is better than the weakened node group, and the specific ranking principle is as follows: 1. the priority of the enhancement node group is greater than that of the weakening node group, so that all nodes in the enhancement node group are arranged in front of all nodes in the weakening node group; 2. the internal ordering of the enhanced node group is that the priority with large virtual balance degree is higher and higher, and the internal ordering of the weakened node group is the same, and the description is omitted here.
In order to better store the nodes in the enhanced node group and the nodes in the weakened node group, and continuing to take the to-be-scheduled pod as an example for explanation, fig. 4 shows a schematic node storage structure, as shown in fig. 4, two storage areas may be set in the memory of the scheduling server, and the nodes in the enhanced node group are stored in the storage area 400, where a plurality of nodes N in the enhanced node group X 、N X+1 、N X+2 … …, the virtual balance degree is sorted and stored from large to small; storing sections in a weakened node group in a storage area 401 A point of weakening a plurality of nodes N in the node group y 、N y+1 、N y+2 … …, are also stored in order from large to small according to the virtual balance. The step of determining the target node of the pod to be scheduled based on the scheduling priority ordering and the size of the virtual balance degree can be realized by steps A1-A3:
a1, selecting a node with the maximum virtual balance degree or a node with the virtual balance degree larger than a set threshold value from an enhanced node group as a node to be determined;
in this embodiment, a node with the maximum virtual balance degree in the enhanced node group may be selected as a pending node, or one or more nodes are randomly selected from nodes with the virtual balance degree greater than a set threshold in the enhanced node group, as pending nodes, where the set threshold may be set according to actual needs, and is not limited herein.
A2, if the node to be determined meets the preset condition, taking the node to be determined as a target node of the pod to be scheduled; the preset conditions include: if the pod to be scheduled is scheduled to the undetermined node, the first occupied amount of the scheduled undetermined node is smaller than a preset first value, and the second occupied amount is smaller than a preset second value; and/or the virtual balance degree of the undetermined node is larger than the preset tolerance.
Wherein, if the node with the maximum virtual balance degree selected in the step A1 meets the preset condition, the node can be determined as a target node; and (3) if the plurality of nodes with the virtual balance degree larger than the set threshold value selected in the step (A1) meet the preset condition, any one node can be used as a target node.
The preset conditions include two conditions, namely, a first condition: if the pod to be scheduled is scheduled to the undetermined node, the first occupied amount of the scheduled undetermined node is smaller than a preset first value, and the second occupied amount is smaller than a preset second value; condition II: the virtual balance degree of the undetermined node is larger than the preset tolerance. The preset condition may include one of the following: (1) The first condition and the second condition are simultaneously met, and the undetermined node meets the preset condition; (2) Only the first condition is concerned, and the undetermined node is considered to meet the preset condition as long as the first condition is met; (3) Only the second condition is concerned, as long as the second condition is immediately regarded as that the pending node satisfies the preset condition. The implementation form of the specific preset condition may be selected from the above (1), (2) and (3), and this embodiment is not limited thereto.
Since the service (i.e. the pod to be scheduled) of the cluster is different, the resource demand is also different, for example, the resource demand of a single pod is 30 cores, 120G, for reinforcement learning AI (Artificial Intelligence ) training tasks; the common AI training task, the resource demand of a single pod is 4 cores, 8G; on-line application, wherein the demand of a single pod resource is 2 cores and 4G; the setting of the threshold point (i.e., at least one of the preset first value, the preset second value, and the preset tolerance) may also be different for different service types and different resource demands, where at least one of the preset first value, the preset second value, and the preset tolerance is a value corresponding to the service of the cluster, and at least one of the preset first value, the preset second value, and the preset tolerance may be set according to the service, and is not limited herein.
And step A3, if the undetermined node does not meet the preset condition, selecting the next undetermined node from the enhanced node group based on the magnitude of the virtual balance degree until the selected undetermined node meets the preset condition.
As an implementation manner, if the pod to be scheduled is scheduled to the pending node, the first occupied amount of the scheduled pending node is not less than a preset first value, or the second occupied amount is not less than a preset second value, or the virtual balance degree of the pending node is not greater than the preset tolerance, and the predetermined condition is met, then it may be determined that the pending node does not meet the predetermined condition.
If the node to be determined selected in the step A1 does not meet the preset condition, a node with the second largest virtual balance degree can be selected as the node to be determined according to the size of the virtual balance degree, whether the node to be determined meets the preset condition is determined again, if yes, the node is taken as a target node of the pod to be scheduled, if not, a node with the third largest virtual balance degree is selected as the node to be determined, and so on, redundant description is omitted until the selected node to be determined meets the preset condition, and the node meeting the preset condition is determined as the target node.
Step S310, scheduling the to-be-scheduled instance to the target node.
In this embodiment, the target node determined by the principle and virtual balance degree that the enhanced node group is better than the weakened node group may be used to schedule the to-be-scheduled instance.
According to the method for scheduling the cluster resources, provided by the embodiment of the invention, the nodes can be divided into the enhanced node group and the weakened node group to determine the target nodes, so that on one hand, the node balance degree of the whole cluster is improved by preferentially scheduling the enhanced nodes (namely, the nodes with better balance degree after scheduling than that before scheduling), and on the other hand, the situation that the balance degree of the nodes with good original balance degree is poor due to scheduling examples is avoided as much as possible; the rationality and the overall balance of the instance scheduling are ensured to a certain extent.
Of course, as an implementation manner, when the pending node is obtained by executing the step A1, the pending node may be directly used as the target node to perform subsequent pod scheduling. Compared with the mode that the undetermined node meeting the preset condition is taken as the target node, the resource balance degree of the undetermined node after the pod is scheduled is probably not optimal, but the undetermined node in the mode is selected from the enhanced node group, so that the resource balance degree of the undetermined node after the pod is scheduled is also ensured to a certain extent. If all the nodes in the enhanced node group do not meet the preset condition, the method is carried out, and next, the undetermined nodes are selected from the weakened node group, and the selection mode can also be selected according to the ordering of all the nodes in the weakened node group until the undetermined nodes meeting the preset condition are found.
The embodiment provides another cluster resource scheduling method, which is realized on the basis of the embodiment; this embodiment focuses on a specific implementation of determining a target node of an instance to be scheduled. As shown in fig. 5, the method for scheduling cluster resources in this embodiment includes the following steps:
step S502, selecting a first node set from a cluster; the resource surplus of the nodes in the first node set meets the resource demand of an instance to be scheduled;
step S504, calculating the actual balance degree and the virtual balance degree of the nodes in the first node set; the actual balance degree is used for representing balance values of the first resource and the second resource corresponding to the current resource occupied information of the node; the virtual balance degree is used for representing a balance value of a first resource and a second resource corresponding to the resource occupied information after the to-be-scheduled instance is scheduled to the node;
step S506, dividing the nodes in the first node set into an enhanced node group and a weakened node group; the virtual balance degree of the nodes in the enhanced node group is greater than or equal to the actual balance degree, and the nodes in the weakened node group are nodes except the enhanced node group in the first node set;
Step S508, selecting a node with the maximum virtual balance degree or a node with the virtual balance degree larger than a set threshold value from the enhanced node group as a pending node;
step S510, if the undetermined node does not meet the preset condition, the to-be-scheduled instance is supposed to be scheduled to the nodes in the enhanced node group and the weakened node group one by one;
step S512, calculating the resource remaining amount ratio of the scheduled node; wherein the ratio of the resource remaining amount is equal to the sum of the ratio of the resource remaining amount of the first resource and the ratio of the resource remaining amount of the second resource of the node;
for convenience of explanation, the ratio of the remaining amount of resources after scheduling an instance for each node in the first node set may be calculated by the following formula:
surplusScore=(surplusCpu/cpuCapacity+surplusMemory/memCapacity)/2;
wherein, surplus score represents the resource remaining ratio, surplus cpu represents the resource remaining of the first resource, and surplus memory represents the resource remaining of the second resource.
Wherein, the resource remaining amount of the first resource surflurcpu=cpu capacity-curUsedCpu;
the resource remaining amount of the second resource surplus memory=memcapacity-curUsedMem.
Step S514, determining a target node of an instance to be scheduled based on the virtual balance degree and the resource remaining amount ratio of the nodes in the enhanced node group and the weakened node group;
Specifically, the step of determining the target node of the to-be-scheduled instance may be implemented by step B1 and step B2:
step B1, respectively calculating the weighted balance degree of the nodes in the enhanced node group and the weakened node group;
weighted balance score=λ×newbalancescore+ω×surfusscore;
wherein λ is a preset first weight, newBalanceScore is a virtual balance degree of the node, ω is a preset second weight, and surflus score is a resource remaining amount ratio of the node.
Typically, λ+ω=1, since there is a greater tendency for more resources to remain when selecting the target node based on the weighted balance, λ < ω will be set in this embodiment.
And step B2, selecting the node with the maximum weighted balance degree as a target node of the to-be-scheduled instance.
In step S516, the to-be-scheduled instance is scheduled to the target node.
And B2, taking the node with the highest weighted balance degree selected in the step as a target node to perform scheduling operation of the instance.
According to the cluster resource scheduling method provided by the embodiment of the invention, when the undetermined node does not meet the preset condition, the weighted balance degree of each node in the first node set can be calculated, the node with the largest weighted balance degree is selected as the target node for example scheduling, and the example is scheduled to the node with more residual resources as much as possible under the condition that the higher balance degree is ensured as much as possible based on the weighted balance degree selection target node, so that occurrence of resource fragmentation is reduced, and the utilization rate of resources is improved.
In order to understand the phenomenon of resource fragmentation, taking a pod to be scheduled as an example for continuing to explain, fig. 6 shows a schematic diagram of resource status of a node for scheduling the pod, in fig. 6, the left box shows resource status of three nodes before scheduling, respectively N1, N2 and N3, wherein the occupied amount of CPU corresponding to each node is represented by a white box, the occupied amount of memory is represented by a diagonal box, the remaining amount of resources is represented by a horizontal line of points, in fig. 6, the upper left corner shows resource demand amount of the pod to be scheduled, and it is known that the balance degree of the node N1 after scheduling is better than that of other nodes, so that the pod can be scheduled to the node N1, in fig. 6, the right box shows resource status of three nodes after scheduling the pod to the node N1, and the remaining amount of CPU resources of the node N1 is smaller, so that scheduling of the subsequent pod is unfavorable, and the node N1 generates non-schedulable fragmented resources, as shown in fig. 6, the right box shows that the node N2 and the node N3 do not schedule the pod, and the node N2 does not change the node N2 after scheduling the node N3.
In order to fully explain the situation that the method of the embodiment ensures that the balance degree is high as much as possible, the pod is scheduled to the node with more residual resources as much as possible, so as to reduce the occurrence of resource fragmentation in fig. 6. On the basis of fig. 6, fig. 7 shows another schematic view of the resource status of a node of a to-be-scheduled pod, in fig. 7, the upper left corner shows not only the resource demand of the to-be-scheduled pod, but also the resource demand of a subsequent new to-be-scheduled pod, and since the resource residuals of the node N2 and the node N3 are more than the resource residuals of the node N1 and the resource residuals of the node N2 and the node N3 are the same, the to-be-scheduled pod can be scheduled on the node N2 or the node N3, for convenience of explanation, taking the to-be-scheduled pod as an example for scheduling on the node N2, it can be seen from fig. 7 that the balance degree of the node can be improved after the subsequent new pod is scheduled on the node N2, and the non-schedulable resource residuals are small, so that the resource fragmentation is reduced to a certain extent, the resource utilization of the cluster is improved, and thus the pod scheduling is optimized.
Corresponding to the method embodiment, the embodiment of the invention provides a cluster resource scheduling device, wherein the scheduling server synchronizes the resource occupied information of each node in the cluster, wherein the resource occupied information comprises a first total amount and a first occupied amount of a first resource, and a second total amount and a second occupied amount of a second resource; fig. 8 shows a schematic structural diagram of an apparatus for scheduling cluster resources, as shown in fig. 8, where the apparatus includes:
a selection module 802 for selecting a first set of nodes from the cluster; the resource surplus of the nodes in the first node set meets the resource demand of an instance to be scheduled;
a calculating module 804, configured to calculate an actual balance degree and a virtual balance degree of nodes in the first node set; the actual balance degree is used for representing balance values of the first resource and the second resource corresponding to the current resource occupied information of the node; the virtual balance degree is used for representing a balance value of a first resource and a second resource corresponding to the resource occupied information after the to-be-scheduled instance is scheduled to the node;
a determining module 806, configured to determine a target node of the instance to be scheduled based on the actual balance and the virtual balance of the nodes in the first node set;
A scheduling module 808, configured to schedule the to-be-scheduled instance to the target node.
The embodiment of the invention provides a cluster resource scheduling device, wherein a scheduling server synchronizes the resource occupied information of each node in a cluster, a first node set with the resource residual quantity meeting the resource demand of an instance to be scheduled is selected from the cluster, the actual balance degree and the virtual balance degree of the nodes in the first node set are calculated, and a target node is selected through the two balance degrees.
The determining module 806 is further configured to divide the nodes in the first node set into an enhanced node group and a weakened node group; the virtual balance degree of the nodes in the enhanced node group is greater than or equal to the actual balance degree, and the nodes in the weakened node group are nodes except the enhanced node group in the first node set; and determining the target node of the instance to be scheduled according to the size of the virtual balance degree according to the principle that the enhanced node group is superior to the weakened node group.
The determining module 806 is further configured to select, from the enhanced node group, a node with the maximum virtual balance degree or a node with the virtual balance degree greater than a set threshold value, as the pending node; if the node to be determined meets the preset condition, the node to be determined is used as a target node of the instance to be scheduled; the preset conditions comprise: if the to-be-scheduled instance is scheduled to the to-be-scheduled node, the first occupied amount of the scheduled to-be-scheduled node is smaller than a preset first value, and the second occupied amount is smaller than a preset second value; or the virtual balance degree of the undetermined node is larger than the preset tolerance.
At least one value among the preset first value, the preset second value and the preset tolerance is a value corresponding to the service of the cluster.
The determining module 806 is further configured to select, if the pending node does not meet the preset condition, a next pending node from the enhanced node group based on the magnitude of the virtual balance until the selected pending node meets the preset condition.
The determining module 806 is further configured to, if the pending node does not meet the preset condition, assume that the to-be-scheduled instances are scheduled to nodes in the enhanced node group and the weakened node group one by one; calculating the resource remaining amount ratio of the scheduled node; wherein the ratio of the resource remaining amount is equal to the sum of the ratio of the resource remaining amount of the first resource and the ratio of the resource remaining amount of the second resource of the node; and determining the target node of the to-be-scheduled instance based on the virtual balance degree and the resource remaining amount ratio of the nodes in the enhanced node group and the weakened node group.
The determining module 806 is further configured to calculate, for the nodes in the enhanced node group and the weakened node group, a weighted balance degree of the nodes, respectively; weighted balance score=λ×newbalancescore+ω×surfusscore; lambda is a preset first weight, newBalanceScare is the virtual balance degree of the node, omega is a preset second weight, and survivinsScare is the resource remaining amount ratio of the node; and selecting the node with the maximum weighted balance degree as a target node of the to-be-scheduled instance.
Typically, λ < ω. The balance value is inversely related to the difference value between the first occupation information percentage corresponding to the first resource and the second occupation information percentage corresponding to the second resource; the first occupancy information percentage is a percentage of a first occupied amount of the first resource to a first total amount; the second occupation information percentage is the percentage of the second occupied amount of the second resource to the second total amount; the first resource is a CPU resource, and the second resource is a memory resource.
The device for scheduling the cluster resources provided by the embodiment of the invention has the same technical characteristics as the method for scheduling the cluster resources provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
The embodiment of the invention also provides electronic equipment for running the rendering method of the target model; referring to fig. 9, an electronic device includes a memory 900 and a processor 901, where the memory 900 is configured to store one or more computer instructions, and the one or more computer instructions are executed by the processor 901 to implement the method for scheduling cluster resources described above.
Further, the electronic device shown in fig. 9 further includes a bus 902 and a communication interface 903, and the processor 901, the communication interface 903, and the memory 900 are connected through the bus 902.
The memory 900 may include a high-speed random access memory (RAM, random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. The communication connection between the system network element and at least one other network element is implemented via at least one communication interface 903 (which may be wired or wireless), and may use the internet, a wide area network, a local network, a metropolitan area network, etc. Bus 902 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be divided into 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.
Processor 901 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 901 or instructions in the form of software. The processor 901 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present invention 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 the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding 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 the memory 900, and the processor 901 reads information in the memory 900, and in combination with its hardware, performs the steps of the method of the foregoing embodiment.
The embodiment of the invention also provides a computer readable storage medium, which stores computer executable instructions that, when being called and executed by a processor, cause the processor to implement the method for scheduling cluster resources, and the specific implementation can be referred to the method embodiment and will not be described herein.
The method, the apparatus and the computer program product of the electronic device for cluster resource scheduling provided by the embodiments of the present invention include a computer readable storage medium storing program codes, where the instructions included in the program codes may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the method embodiment and will not be repeated herein.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working processes of the electronic device and apparatus described above may refer to corresponding processes in the foregoing method embodiments, which are not described herein again.
In addition, in the description of embodiments of the present invention, unless explicitly stated and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention will be understood by those skilled in the art in specific cases.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention for illustrating the technical solution of the present invention, but not for limiting the scope of the present invention, and although the present invention has been described in detail with reference to the foregoing examples, it will be understood by those skilled in the art that the present invention is not limited thereto: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (12)

1. A method for scheduling cluster resources, characterized in that resource occupied information of each node in the cluster is synchronized through a scheduling server, wherein the resource occupied information comprises a first total amount and a first occupied amount of first resources, and a second total amount and a second occupied amount of second resources; the method comprises the following steps:
Selecting a first set of nodes from the cluster; the resource surplus of the nodes in the first node set meets the resource demand of an instance to be scheduled;
calculating the actual balance degree and the virtual balance degree of the nodes in the first node set; the actual balance degree is used for representing balance values of a first resource and a second resource corresponding to the current resource occupied information of the node; the virtual balance degree is used for representing a balance value of a first resource and a second resource corresponding to the resource occupied information after the to-be-scheduled instance is scheduled to the node; determining a target node of the instance to be scheduled based on the actual balance degree and the virtual balance degree of the nodes in the first node set;
scheduling the instance to be scheduled to the target node;
wherein the balance value is inversely related to a difference between a first occupancy information percentage corresponding to the first resource and a second occupancy information percentage corresponding to the second resource; the first occupancy information percentage is a percentage of a first occupied amount of the first resource to a first total amount; the second percentage of occupancy information is a percentage of a second occupied amount of the second resource to a second total amount.
2. The method of claim 1, wherein the step of determining the target node of the instance to be scheduled based on the actual and virtual balances of the nodes in the first set of nodes comprises:
dividing nodes in the first node set into an enhanced node group and a weakened node group; the virtual balance degree of the nodes in the enhanced node group is greater than or equal to the actual balance degree, and the nodes in the weakened node group are nodes except the enhanced node group in the first node set;
and determining the target node of the instance to be scheduled according to the size of the virtual balance degree according to the principle that the enhanced node group is superior to the weakened node group.
3. The method according to claim 2, wherein the step of determining the target node of the instance to be scheduled according to the magnitude of the virtual balancing on the basis of the principle that the enhanced node group is superior to the weakened node group comprises:
selecting a node with the maximum virtual balance degree or a node with the virtual balance degree larger than a set threshold value from the enhanced node group as a node to be determined;
if the undetermined node meets the preset condition, the undetermined node is used as a target node of the to-be-scheduled instance; the preset conditions include: if the to-be-scheduled instance is scheduled to the to-be-scheduled node, the first occupied amount of the scheduled to-be-scheduled node is smaller than a preset first value, and the second occupied amount is smaller than a preset second value; and/or, the virtual balance degree of the undetermined node is greater than a preset tolerance.
4. A method according to claim 3, wherein at least one of the preset first value, the preset second value and the preset tolerance is a value corresponding to traffic of the cluster.
5. A method according to claim 3, wherein the step of determining the target node of the instance to be scheduled according to the magnitude of the virtual balancing, on the basis of the principle that the enhanced node group is superior to the de-enhanced node group, comprises:
and if the undetermined node does not meet the preset condition, selecting the next undetermined node from the enhanced node group based on the magnitude of the virtual balance degree until the selected undetermined node meets the preset condition.
6. A method according to claim 3, wherein the step of determining the target node of the instance to be scheduled according to the magnitude of the virtual balancing, on the basis of the principle that the enhanced node group is superior to the de-enhanced node group, comprises:
if the undetermined node does not meet the preset condition, the to-be-scheduled instance is assumed to be scheduled to the nodes in the enhanced node group and the weakened node group one by one;
calculating the resource remaining amount ratio of the scheduled node; wherein the ratio of the resource remaining amount is equal to the sum of the ratio of the resource remaining amount of the first resource and the ratio of the resource remaining amount of the second resource of the node;
And determining the target node of the to-be-scheduled instance based on the virtual balance degree and the resource remaining amount ratio of the nodes in the enhanced node group and the weakened node group.
7. The method of claim 6, wherein the step of determining the target node of the instance to be scheduled based on the virtual balance and the resource remaining ratio of the nodes in the enhanced node group and the weakened node group comprises:
for the nodes in the enhanced node group and the weakened node group, respectively calculating the weighted balance degree of the nodes; the weighted balance score=λ×newbalancescore+ω×surpissscore; lambda is a preset first weight, newBalanceScare is the virtual balance degree of the node, omega is a preset second weight, and surflus Scare is the ratio of the resource remaining amount of the node;
and selecting the node with the maximum weighted balance degree as the target node of the to-be-scheduled instance.
8. The method of claim 7, wherein λ < ω.
9. The method of claim 1, wherein the first resource is a CPU resource and the second resource is a memory resource.
10. A device for scheduling cluster resources, which is characterized in that the device is applied to a scheduling server, and the scheduling server synchronizes the resource occupied information of each node in the cluster, wherein the resource occupied information comprises a first total amount and a first occupied amount of first resources, and a second total amount and a second occupied amount of second resources; the device comprises:
A selection module for selecting a first set of nodes from the cluster; the resource surplus of the nodes in the first node set meets the resource demand of an instance to be scheduled;
the calculation module is used for calculating the actual balance degree and the virtual balance degree of the nodes in the first node set; the actual balance degree is used for representing balance values of a first resource and a second resource corresponding to the current resource occupied information of the node; the virtual balance degree is used for representing a balance value of a first resource and a second resource corresponding to the resource occupied information after the to-be-scheduled instance is scheduled to the node;
the determining module is used for determining the target node of the instance to be scheduled based on the actual balance degree and the virtual balance degree of the nodes in the first node set;
the scheduling module is used for scheduling the to-be-scheduled instance to the target node;
wherein the balance value is inversely related to a difference between a first occupancy information percentage corresponding to the first resource and a second occupancy information percentage corresponding to the second resource; the first occupancy information percentage is a percentage of a first occupied amount of the first resource to a first total amount; the second percentage of occupancy information is a percentage of a second occupied amount of the second resource to a second total amount.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method for scheduling cluster resources of any of the preceding claims 1-9 when the computer program is executed.
12. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of the method of cluster resource scheduling of any of the preceding claims 1-9.
CN202010770119.2A 2020-08-03 2020-08-03 Cluster resource scheduling method and device and electronic equipment Active CN111858069B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010770119.2A CN111858069B (en) 2020-08-03 2020-08-03 Cluster resource scheduling method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010770119.2A CN111858069B (en) 2020-08-03 2020-08-03 Cluster resource scheduling method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111858069A CN111858069A (en) 2020-10-30
CN111858069B true CN111858069B (en) 2023-06-30

Family

ID=72953035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010770119.2A Active CN111858069B (en) 2020-08-03 2020-08-03 Cluster resource scheduling method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111858069B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112965797B (en) * 2021-03-05 2022-02-22 山东省计算中心(国家超级计算济南中心) Combined priority scheduling method for complex tasks under Kubernetes environment
CN114840304B (en) * 2022-04-15 2023-03-21 中兴通讯股份有限公司 Container scheduling method, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457131A (en) * 2019-07-31 2019-11-15 华中科技大学 Electric system supercomputer platform method for scheduling task based on Docker container

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213595B (en) * 2017-07-07 2023-12-26 中兴通讯股份有限公司 Load balancing scheduling method and device and computer readable storage medium
US10754704B2 (en) * 2018-07-11 2020-08-25 International Business Machines Corporation Cluster load balancing based on assessment of future loading
US10942769B2 (en) * 2018-11-28 2021-03-09 International Business Machines Corporation Elastic load balancing prioritization
CN110167031B (en) * 2019-05-13 2021-07-20 中国科学院计算技术研究所 Resource allocation method, equipment and storage medium for centralized base station
CN111143063B (en) * 2019-12-24 2023-08-18 青岛海尔科技有限公司 Task resource reservation method and device
CN111475251A (en) * 2020-03-08 2020-07-31 苏州浪潮智能科技有限公司 Cluster container scheduling method, system, terminal and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457131A (en) * 2019-07-31 2019-11-15 华中科技大学 Electric system supercomputer platform method for scheduling task based on Docker container

Also Published As

Publication number Publication date
CN111858069A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
CN111966500B (en) Resource scheduling method and device, electronic equipment and storage medium
CN111858069B (en) Cluster resource scheduling method and device and electronic equipment
CN112269641B (en) Scheduling method, scheduling device, electronic equipment and storage medium
US9740534B2 (en) System for controlling resources, control pattern generation apparatus, control apparatus, method for controlling resources and program
CN106897132A (en) The method and device of a kind of server task scheduling
CN110474966B (en) Method for processing cloud platform resource fragments and related equipment
CN112860383A (en) Cluster resource scheduling method, device, equipment and storage medium
CN111866054A (en) Cloud host building method and device, electronic equipment and readable storage medium
CN114579271A (en) Task scheduling method, distributed system and storage medium
CN109547241B (en) Virtual network function deployment method facing NUMA (non Uniform memory Access) architecture based on Markov algorithm
CN111104227A (en) Resource control method and device of K8s platform and related components
CN114356587A (en) Calculation power task cross-region scheduling method, system and equipment
CN116881009A (en) GPU resource scheduling method and device, electronic equipment and readable storage medium
CN110719335B (en) Resource scheduling method, system and storage medium under space-based cloud computing architecture
CN114020455B (en) Arranging method and device of service functions and computer readable storage medium
CN110493317B (en) Method for processing cloud platform resource fragments and related equipment
CN117234733A (en) Distributed system task allocation method, system, storage medium and equipment
CN116360994A (en) Scheduling method, device, server and storage medium of distributed heterogeneous resource pool
CN109615680B (en) Method, device and storage medium for realizing wireless spectrum resource spatial distribution interpolation processing based on Thiessen polygons and distance inverse proportion
CN116483547A (en) Resource scheduling method, device, computer equipment and storage medium
CN114844791B (en) Cloud service automatic management and distribution method and system based on big data and storage medium
CN111200566A (en) Network service flow information grooming method and electronic equipment
CN116339989A (en) Mixed part server, resource management method and device of mixed part server
CN108279968A (en) A kind of dispatching method and device of resources of virtual machine
CN115086324A (en) Service chain allocation method and system, computer device and storage medium

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