CN111858069A - 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
CN111858069A
CN111858069A CN202010770119.2A CN202010770119A CN111858069A CN 111858069 A CN111858069 A CN 111858069A CN 202010770119 A CN202010770119 A CN 202010770119A CN 111858069 A CN111858069 A CN 111858069A
Authority
CN
China
Prior art keywords
node
resource
scheduled
nodes
balance
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.)
Granted
Application number
CN202010770119.2A
Other languages
Chinese (zh)
Other versions
CN111858069B (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 cluster resource scheduling, wherein resource occupied information of each node in a cluster is synchronized through a scheduling server, a first node set with the resource residual quantity meeting the resource demand of a to-be-scheduled example 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 two balance degrees.

Description

Cluster resource scheduling method and device and electronic equipment
Technical Field
The invention relates to the technical field of cloud computing, in particular to a method and a device for cluster resource scheduling and electronic equipment.
Background
In the resource sharing distributed system, the task scheduling 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 cluster and the load balance among the nodes are increased as much as possible.
At present, in the process of cluster resource scheduling, a balancedResourceAllocation algorithm is commonly used to determine that a scheduling node implements scheduling of instances such as tasks or task sets, but since the algorithm only selects the scheduling node with the most balanced resource utilization rate to perform instance scheduling, the scheduled node is easily subjected to resource fragmentation, so that the remaining resources of the node are not schedulable, and the problem of resource waste exists to a certain extent.
Disclosure of Invention
In view of this, the present invention provides a method, an apparatus, and an electronic device for scheduling cluster resources, so as to optimize instance scheduling and improve resource utilization of a cluster.
In a first aspect, an embodiment of the present invention provides a method for scheduling cluster resources, where resource occupied information of each node in a cluster is synchronized by a scheduling server, 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 the instances 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 a balance value 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 an instance to be scheduled based on the actual balance and the virtual balance of the nodes in the first node set; and scheduling the instances to be scheduled to the target nodes.
The step of determining a target node of the to-be-scheduled instance based on the actual degree of balance and the virtual degree of balance of the nodes in the first node set includes: 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 the nodes in the first node set except the enhanced node group; and determining the target node of the instance to be scheduled according to the size of the virtual balance degree on the basis that the enhanced node group is superior to the weakened node group.
The step of determining the target node of the instance to be scheduled according to the size of the virtual balance degree on the basis 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, taking the node to be determined as a target node of the instance to be scheduled; the preset conditions include: if the to-be-scheduled instance 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 node to be determined is greater than the preset tolerance.
At least one of the preset first value, the preset second value and the preset tolerance is a value corresponding to a service of the cluster.
The step of determining the target node of the instance to be scheduled according to the size of the virtual balance degree on the basis 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 size of the virtual balance degree until the selected undetermined node meets the preset condition.
The step of determining the target node of the instance to be scheduled according to the size of the virtual balance degree on the basis that the enhanced node group is superior to the weakened node group comprises the following steps: if the node to be scheduled does not meet the preset conditions, the method assumes that the instances to be scheduled are scheduled to the nodes in the enhanced node group and the weakened node group one by one; calculating the ratio of the resource surplus of the scheduled node; the resource surplus proportion is equal to the sum of the resource surplus proportion of the first resource and the resource surplus proportion of the second resource of the node; and determining a target node of the instance to be scheduled based on the virtual balance and the ratio of the resource surplus 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 and the ratio of the resource surplus of the nodes in the enhanced node group and the weakened node group includes: respectively calculating the weighted balance degree of the nodes in the enhanced node group and the weakened node group; weighted balance Score ═ λ newBalanceScore + ω surfussscore; lambda is a preset first weight, newBalanceScore is a virtual balance degree of the node, omega is a preset second weight, and suprplus Score is a ratio of the resource surplus of the node; and selecting the node with the maximum weighting balance degree as a target node of the to-be-scheduled instance.
λ < ω above.
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 occupied information percentage is a percentage of a first occupied amount of the first resource to a first total amount; the second occupied information percentage is a percentage of a second occupied amount of the second resource to a 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 resource occupied information of each node in a cluster is synchronized by the scheduling server, 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 above-mentioned device includes: 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 the instances 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 a balance value 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 a target node of the example 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 instances to be scheduled to the target nodes.
In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method for scheduling cluster resources when executing the computer program.
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 when the computer program is executed by a processor, the steps of the method for scheduling cluster resources are performed.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a method, a device and electronic equipment for cluster resource scheduling, wherein resource occupied information of each node in a cluster is synchronized through a scheduling server, a first node set with the resource residual quantity meeting the resource demand of a to-be-scheduled example 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 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 aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
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 cluster resource scheduling method 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 cluster resource scheduling method according to an embodiment of the present invention;
fig. 6 is a schematic diagram illustrating a status of scheduling pod node resources according to an embodiment of the present invention;
fig. 7 is a schematic diagram illustrating another resource status of a scheduling pod node according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an apparatus 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
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Generally, scheduling of cluster resources is implemented on a kubernets 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, where the cluster scheduling system includes a plurality of nodes 100 and a scheduling server 101, as shown in fig. 1, it is described that the cluster scheduling system includes 3 nodes 100 as an example, the 3 nodes 100 are all connected with the scheduling server 101, and the number of nodes in a cluster may be selected according to actual needs, which is not limited herein.
Each node 100 has fixed hardware resources, for example, resources such as a Central Processing Unit (CPU), a memory resource, and a hard disk are used for scheduling resources, and the scheduling server 101 is a central nerve of the entire cluster scheduling system and is used for managing the nodes to select a node with a better hardware resource for instance scheduling. The actual balance degree refers to a resource balance degree calculated according to the total amount and the usage amount of each resource of the current node, and the virtual balance degree refers to a resource balance degree calculated on the assumption that the total amount and the usage amount of each resource after the to-be-scheduled instance is scheduled to the node.
The present embodiment provides a method for scheduling cluster resources, wherein resource occupied information of each node in a cluster is synchronized through a scheduling server, the scheduling server is, for example, a scheduling server 101 in fig. 1, each node in the cluster is in communication connection with the scheduling server 101, the resource occupied information of each node can be synchronized to the scheduling server 101 in real time, and the resource occupied information in the present 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. The first resource and the second resource are two different resources, and the resource may be a physical resource 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 by taking the scheduling server as an example, 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 the instances to be scheduled;
the resource residual quantity comprises the resource residual quantity of a first resource and the resource residual quantity of a second resource, the resource residual quantity of the first resource can be obtained by subtracting a first occupied quantity from a first total quantity, and the resource residual quantity of the second resource can be obtained by subtracting a second occupied quantity from a second total quantity.
The resource demand of the to-be-scheduled instance comprises a first resource demand and a second resource demand. Based on the above, when the nodes in the first node set are selected from the cluster, the nodes which simultaneously meet the condition that the resource surplus of the first resource is not less than the first resource demand and the resource surplus of the second resource is not less than the second resource demand can be selected from the cluster by using a preselected strategy, and the selected nodes form the first node set; the above-mentioned preselection strategy may refer to a preselection strategy in the kubernets scheduling strategy, which is not 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 a balance value 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;
in consideration of the situation that the nodes after the scheduling instance may have resource fragmentation to cause resource waste, in the process of selecting the target node, the present embodiment introduces the actual balance degree and the virtual balance degree, may calculate the actual balance degree of the first resource and the second resource according to the current resource occupied information, and assumes that the instance to be scheduled is scheduled to the node, and calculates the virtual balance degree of the first resource and the second resource according to the resource occupied information of the node after the instance is scheduled.
The actual balance degree is used for representing a balance value 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, and the first 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, for example, the first balance value is inversely proportional to the difference, that is, the smaller the difference, the larger the first balance value is; wherein, the first occupancy information percentage is a percentage of a first occupied amount of the first resource (i.e. an actual occupied amount of the first resource) to 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 actual occupied amount of the second resource) to a second total amount (i.e., a total amount of the second resource).
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 balance value may be referred to as a second balance value, and the second balance value is inversely related to a difference between the first occupancy information percentage corresponding to the first resource and the second occupancy information percentage corresponding to the second resource, for example, the second balance value is inversely proportional to the difference, that is, the smaller the difference, the larger the second balance value; wherein, the first occupied information percentage is a percentage of a first occupied amount of the first resource (i.e. the occupied amount of the first resource after the to-be-scheduled instance is scheduled to the node) to a first total amount (i.e. the total amount of the first resource); the second occupied information percentage is a percentage of a second occupied amount of the second resource (i.e. the occupied amount of the second resource after the to-be-scheduled instance is supposed to be scheduled to the node) to a second total amount (i.e. the total amount of the second resource).
When the node is actually used, the balance degree of the actual balance degree or the virtual balance degree of the node can be determined according to the difference between the first occupation information percentage of the first resource and the second occupation information percentage of the second resource, and the smaller the difference 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 also 90%, and the difference between the two 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% and the second occupied information percentage of the second resource is 30%, the difference between the first occupied information percentage and the second occupied information percentage is large, which indicates that the balance degree of the actual balance degree or the virtual balance degree of the node is not good.
Step S206, determining a target node of the example to be scheduled based on the actual balance degree and the virtual balance degree of the nodes in the first node set;
when determining the target node based on the actual balance degree and the virtual balance degree of the node, the node with the virtual balance degree superior to the actual balance degree may be used as the target node, the node with the virtual balance degree and the actual balance degree within a relatively reasonable range may be used as the target node, or other manners. If more than one target node is determined, the target nodes can be sorted according to the virtual balance degree and/or the actual balance degree, and a final target node is selected based on the sorting.
And step S208, scheduling the to-be-scheduled instance to the target node.
The instance is a task or a set of tasks, and as an implementation manner, the instance to be scheduled may be a pod to be scheduled, where the pod is a minimum unit that can be created and deployed in a kubernets container cluster system, is an application instance in the kubernets container cluster system, and is deployed on the same node, and the pod includes one or more containers and also includes resources shared by various containers such as storage and a network.
The pod is used as a service unit which can run independently, the difficulty of application deployment is simplified, great convenience is provided for application deployment management by a higher abstraction level, the pod can also be used as a minimum application instance and can run independently, deployment, horizontal expansion and contraction are facilitated, scheduling management and resource allocation are facilitated, 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 guaranteeing normal operation, because the pod may suffer from physical failure of the node, network partitioning, and the like, and in this embodiment, the overall high availability may be achieved by selecting a target node from the first node set based on the actual balance degree and the virtual balance degree in the kubernets container cluster system to schedule the pod to be scheduled, so as to achieve normal operation of the pod.
According to the cluster resource scheduling method, resource occupied information of each node in a cluster is synchronized through a scheduling server, a first node set with the resource residual quantity meeting the resource demand quantity of an example 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.
Taking the first resource as the CPU resource and the second resource as the memory resource as an example, the first total amount is the total resource 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 resource 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, BalanceScore represents the actual balance degree, curUsedCpu represents the first occupied quantity, curUsedMem represents the second occupied quantity, cpuCapacity represents the first total quantity, memCapacity represents the second total quantity, and abs represents the absolute value operation.
Based on the actual balance formula, the virtual balance of the node is represented by newBalanceScore, which is 10-abs (newcurUsedCpu/cpuCapacity-newcurUsedMem/memCaattach) 10;
wherein newcurUsedCpu ═ reqCpu + curUsedCpu, newcurUsedMem ═ reqMem + curUsedMem, reqCpu indicates the first resource demand, reqMem indicates the second resource demand, and the physical meanings of the other variables are as described above, and are not described herein again.
Through 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 instance scheduling, so that the balance of the first resource and the second resource is still good after the target node schedules the instance.
The embodiment provides another cluster resource scheduling method, which is implemented on the basis of the embodiment; the embodiment focuses on a specific implementation of determining a target node of an instance to be scheduled. As shown in fig. 3, another flow chart of a cluster resource scheduling method, the cluster resource scheduling method 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 the instances 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 a balance value 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;
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 the nodes in the first node set except the enhanced node group;
when the node group division is performed on the first node set, the magnitude relationship 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 relationship. The specific division mode is as follows:
(1) if the virtual balance degree of a node is greater than the actual balance degree, the balance degree of the first resource and the second resource is better after the node is scheduled, and the node can be placed into an enhanced node group.
(2) If the virtual balance degree of a node is equal to the actual balance degree, the balance degree of the first resource and the balance degree of the second resource are the same as before and are not deteriorated after the node is scheduled, and the node can also be placed into an enhanced node group; 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 a strengthening node group as an example.
(3) If the virtual balance degree of a node is smaller than the actual balance degree, the balance degree of the first resource and the second resource is worse after the node is scheduled, and the node can be placed into a weakening node group.
By the division mode of the enhanced node group and the weakened node group, after the nodes in the first node set are scheduled, the balance degree of the first resource and the second resource has a trend of becoming better, and after the nodes are scheduled, the balance degree of the first resource and the second resource has a trend of becoming worse, so that a powerful reference basis is provided for subsequently selecting a target node.
Step S308, determining a target node of the instance to be scheduled according to the size of the virtual balance degree on the basis 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 instance scheduling is better than the resource balance of the nodes in the weakened node group after instance scheduling, the nodes in the first node set can be scheduled and prioritized 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 enhanced node group is greater than that of the weakened node group, so all nodes in the enhanced node group are arranged in front of all nodes in the weakened node group; 2. the internal ordering of the enhanced node group is ranked more ahead with higher priority with large virtual balance, and the internal ordering of the node group is weakened, which is not described herein.
To better store the nodes in the enhanced node group and the nodes in the weakened node group, and continue to take the pod to be scheduled as an example, 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, which are a plurality of nodes N in the enhanced node group, may be stored in the storage area 400X、NX+1、NX+2… …, the data are stored in sequence from large to small according to the virtual balance degree; storing in memory 401 a node in a de-emphasis node group of which a plurality of nodes Ny、Ny+1、Ny+2… …, are also stored in descending order of virtual balance. The step of determining the target node of the pod to be scheduled based on the scheduling priority ranking and the size of the virtual balance degree can be realized by the steps a 1-A3:
step A1, selecting the node with the maximum virtual balance degree or the node with the virtual balance degree larger than the set threshold value from the enhanced node group as the undetermined node;
in this embodiment, a node with the largest virtual balance degree in the enhanced node group may be selected as a node to be determined, or one or more nodes are randomly selected from nodes with a virtual balance degree greater than a set threshold value in the enhanced node group as a node to be determined, where the set threshold value may be set according to actual needs, and is not limited herein.
Step A2, if the undetermined node meets the preset condition, the undetermined node is used as a target node of the pod to be scheduled; the preset conditions include: if the pod to be scheduled is scheduled to the node to be scheduled, the first occupied amount of the scheduled node to be scheduled 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 node to be determined is greater than the preset tolerance.
If the node with the largest virtual balance degree selected in the step a1 meets the preset condition, the node can be determined as a target node; if all the nodes with the virtual balance degree greater than the set threshold selected in the step a1 satisfy the preset condition, any one of the nodes may be used as the target node.
The preset conditions include two conditions, one: if the pod to be scheduled is scheduled to the node to be scheduled, the first occupied amount of the scheduled node to be scheduled is smaller than a preset first value, and the second occupied amount is smaller than a preset second value; and a second condition: and the virtual balance degree of the node to be determined is greater than the preset tolerance. The preset condition may include one of the following cases: (1) if the condition I and the condition II are simultaneously satisfied, the node to be determined meets a preset condition; (2) only paying attention to the condition one, and immediately considering that the node to be determined meets the preset condition as long as the condition one is met; (3) only paying attention to the condition two, as long as the condition two immediately considers that the node to be determined meets the preset condition. The implementation form of the preset condition may be selected from (1), (2), and (3), which is not limited in this embodiment.
Because the cluster services (i.e., pod to be scheduled) are different, the resource demand is also different, for example, for an enhanced learning AI (Artificial Intelligence) training task, the resource demand of a single pod is 30 cores, 120G; in a common AI training task, the resource demand of a single pod is 4 cores and 8G; the demand of a single pod resource is 2 cores and 4G in online application; different service types and different resource demands have different threshold point settings (i.e. at least one of the preset first value, the preset second value and the preset tolerance), where at least one of the preset first value, the preset second value and the preset tolerance is a value corresponding to a service of a 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 size 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 node to be scheduled, and the first occupied amount of the scheduled node to be scheduled 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 node to be scheduled is not greater than a preset tolerance and meets any one of the determination conditions, it may be determined that the node to be scheduled does not meet the preset condition.
If the undetermined node selected in step a1 does not satisfy the preset condition, then the node with the second largest virtual balance degree may be selected as the undetermined node according to the size of the virtual balance degree, and it is determined again whether the undetermined node satisfies the preset condition, if the undetermined node satisfies the preset condition, it is determined as the target node of the pod to be scheduled, and if the undetermined node does not satisfy the preset condition, the node with the third largest virtual balance degree is selected as the undetermined node to determine the target node, and so on, and no further description is given here until the selected undetermined node satisfies the preset condition, and the node satisfying the preset condition is determined as the target node.
Step S310, the example to be scheduled is scheduled to the target node.
In this embodiment, the target node determined by the principle that the enhanced node group is superior to the weakened node group and the virtual balance degree may be used to perform scheduling operation on the to-be-scheduled instance.
The method for scheduling cluster resources provided by the embodiment of the invention can determine the target node by dividing the nodes into the enhanced node group and the weakened node group, 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 before scheduling), on the other hand, the situation that the original nodes with good balance degree are deteriorated due to the balance degree after scheduling is avoided as much as possible; the reasonability and the overall balance of instance scheduling are guaranteed to a certain extent.
Of course, as an implementation manner, when the step a1 is executed to obtain the to-be-determined node, the to-be-determined node may also be directly used as a target node to perform subsequent pod scheduling. Compared with a mode that the undetermined node meeting the preset conditions is taken as a target node, the resource balance degree of the undetermined node after being scheduled is not optimal, but the undetermined node in the mode is selected from the enhanced node group, so that the resource balance degree after scheduling the pod is ensured to a certain extent. And if all the nodes in the enhanced node group do not meet the preset conditions, the node is cancelled and the undetermined node is selected from the weakened node group, and the selection mode can also be selected according to the sequence of all the nodes in the weakened node group until the undetermined node meeting the preset conditions is found.
The embodiment provides another cluster resource scheduling method, which is implemented on the basis of the embodiment; the embodiment focuses on a specific implementation of determining a target node of an instance to be scheduled. As shown in fig. 5, another flow chart of a cluster resource scheduling method, the cluster resource scheduling method in this embodiment includes the following steps:
step S502, selecting a first node set from the cluster; the resource surplus of the nodes in the first node set meets the resource demand of the instances 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 a balance value 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;
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 the nodes in the first node set except the enhanced node group;
step S508, selecting the node with the maximum virtual balance degree or the node with the virtual balance degree larger than the set threshold value from the enhanced node group as the node to be determined;
step S510, if the undetermined node does not meet the preset condition, assuming that the instances to be scheduled are scheduled to the nodes in the enhanced node group and the weakened node group one by one;
step S512, calculating the ratio of the resource surplus of the scheduled node; the resource surplus proportion is equal to the sum of the resource surplus proportion of the first resource and the resource surplus proportion of the second resource of the node;
for convenience of illustration, the ratio of the remaining amount of resources of each node in the first node set after the scheduling instance can be calculated by the following formula:
surplusScore=(surplusCpu/cpuCapacity+surplusMemory/memCapacity)/2;
the surfussscore represents a ratio of the remaining amount of the resource, the surfluccpu represents the remaining amount of the resource of the first resource, and the surfmemory represents the remaining amount of the resource of the second resource.
Wherein, the resource residual amount of the first resource is surplus-curUsedCpu;
the remaining amount of the second resource, suprplucmemory, memcapacid-secure mem.
Step S514, determining a target node of the example to be scheduled based on the virtual balance and the ratio of the resource surplus of the nodes in the enhanced node group and the weakened node group;
specifically, the step of determining the target node of the instance to be scheduled may be implemented by step B1 and step B2:
step B1, respectively calculating the weighted balance degree of the nodes for the nodes in the enhanced node group and the weakened node group;
weighted balance Score ═ λ newBalanceScore + ω surfussscore;
wherein λ is a preset first weight, newBalanceScore is a virtual balance degree of the node, ω is a preset second weight, and suprplus Score is a resource remaining amount ratio of the node.
In general, λ + ω is 1, since there is a higher tendency for more nodes to remain in the resource when selecting the target node based on the weighted balance, in the embodiment, λ < ω will be set.
And step B2, selecting the node with the maximum weighting balance degree as the target node of the to-be-scheduled instance.
Step S516, the example to be scheduled is scheduled to the target node.
And B2, taking the node with the maximum weighting balance selected in the step B as a target node to perform example scheduling operation.
According to the cluster resource scheduling method provided by the embodiment of the invention, when the undetermined node is determined not to meet the preset condition, the weighting balance degree of each node in the first node set is calculated, the node with the largest weighting balance degree is selected as the target node for instance scheduling, and the target node is selected based on the weighting balance degree, so that the instances are scheduled to the nodes with more residual resources as far as possible under the condition that the balance degree is guaranteed to be higher as far as possible, thereby reducing the occurrence of resource fragmentation and improving the utilization rate of resources.
In order to understand the phenomenon of resource fragmentation, the pod to be scheduled is taken as an example for explanation, fig. 6 shows a schematic diagram of resource status of a node of a scheduling pod, the left-side box in fig. 6 shows resource status of three nodes before scheduling, which are 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 slashed box, the remaining amount of resource is represented by a horizontal line, the resource demand of the pod to be scheduled is shown in the upper left corner of fig. 6, and it can be known through equilibrium calculation that the equilibrium degree of the node N1 after scheduling is better than others, so that the pod can be scheduled onto the node N1, the right-side box in fig. 6 shows resource status of three nodes after scheduling the pod onto the node N1, the remaining amount of CPU resource of the node N1 is smaller, which is not beneficial for scheduling of the following pod, so that the node N1 generates non-schedulable fragmented resource, as shown in the right box of FIG. 6, since node N2 and node N3 do not perform pod scheduling, the resources of node N2 and node N3 do not change before and after scheduling.
To fully illustrate that, by using the method of this embodiment, under the condition of ensuring the high balance as much as possible, the pod is scheduled to the node with more remaining 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 diagram of resource status of a node scheduling pod, where the upper left corner in fig. 7 not only shows the resource demand of a pod to be scheduled, but also shows the resource demand of a subsequent new pod to be scheduled, and since the remaining amount of resources of the node N2 and the node N3 is greater than the remaining amount of resources of the node N1, and the remaining amount of resources of the node N2 and the node N3 are the same, a pod to be scheduled may be scheduled on the node N2 or the node N3, for example, the pod to be scheduled is scheduled on the node N2 for description, as can be seen from fig. 7, after the subsequent new pod is scheduled on the node N2, the balance degree of the node can be raised, and the remaining amount of non-schedulable resources is small, so that resource fragmentation is reduced to some extent, the cluster resource utilization rate is raised, and the pod scheduling is optimized.
Corresponding to the above method embodiment, an embodiment of the present invention provides a device for scheduling cluster resources, where resource occupied information of each node in a cluster is synchronized by a scheduling server, 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; fig. 8 is a schematic structural diagram of an apparatus for cluster resource scheduling, where as shown in fig. 8, the apparatus includes:
a selecting module 802 for selecting a first set of nodes from a cluster; the resource surplus of the nodes in the first node set meets the resource demand of the instances 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 a balance value 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;
a determining module 806, configured to determine a target node of an instance to be scheduled based on an actual degree of balance and a virtual degree of balance of nodes in the first node set;
and a scheduling module 808, configured to schedule the instance to be scheduled to the target node.
The embodiment of the invention provides a cluster resource scheduling device, wherein resource occupied information of each node in a cluster is synchronized through a scheduling server, a first node set with the resource residual quantity meeting the resource demand of a to-be-scheduled example 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 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 the nodes in the first node set except the enhanced node group; and determining the target node of the instance to be scheduled according to the size of the virtual balance degree on the basis that the enhanced node group is superior to the weakened node group.
The determining module 806 is further configured to select, as an undetermined node, a node with the maximum virtual balance degree or a node with a virtual balance degree greater than a set threshold from the enhanced node group; if the node to be determined meets the preset condition, taking the node to be determined as a target node of the instance to be scheduled; the preset conditions include: if the to-be-scheduled instance 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; or the virtual balance degree of the node to be determined is greater than the preset tolerance.
At least one of the preset first value, the preset second value and the preset tolerance is a value corresponding to a service of the cluster.
The determining module 806 is further configured to, if the node to be determined does not satisfy the preset condition, select a next node to be determined from the enhanced node group based on the size of the virtual balance degree until the selected node to be determined satisfies the preset condition.
The determining module 806 is further configured to assume that the to-be-scheduled instances are scheduled to the nodes in the enhanced node group and the weakened node group one by one if the to-be-scheduled node does not satisfy the preset condition; calculating the ratio of the resource surplus of the scheduled node; the resource surplus proportion is equal to the sum of the resource surplus proportion of the first resource and the resource surplus proportion of the second resource of the node; and determining a target node of the instance to be scheduled based on the virtual balance and the ratio of the resource surplus 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, the weighted balance degrees of the nodes respectively; weighted balance Score ═ λ newBalanceScore + ω surfussscore; lambda is a preset first weight, newBalanceScore is a virtual balance degree of the node, omega is a preset second weight, and suprplus Score is a ratio of the resource surplus of the node; and selecting the node with the maximum weighting balance degree as a target node of the to-be-scheduled instance.
Generally, the λ < ω mentioned above. The balance value is inversely related to the difference between the first occupancy information percentage corresponding to the first resource and the 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 occupancy information percentage is a percentage of a second occupied amount of the second resource to a second total amount; the first resource is a CPU resource, and the second resource is a memory resource.
The device for dispatching cluster resources provided by the embodiment of the invention has the same technical characteristics as the method for dispatching 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, which is used for operating the rendering method of the target model; referring to fig. 9, a schematic structural diagram of 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 above cluster resource scheduling method.
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 by the bus 902.
The Memory 900 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 903 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. Bus 902 can be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 9, but this does not indicate only one bus or one type of bus.
The processor 901 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be implemented by integrated logic circuits of hardware or instructions in the form of software in the processor 901. The Processor 901 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. The various methods, steps and logic blocks disclosed 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 directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 900, and the processor 901 reads the information in the memory 900 and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
The embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the method for scheduling cluster resources, where specific implementation may refer to method embodiments, and details are not described herein again.
The method and apparatus for scheduling cluster resources and the computer program product of the electronic device provided in the embodiments of the present invention include a computer-readable storage medium storing program codes, where instructions included in the program codes may be used to execute the method described in the foregoing method embodiments, and specific implementations may refer to the method embodiments and are not described herein again.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the electronic device and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present invention can be understood in specific cases for those skilled in the art.
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 such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute 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), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular 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: although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that the following embodiments are merely illustrative of the present invention, and not restrictive, and the scope of the present invention is not limited thereto: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A method for cluster resource scheduling is characterized in that resource occupied information of each node in a cluster is synchronized through a scheduling server, 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; 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 the instances 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 a balance value 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 and the virtual balance of the nodes in the first node set;
and scheduling the instance to be scheduled to the target node.
2. The method of claim 1, wherein the step of determining the target node of the instance to be scheduled based on the actual degree of balance and the virtual degree of balance of the nodes in the first set of nodes comprises:
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 the nodes in the first node set except the enhanced node group;
and determining the target node of the instance to be scheduled according to the size of the virtual balance degree on the basis 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 size of the virtual balance degree on the basis that the enhanced node group is better than 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 node to be determined meets a preset condition, taking the node to be determined as a target node of the instance to be scheduled; the preset conditions include: if the to-be-scheduled instance is scheduled to the to-be-determined node, the first occupied amount of the scheduled to-be-determined 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 node to be determined is greater than a preset tolerance.
4. The method of 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. The method according to claim 3, wherein the step of determining the target node of the instance to be scheduled according to the size of the virtual balance degree on the basis that the enhanced node group is better than the weakened 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 size of the virtual balance degree until the selected undetermined node meets the preset condition.
6. The method according to claim 3, wherein the step of determining the target node of the instance to be scheduled according to the size of the virtual balance degree on the basis that the enhanced node group is better than the weakened node group comprises:
if the node to be scheduled does not meet the preset condition, assuming that the instances to be scheduled are scheduled to the nodes in the enhanced node group and the weakened node group one by one;
calculating the ratio of the resource surplus of the scheduled node; the resource surplus proportion is equal to the sum of the resource surplus proportion of the first resource and the resource surplus proportion 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 surplus ratio of the nodes in the enhanced node group and the weakened node group.
7. The method according to claim 6, wherein the step of determining the target node of the instance to be scheduled based on the ratio of the virtual balance and the resource remaining amount of the nodes in the enhanced node group and the weakened node group comprises:
respectively calculating the weighted balance degree of the nodes in the enhanced node group and the weakened node group; the weighted balance Score ═ λ newBalance Score + ω sunscreen Score; λ is a preset first weight, newBalanceScore is a virtual balance degree of the node, ω is a preset second weight, and suprplus Score is a ratio of the resource residual amount of the node;
and selecting the node with the maximum weighting balance degree as the target node of the to-be-scheduled example.
8. The method of claim 7, wherein λ < ω.
9. The method of claim 1, wherein the balance value is inversely related to a difference between a first percentage of occupancy information corresponding to the first resource and a second percentage of occupancy information 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 occupancy information percentage is a percentage of a second occupied amount of the second resource to a second total amount;
the first resource is a CPU resource, and the second resource is a memory resource.
10. A cluster resource scheduling device is applied to a scheduling server, resource occupied information of each node in a cluster is synchronized through the scheduling server, and 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; the device comprises:
a selection module to select a first set of nodes from the cluster; the resource surplus of the nodes in the first node set meets the resource demand of the instances to be scheduled;
a calculation module, configured to calculate an actual degree of balance and a virtual degree of balance of nodes in the first node set; the actual balance degree is used for representing a balance value 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;
a determining module, configured to determine a target node of the to-be-scheduled instance based on an actual balance degree and a virtual balance degree of nodes in the first node set;
and the scheduling module is used for scheduling the example to be scheduled to the target node.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method of cluster resource scheduling according to any of the preceding claims 1-9 when executing the computer program.
12. A computer-readable storage medium, having stored thereon a computer program for performing, when being executed by a processor, the steps of the method for cluster resource scheduling according to any of the previous 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 true CN111858069A (en) 2020-10-30
CN111858069B 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)

Cited By (2)

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

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213595A (en) * 2017-07-07 2019-01-15 中兴通讯股份有限公司 Load equilibration scheduling method, device and computer readable storage medium
CN110167031A (en) * 2019-05-13 2019-08-23 中国科学院计算技术研究所 A kind of resource allocation methods towards centralized base station, equipment and storage medium
CN110457131A (en) * 2019-07-31 2019-11-15 华中科技大学 Electric system supercomputer platform method for scheduling task based on Docker container
US20200019444A1 (en) * 2018-07-11 2020-01-16 International Business Machines Corporation Cluster load balancing based on assessment of future loading
CN111143063A (en) * 2019-12-24 2020-05-12 青岛海尔科技有限公司 Task resource reservation method and device
US20200167189A1 (en) * 2018-11-28 2020-05-28 International Business Machines Corporation Elastic load balancing prioritization
CN111475251A (en) * 2020-03-08 2020-07-31 苏州浪潮智能科技有限公司 Cluster container scheduling method, system, terminal and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213595A (en) * 2017-07-07 2019-01-15 中兴通讯股份有限公司 Load equilibration scheduling method, device and computer readable storage medium
EP3629163A1 (en) * 2017-07-07 2020-04-01 ZTE Corporation Load balance scheduling method and device, and computer readable storage medium
US20200019444A1 (en) * 2018-07-11 2020-01-16 International Business Machines Corporation Cluster load balancing based on assessment of future loading
US20200167189A1 (en) * 2018-11-28 2020-05-28 International Business Machines Corporation Elastic load balancing prioritization
CN110167031A (en) * 2019-05-13 2019-08-23 中国科学院计算技术研究所 A kind of resource allocation methods towards centralized base station, equipment and storage medium
CN110457131A (en) * 2019-07-31 2019-11-15 华中科技大学 Electric system supercomputer platform method for scheduling task based on Docker container
CN111143063A (en) * 2019-12-24 2020-05-12 青岛海尔科技有限公司 Task resource reservation method and device
CN111475251A (en) * 2020-03-08 2020-07-31 苏州浪潮智能科技有限公司 Cluster container scheduling method, system, terminal and storage medium

Cited By (3)

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

Also Published As

Publication number Publication date
CN111858069B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
CN111427679B (en) Computing task scheduling method, system and device for edge computing
CN112269641B (en) Scheduling method, scheduling device, electronic equipment and storage medium
CN111966500B (en) Resource scheduling method and device, electronic equipment and storage medium
CN110545326B (en) Cluster load scheduling method and device, electronic equipment and storage medium
CN112015536B (en) Kubernetes cluster container group scheduling method, device and medium
CN110474966B (en) Method for processing cloud platform resource fragments and related equipment
CN106897132A (en) The method and device of a kind of server task scheduling
CN111858069A (en) Cluster resource scheduling method and device and electronic equipment
US20150363240A1 (en) System for controlling resources, control pattern generation apparatus, control apparatus, method for controlling resources and program
CN112272102B (en) Method and device for unloading and scheduling edge network service
CN112860383A (en) Cluster resource scheduling method, device, equipment and storage medium
CN109992392B (en) Resource deployment method and device and resource server
CN114625500A (en) Method and application for scheduling micro-service application based on topology perception in cloud environment
CN111159859B (en) Cloud container cluster deployment method and system
CN114020455A (en) Arranging method and device of service functions and computer readable storage medium
CN112491742B (en) Method and device for scheduling edge computing terminal resources
CN111200566B (en) Network service flow information grooming method and electronic equipment
CN113596106A (en) Time delay sensitive type slice resource scheduling method based on multi-edge server cooperation
Bensalem et al. Scaling Serverless Functions in Edge Networks: A Reinforcement Learning Approach
CN110958192B (en) Virtual data center resource allocation system and method based on virtual switch
CN116684349A (en) Method, system, electronic equipment and storage medium for distributing computing power network resources
CN111124439A (en) Intelligent dynamic unloading algorithm with cloud edge cooperation
CN116360994A (en) Scheduling method, device, server and storage medium of distributed heterogeneous resource pool
CN114461299A (en) Unloading decision determining method and device, electronic equipment and storage medium
CN114978913A (en) Service function chain cross-domain deployment method and system based on chain cutting

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