WO2024051236A1 - 资源调度方法及其相关设备 - Google Patents
资源调度方法及其相关设备 Download PDFInfo
- Publication number
- WO2024051236A1 WO2024051236A1 PCT/CN2023/099201 CN2023099201W WO2024051236A1 WO 2024051236 A1 WO2024051236 A1 WO 2024051236A1 CN 2023099201 W CN2023099201 W CN 2023099201W WO 2024051236 A1 WO2024051236 A1 WO 2024051236A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- resource
- microservice
- node
- resources
- deployed
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation 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
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation 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/5022—Mechanisms to release resources
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/505—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5072—Grid computing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5077—Logical partitioning of resources; Management or configuration of virtualized resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/70—Admission control; Resource allocation
- H04L47/83—Admission control; Resource allocation based on usage prediction
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5019—Workload prediction
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5021—Priority
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/503—Resource availability
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/508—Monitor
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/70—Admission control; Resource allocation
- H04L47/82—Miscellaneous aspects
- H04L47/822—Collecting or measuring resource availability data
Definitions
- the present application relates to the field of communication technology, and in particular, to a resource scheduling method and related equipment.
- Container as a lightweight virtualization technology, has developed rapidly in recent years.
- Container technology creates independent operating environments for different applications, realizes resource isolation, configuration and security guarantees, and can meet the resource requirements of applications on demand and ensure the isolation and availability of applications.
- cluster a computing device cluster
- k8s kubernetes
- a container collection pod
- a pod consists of a group of containers working on the same node.
- K8s mainly realizes automatic expansion and contraction through pod horizontal automatic scaling (Horizontal Pod Autoscaler, HPA) and pod vertical automatic scaling (Vertical Pod Autoscaler, VPA).
- HPA Horizontal Pod Autoscaler
- VPA Very Pod Autoscaler
- the first aspect of the embodiment of the present application discloses a resource scheduling method, which includes: obtaining the resource information of each node in the cluster, and the resource information of the container in each node, each node is equipped with a container engine; based on each The resource information of each node and the resource information of the container in each node are used to construct a resource portrait of the microservices deployed on each node.
- the microservices deployed on each node run based on one or more containers; if it is determined that in the cluster
- the first microservice deployed in requires resource adjustment.
- Based on the resource portrait of the first microservice the resource information of the first node where the first microservice is deployed, and the resource information of the container in the first node, the first microservice is generated.
- Associated resource adjustment instructions based on the container engine and resource adjustment instructions, adjust the resources of the pod associated with the first microservice.
- a resource portrait of the microservice deployed on each node is constructed, and resource adjustment is performed based on the resource portrait of the microservice, the resource information of the node, and the resource information of the container. It can fully utilize the resources of the node, make the resource adjustment of microservices more targeted, and improve the comprehensive resource utilization of the node and/or cluster. Resource adjustment is based on the container engine without affecting the existing scheduling capabilities of the cluster. Compared with resource adjustment through HPA/VPA, the lag is smaller. It can realize resource adjustment at the second level, enhance the ability of microservices deployed in the cluster to cope with sudden traffic, improve the stability of the cluster and network throughput, and improve the microservices. When adjusting resources, you can adjust resources for all pods associated with the microservice, or you can adjust resources to one or several pods in the microservice. The resource adjustment granularity is smaller and more accurate.
- building a resource portrait of the microservice deployed on each node includes: based on the resource information of the container in each node , obtain the resource information of the microservices deployed on each node; based on the resource information of each node and the resource information of the microservices deployed on each node, construct a resource portrait of the microservices deployed on each node, resources The portrait includes the resource occupation dimension and the time dimension.
- a resource portrait of the microservices deployed on each node is constructed.
- the time dimension is combined with resource occupation.
- Dimensions represent the characteristics of resources occupied by microservices at different times.
- the resource scheduling method further includes: if the difference between the resources occupied by the first microservice and the resource upper limit of the first microservice is less than the first preset threshold, determining that the first microservice needs to perform resource adjustment; or If the difference between the resources occupied by the first microservice and the resource upper limit of the first microservice is greater than the second preset threshold, it is determined that the first microservice needs to perform resource adjustment.
- microservices with insufficient resources or microservices with excess resources can be determined as microservices that require resource adjustment. For example, if the difference between the resources occupied by the microservice and the resource upper limit of the microservice is less than the first preset The threshold indicates that the resources of the microservice are tight. The microservice is expanded by triggering to meet the resource requirements required for the operation of the microservice. If the difference between the resources occupied by the microservice and the resource upper limit of the microservice is greater than the second preset The threshold indicates that when a microservice has excess resources, the microservice is triggered to scale down so that the excess resources can be allocated to other microservices with insufficient resources, which can improve the resource utilization of the node.
- the resources occupied by the first microservice include one or more of processor resources, memory resources, disk resources, and network bandwidth resources. It is determined that the first microservice needs to perform resource adjustment, including: if the first microservice If the difference between any one of the processor resources, memory resources, disk resources, and network bandwidth resources occupied by the microservice and the corresponding resource upper limit is less than the corresponding first preset threshold, it is determined that the first microservice requires resource adjustment; Or if the difference between any one of the processor resources, memory resources, disk resources and network bandwidth resources occupied by the first microservice and the corresponding resource upper limit is greater than the corresponding second preset threshold, it is determined that the first microservice needs Make resource adjustments.
- the existing processor resources, memory resources, disk resources and Microservices with insufficient network bandwidth resources, or microservices with excess processor resources, memory resources, disk resources, and network bandwidth resources are determined to be microservices that require resource adjustment to meet the requirements.
- determining that the first microservice requires resource adjustment includes: if any of the processor resources, memory resources, disk resources, and network bandwidth resources occupied by the first microservice matches the corresponding resource upper limit The difference is less than the corresponding first preset threshold, it is determined that the first microservice needs to be expanded and adjusted; or if any one of the processor resources, memory resources, disk resources and network bandwidth resources occupied by the first microservice is different from the corresponding If the difference between the resource upper limits is greater than the corresponding second preset threshold, it is determined that the first microservice needs to be scaled down.
- the difference between any one of the processor resources, memory resources, disk resources, and network bandwidth resources occupied by the microservice and the corresponding resource upper limit is less than the corresponding first preset threshold, it indicates that the microservice is A certain resource is tight, and it is determined that the resource of the microservice needs to be expanded to meet the resource requirements required for the operation of the microservice. If the microservice occupies any one of the processor resources, memory resources, disk resources, and network bandwidth resources The difference from the corresponding resource upper limit is greater than the corresponding second preset threshold, indicating that a certain resource of the microservice is in excess, and it is determined that the resource of the microservice needs to be reduced so that the excess resources can be allocated to other resources with insufficient resources. Microservices can improve the resource utilization of nodes.
- generating a resource adjustment instruction associated with the first microservice based on the resource portrait of the first microservice, resource information of the node where the first microservice is deployed, and resource information of the container in the node includes: based on the first microservice The resource portrait of a microservice predicts the number of resources required by the first microservice; based on the predicted number of resources, the resource information of the node where the first microservice is deployed, and the resource information of the container in the node, a resource profile associated with the first microservice is generated. Resource adjustment instructions.
- the number of resources required by the microservice is predicted through the resource portrait of the microservice, and then resources are allocated to the microservice based on the predicted number of resources, the resource information of the node where the microservice is deployed, and the resource information of the container in the node, so that The resource adjustment of microservices is more accurate, avoiding excessive or insufficient resource allocation and improving node resource utilization.
- generating resource adjustment instructions associated with the first microservice includes: generating resource adjustment instructions for all pods associated with the first microservice; or generating resource adjustment instructions for a specified pod associated with the first microservice.
- the resource adjustment instruction associated with the first microservice when generating the resource adjustment instruction associated with the first microservice, you can choose to adjust the resources for all pods associated with the microservice, or you can precisely adjust the resources for one or several pods in the microservice. Resource adjustment, the adjusted pod can make the microservice have enough resources to cope with the current increase in business volume/traffic.
- adjusting the resources of the pod associated with the first microservice based on the container engine and the resource adjustment instruction includes: determining the pod associated with the resource adjustment instruction, and calling the resource adjustment application program interface through the container engine to adjust the resource. Instruct the associated pod to adjust resources.
- the resource adjustment instruction is to adjust the resources of all pods associated with the microservice, or to adjust the resources of one or more of the microservices.
- Resource adjustment is performed on several pods, and the resource adjustment application interface is called by the container engine to adjust resources for the specified pod.
- the hysteresis of resource adjustment is small and second-level resource adjustment can be achieved, which enhances the ability of microservices deployed in the cluster to cope with sudden traffic. .
- the microservices deployed on each node are configured with priorities
- the resource scheduling method also includes: if the remaining resources of the first node cannot meet the resource adjustment requirements of the first microservice, release the resources deployed on the first node. Part of the resources occupied by the second microservice, the priority of the second microservice is lower than the priority of the first microservice.
- each microservice can be configured with different priorities in a preset manner. If the node resources are tight and cannot meet the resource adjustment requirements of the microservices deployed on the node, the microservices deployed on the node can be released with a lower priority than the microservice. resources of a certain microservice, so that the node has enough free resources to allocate to the microservice that needs resource adjustment.
- releasing part of the resources occupied by the second microservice deployed on the first node includes: releasing part of the resources occupied by the second microservice according to the resource portrait of the second microservice.
- the microservices deployed on each node are configured with priorities
- the resource scheduling method also includes: if the remaining resources of the first node cannot meet the resource adjustment requirements of the first microservice, the microservices deployed on the first node are The second microservice is scheduled to other nodes in the cluster, and the priority of the second microservice is lower than the priority of the first microservice.
- each microservice can be configured with different priorities in a preset manner.
- node resources are tight and cannot meet the resource adjustment needs of the microservices deployed on the node, if resources cannot be freed from low-priority microservices, Or instead of adopting the strategy of allocating resources from low-priority microservices, you can also migrate a microservice deployed on the node with a lower priority than the microservice to other nodes so that the node has enough idle resources. Assigned to microservices that require resource adjustment.
- scheduling the second microservice deployed on the first node to other nodes in the cluster includes: based on the resource portrait of the microservice deployed on the first node, selecting the second microservice deployed on the first node to be scheduled to other nodes in the cluster. The second microservice.
- the second aspect of the embodiment of the present application discloses a resource scheduling method, which includes: obtaining the resource information of each node in the cluster, and the resource information of the container in each node, and each node is installed There is a container engine; in response to the startup instruction of the first microservice deployed in the cluster, a first pod is created for the first microservice, and the first pod is set with a first resource upper limit; based on the first deployment of the first microservice The resource information of the node and the resource information of the container in the first node are used to generate a resource adjustment instruction associated with the first pod; based on the container engine and the resource adjustment instruction, the resource occupancy upper limit of the first pod is set to the first resource upper limit value. Adjusted to the second resource upper limit value, the second resource upper limit value is greater than the first resource upper limit value.
- the upper limit of resource occupancy allocated by the system for the microservice is increased to achieve rapid Start microservices, shorten the startup time of microservices, and adjust resources based on the container engine.
- the lag is smaller than resource adjustment through HPA/VPA, and second-level resource adjustment can be achieved. Quickly respond to resource requirements required for microservice startup.
- the resource scheduling method further includes: if it is determined that the first microservice is successfully started, adjusting the resource occupation upper limit of the first pod from the second resource upper limit value to the first resource upper limit value.
- the resources previously allocated to the microservice in order to shorten the startup time of the microservice will be recycled to avoid excessive microservice resources and improve the resource utilization of the node.
- embodiments of the present application provide a resource scheduling device, including: a first acquisition module, configured to acquire resource information of each node in the cluster and resource information of containers in each node, where each node Container engine is installed; the building module is used to build a resource portrait of the microservices deployed on each node based on the resource information of each node and the resource information of the container in each node, in which the resource portrait deployed on each node
- the microservice runs based on one or more containers;
- the first generation module is used to deploy the first microservice based on the resource portrait of the first microservice and the first step of deploying the first microservice when resource adjustment is required.
- the resource information of the node and the resource information of the container in the first node generate a resource adjustment instruction associated with the first microservice; the first adjustment module is used to adjust the pod associated with the first microservice based on the container engine and the resource adjustment instruction.
- a resource portrait of the microservice deployed on each node is constructed, and resource adjustment is performed based on the resource portrait of the microservice, the resource information of the node, and the resource information of the container. It can fully utilize the resources of the node, make the resource adjustment of microservices more targeted, and improve the comprehensive resource utilization of the node and/or cluster. Resource adjustment is based on the container engine without affecting the existing scheduling capabilities of the cluster. Compared with resource adjustment through HPA/VPA, the lag is smaller. It can realize resource adjustment at the second level, enhance the ability of microservices deployed in the cluster to cope with sudden traffic, improve the stability of the cluster and network throughput, and improve the microservices. When adjusting resources, you can adjust resources for all pods associated with the microservice, or you can adjust resources to one or several pods in the microservice. The resource adjustment granularity is smaller and more accurate.
- embodiments of the present application provide a resource scheduling device, including: a second acquisition module for acquiring resource information of each node in the cluster and resource information of containers in each node.
- a container engine is installed; a module is created to create a first pod for the first microservice in response to a startup instruction of the first microservice deployed in the cluster, and the first pod is set with a first resource upper limit.
- the second generation module is used to generate resource adjustment instructions associated with the first pod based on the resource information of the first node where the first microservice is deployed and the resource information of the container in the first node; the second adjustment module is used Based on the container engine and the resource adjustment command, the resource usage upper limit of the first pod is adjusted from the first resource upper limit value to the second resource upper limit value, and the second resource upper limit value is greater than the first resource upper limit value.
- the upper limit of resource occupancy allocated by the system for the microservice is increased to achieve rapid Start microservices, shorten the startup time of microservices, and adjust resources based on the container engine.
- the lag is smaller than resource adjustment through HPA/VPA, and second-level resource adjustment can be achieved. Quickly respond to resource requirements required for microservice startup.
- embodiments of the present application provide a computer-readable storage medium, including computer program instructions.
- the computer program instructions When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the resources described in the first or second aspect. Scheduling method.
- embodiments of the present application provide a computing device cluster, including at least one computing device, each computing device including a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device , so that the computing device cluster executes the resource scheduling method as described in the first aspect or the second aspect.
- embodiments of the present application provide a computer program product, which when the computer program product is run by a computing device cluster, causes the computing device cluster to execute the resource scheduling method described in the first or second aspect.
- An eighth aspect provides a device that has the function of implementing the computing device cluster behavior in the method provided in the first aspect.
- Functions can be implemented by hardware, or by hardware executing corresponding software.
- Hardware or software includes one or more modules corresponding to the above functions.
- the computer-readable storage medium described in the fifth aspect, the computing device cluster described in the sixth aspect, the computer program product described in the seventh aspect, and the device described in the eighth aspect provided above can be combined with the above-mentioned third aspect.
- the methods of the first aspect and/or the second aspect correspond to each other. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods provided above, and will not be described again here.
- Figure 1 is a schematic architectural diagram of a cloud computing system provided by an embodiment of the present application.
- Figure 2 is a schematic structural diagram of a computing device provided by an embodiment of the present application.
- Figure 3 is a schematic structural diagram of a computing device cluster provided by an embodiment of the present application.
- Figure 4 is a schematic architectural diagram of a resource scheduling system provided by an embodiment of the present application.
- Figure 5 is a schematic diagram of the interaction flow of the resource scheduling system provided by an embodiment of the present application for resource scheduling in a microservice traffic change scenario;
- Figure 6 is a schematic diagram of the interactive process of resource scheduling in a microservice startup scenario by the resource scheduling system provided by an embodiment of the present application;
- Figure 7 is a schematic diagram of resource changes in the startup phase of the microservice provided by an embodiment of the present application.
- Figure 8 is a schematic flowchart of a resource scheduling method provided by an embodiment of the present application.
- Figure 9 is a schematic flowchart of a resource scheduling method provided by another embodiment of the present application.
- Figure 10 is a schematic diagram of the functional modules of the first resource scheduling device provided by an embodiment of the present application.
- Figure 11 is a schematic diagram of the functional modules of the second resource scheduling device provided by another embodiment of the present application.
- k8s is a container cluster management system open sourced by Google. k8s can build a container scheduling service. The purpose is to allow users to manage cloud container clusters through k8s clusters without requiring users to perform complicated settings. The system will automatically select appropriate working nodes to perform specific container cluster scheduling and processing work. Its core concept is container pod.
- a container collection (pod) consists of a group of containers working on the same worker node. Pod is the most basic deployment unit of k8s.
- a pod can encapsulate one or more containers (containers), storage resources (volume), an independent network IP, and policy options to manage and control the running mode of the container. Pod can logically be used to identify an instance of a certain application.
- a pod When a pod encapsulates multiple containers, usually the multiple containers in this scenario include a main container and several auxiliary containers (SideCar containers).
- a web application consists of three components: front-end, back-end and database. These three components run in their own containers.
- the main container can be the web application front-end. For this example, it can contain pods of three containers.
- LTE long term evolution
- WiMAX global interoperability for microwave access
- 5G fifth Generation
- NR new radio access technology
- FIG. 1 it is a schematic architectural diagram of a cloud computing system provided by an embodiment of the present application.
- This embodiment includes a master 101 and a node 102.
- the node 102 can be a virtual computing device or a physical computing device, and several pods can be deployed on one node 102 .
- the manager 101 is the central management module of the container cluster management system.
- the manager 101 can be regarded as a set of processes that manage the container life cycle.
- the manager 101 is a k8s master, and the manager 101 may include a control module (controller), a scheduling module (scheduler), an application programming interface server (application programming interface server, API server) module, etc.
- These processes implement management functions such as resource management, pod deployment, and system establishment of the entire computing device cluster.
- the API server module provides the only operation entrance for resource objects, that is, the interface module that provides functions for users.
- the control module is responsible for the unified management and control of various container models, such as CRUD (create, read, update and delete) operations on the container model.
- a container model may, for example, indicate one or more of the following information: the number of containers included in a pod, the type of application running in the container, the maximum value of each type of resource used by the container while working, which container requires Monopolize CPU and other information.
- the scheduling module is responsible for selecting appropriate nodes 102 for deployed units (containers or pods), etc.
- the manager 101 may run on a certain node 102 in the computing device cluster, or on several nodes 102 in the computing device cluster (for high availability purposes).
- Node 102 is mainly responsible for running containers. Each node 102 can also run components such as kubelet and container engine, and is responsible for managing the life cycle of pods on this node.
- the kubelet is used to process tasks issued by the manager 101 to this node and manage pods and containers in the pod.
- Kubelet can register the node's own information on the application programming interface service module, regularly report the usage of the node resources to the manager 101, and can monitor container and node resources through cAdvisor.
- a container engine may be responsible for deploying containers, and the container engine may be a Docker component, for example.
- a microservice can run on one or more containers.
- Microservices is a cloud-native architectural approach in which a single application is composed of many smaller components or services that are loosely coupled and independently deployable.
- Each microservice can run in its own independent process, and microservices can communicate with each other using lightweight communication mechanisms (such as RESTful API based on HTTP).
- Each microservice can be built around a specific business and can be independently deployed to production environments, production-like environments, etc.
- users, tenants, or managers can issue instructions to deploy pods to the manager 101 according to business needs.
- the instructions can include: the number of pods, the number of containers contained in each pod, the minimum resource requirements (Request) and the maximum resource value (Limit) used by each container when working, and other information.
- the resources referred to in the embodiment of this application may include CPU resources, memory resources, network bandwidth resources, disk resources, etc.
- the resource request or resource limit of a pod refers to the sum of the resource requests or resource limits of all containers in the pod.
- the pods in the node 102 can be distinguished by the pod name or Internet Protocol (IP), and multiple nodes 102 can also be distinguished by the node name or IP.
- IP Internet Protocol
- a computing device 100 provided by an embodiment of the present invention includes: a processor 1001, a memory 1002, a bus 1003, an input and output interface 1004, and a communication interface 1005.
- the bus 1003 is used to connect the processor 1001, the memory 1002, the input and output interface 1004 and the communication interface. 1005, and implement data transmission between the processor 1001, the memory 1002, the input and output interface 1004 and the communication interface 1005.
- the processor 1001 receives a command from the input/output interface 1004 through the bus 1003, decrypts the received command, and performs calculation or data processing according to the decrypted command.
- the memory 1002 may include program modules, such as kernel, middleware, application program interface (AP), and applications.
- Program modules may be composed of software, firmware, hardware, or at least two of them.
- the input and output interface 1004 forwards commands or data input by the user through input devices (such as sensors, keyboards, and touch screens).
- the communication interface 1005 connects the computing device 100 to other computing devices and networks.
- the communication interface 1005 may be connected to a network through a wired or wireless connection to connect to other external computing devices.
- the computing device 100 may also include a display device for displaying configuration information input by the user and displaying an operation interface to the user.
- the processor 1001 may include a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (digital signal). processor, DSP) and other processors.
- CPU central processing unit
- GPU graphics processing unit
- MP microprocessor
- DSP digital signal processor
- Memory 1002 includes volatile memory, such as random access memory (RAM).
- RAM random access memory
- the memory 1002 may also include non-volatile memory (non-volatile memory), such as read-only memory (ROM), flash memory, mechanical hard disk (hard disk drive, HDD) or solid state drive (solid state drive). ,SSD).
- ROM read-only memory
- HDD hard disk drive
- SSD solid state drive
- the bus 1003 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
- the bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one line is used in Figure 2, but it does not mean that there is only one bus or one type of bus.
- Bus 1003 may include a path that carries information between various components of computing device 100 (eg, memory 1002, processor 1001, communications interface 1005).
- the communication interface 1005 uses transceiver modules such as, but not limited to, network interface cards and transceivers to implement communication between the computing device 100 and other devices or communication networks.
- executable program code is stored in the memory 1002, and the processor 1001 executes the executable program code to respectively implement the first acquisition module 201, the construction module 202, and the first generation shown in Figure 10 below.
- the functions of the module 203 and the first adjustment module 204 are implemented to implement the resource scheduling method shown in FIG. 8 . That is, the memory 1002 stores instructions for executing the resource scheduling method shown in FIG. 8 .
- the processor 1001 executes the executable program code, it can also realize the functions of the second acquisition module 301, the creation module 302, the second generation module 303 and the second adjustment module 304 shown in Figure 11 below, thereby realizing the functions shown in Figure 9
- the computing device cluster 1000 includes at least one computing device, such as the first computing device 100A and the second computing device 100B in FIG. 3 .
- the computing device 100 may be a server, such as a central server, an edge server, or a local server in a local data center.
- the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
- computing device cluster 1000 includes at least one computing device.
- the memory 1002 of one or more computing devices in the computing device cluster may store the same instructions for executing the resource scheduling method shown in FIG. 8 , or the instructions for the resource scheduling method shown in FIG. 8 .
- the memory 1002 of one or more computing devices in the computing device cluster may also store memory for executing the resource scheduling method shown in Figure 8 or the resource scheduling method shown in Figure 9. Partial instructions.
- a combination of one or more computing devices may jointly execute instructions for performing the resource scheduling method shown in FIG. 8 , or the instructions for the resource scheduling method shown in FIG. 9 .
- the memory 1002 in different computing devices in the computing device cluster can store different instructions, respectively used to execute part of the functions of the resource scheduling device. That is, the instructions stored in the memory 1002 in different computing devices 100 can implement the functions of one or more modules among the first acquisition module 201, the construction module 202, the first generation module 203 and the first adjustment module 204, or implement Functions of one or more of the second acquisition module 301, the creation module 302, the second generation module 303 and the second adjustment module 304.
- one or more computing devices in a cluster of computing devices may be connected through a network.
- the network may be a wide area network or a local area network, etc.
- Figure 3 shows a possible implementation.
- two computing devices hereinafter referred to as a first computing device 100A and a second computing device 100B for ease of distinction
- the connection to the network is made through a communication interface in each computing device.
- instructions for executing the functions of the first acquisition module 201 and the construction module 202 may be stored in the memory 1002 of the first computing device 100A.
- instructions for performing the functions of the first generation module 203 and the first adjustment module 204 may be stored in the memory 1002 in the second computing device 100B.
- instructions for executing the functions of the second acquisition module 301 and the creation module 302 may also be stored in the memory 1002 of the first computing device 100A.
- instructions for executing the functions of the second generation module 303 and the second adjustment module 304 may also be stored in the memory 1002 in the second computing device 100B.
- connection method between the computing device clusters shown in Figure 3 can be implemented by considering that the resource scheduling method provided by this application requires a large amount of data storage and reading, so the first generation module 203 and the first adjustment module 204 are considered to be implemented.
- the functions are performed by the second computing device 100B.
- first computing device 100A shown in FIG. 3 can also be performed by multiple computing devices 100 .
- second computing device 100B can also be completed by multiple computing devices 100 .
- the resource scheduling system 10 includes a manager 101, nodes, a resource portrait service component 103, a decision service component 104, a monitoring service component 105, and a paging configuration component 106.
- the embodiment of this application does not limit the number of nodes, and the number of nodes can be set according to actual business deployment requirements.
- Figure 3 illustrates that the resource scheduling system 10 includes n nodes 102_1 ⁇ 102_n, where n is a positive integer greater than 1. This application The value of n is not limited.
- n nodes 102_1 ⁇ 102_n can be connected together through a communication network, and the communication network can be Wired network, or wireless network.
- the communication network can be implemented using any known network communication protocol.
- the above-mentioned network communication protocol can be various wired or wireless communication protocols, such as Ethernet, universal serial bus (USB), global mobile communication system (global mobile communication system). system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), Time-division code division multiple access (TD-SCDMA), long term evolution (LTE), wireless fidelity (Wi-Fi), voice over Internet protocol (voice over Internet protocol (VoIP), a communication protocol that supports network slicing architecture, or any other suitable communication protocol.
- GSM universal serial bus
- GPRS general packet radio service
- CDMA code division multiple access
- WCDMA wideband code division multiple access
- TD-SCDMA Time-division code division multiple access
- LTE long term
- the manager 101, resource profiling service component 103, decision service component 104, monitoring service component 105 and paging configuration component 106 can run on the same node, or run on two or more nodes. superior.
- the manager 101 runs on one node, and the resource portrait service component 103, decision service component 104, monitoring service component 105 and paging configuration component 106 run on another node.
- the resource portrait service component 103, the decision service component 104, the monitoring service component 105 and the paging configuration component 106 can be deployed on the node in the form of plug-ins.
- the monitoring service component 105 can be used to collect resource information of each node 102_1 to 102_n, resource occupation information, Request information and Limit information of containers deployed on each node 102_1 to 102_n.
- the resource information of a node may include the total amount of each type of resource on the node, the number of used resources, the number of remaining resources, the usage rate of each type of resource, and other information.
- the resource occupancy information, Request information, and Limit information of the pods deployed by each node 102_1 to 102_n can be obtained based on the sum of the resource occupancy information, Request information, and Limit information of the containers included in the pod.
- the resource occupancy information, Request information, and Limit information of the microservices deployed on each node 102_1 to 102_n can also be obtained based on the sum of the resource occupancy information, Request information, and Limit information of the containers associated with the microservices.
- the resource occupation information of containers, pods, and microservices can refer to the amount of each type of resource (CPU, memory, disk, network bandwidth) occupied by pods, containers, and microservices.
- the monitoring service component 105 may include a Prometheus component.
- Prometheus components are tools for collecting and aggregating specified metrics as time series data.
- the monitoring service component 105 can use the Prometheus component to collect the resource information of each node 102_1 to 102_n in real time, as well as the resource occupancy information, Request information and Limit information of the containers deployed on each node 102_1 to 102_n.
- Each node 102_1 ⁇ 102_n can also be deployed with an Over Load Control (OLC) component.
- OLC Over Load Control
- the decision service component 104 determines that a certain microservice has sudden traffic resulting in insufficient resources based on the resource occupancy information of the microservice collected by the OLC component, it can trigger the expansion of the microservice to meet the resource requirements required for the operation of the microservice.
- Insufficient resources may refer to the shortage of one or more of the CPU resources, memory resources, disk resources, network bandwidth resources, etc. allocated to the microservice.
- the decision service component 104 is based on OLC
- the resource occupancy information of microservices collected by the component determines that a certain microservice has excess resources, it can also trigger the reduction of the microservice to improve the utilization of node resources.
- the monitoring service component 105 can also collect operating indicator data of each node 102_1 to 102_n and the microservices deployed on each node 102_1 to 102_n, so as to obtain the operating status of the nodes and microservices.
- the monitoring service component 105 can be used to determine whether the node is running abnormally (disk abnormality, network abnormality, etc.), and to check the running status of the microservice to realize real-time monitoring of the running status of the microservice before or after resource adjustment.
- the monitoring service component 105 can also monitor events triggered by the manager 101, such as the creation, deletion, and upgrade of microservices triggered by the manager 101, and expand or shrink the resources of microservices/pods. Waiting for events, the monitoring service component 105 can report the monitored events to the decision-making service component 104, and the decision-making service component 104 makes decisions and issues instructions. The monitoring service component 105 can also notify the operation and maintenance personnel of the monitored events through text messages or emails, so that the operation and maintenance personnel can be informed of changes in the computing device cluster in a timely manner.
- the resource scheduling system 10 also includes a message center 107, and the monitoring service component 105 also The monitored events can be notified to the message center 107, and the message center 107 notifies the operation and maintenance personnel through text messages or emails.
- the resource portrait service component 103 is used to receive the resource information of each node 102_1 ⁇ 102_n collected by the monitoring service component 105, the resource occupancy information, Request information and Limit information of the containers deployed on each node 102_1 ⁇ 102_n, etc. .
- the resource profiling service component 103 can summarize and analyze various information collected by the monitoring service component 105 to implement resource profiling for each microservice. Through the monitoring service component 105, the resource occupation historical data of node resources, containers, pods and microservices can be collected, and the resource portrait service component 103 can summarize and analyze it to generate resource portraits of the microservices, so that the microservices can be analyzed later. /pod can be targeted when adjusting resources.
- the resource portrait may include resource occupation dimensions and time dimensions.
- the resource occupation dimension can characterize the resources occupied by microservices, such as CPU, memory, network bandwidth, disk IO and other resources occupied by microservices.
- the time dimension combined with the resource occupation dimension can characterize the resources occupied by microservices at different times. For example, the traffic of Internet-based microservices will be affected by people's production and life, showing obvious peaks and peaks, periodicity and predictability, or scheduled microservices are also cyclical and predictable, and local life microservices will There are noon and evening peaks, and the traffic peak of e-commerce microservices during the promotion phase is several times the trough. If the resource scheduling system 10 can capture this information, it can flexibly allocate resources according to the status of nodes and microservices, realize dynamic allocation of microservice resources, and meet the service level agreement (Service Level Agreement, SLA) requirements of microservices to the greatest extent.
- SLA Service Level Agreement
- the resource profiling service component 103 can be integrated with a data processing model to implement aggregation and analysis of information collected by the monitoring service component 105 .
- the data processing model can use the quantile value algorithm (quantile value for microservice resource requirements) to perform resource portraits on microservices.
- the data processing model can also use other artificial intelligence algorithms to implement resource drawing for microservices. Like, this application does not limit this.
- the resource portrait service component 103 can report the constructed resource portrait and the information collected by the monitoring service component 105 to the decision-making service component 104.
- the decision service component 104 can make resource scheduling decisions based on the resource portrait constructed by the resource portrait service component 103, the information collected by the monitoring service component 105, and the running status of the nodes. For example, if a node is in an abnormal operating state (disk abnormality, network abnormality, etc.), the node is scheduled and isolated, that is, the decision service component 104 will not adjust the resources of the pods under the node that meet the resource adjustment conditions. After the node resumes normal operation, the decision service component 104 then adjusts the resources of the pods under the node that meet the resource adjustment conditions.
- Pods that meet resource adjustment conditions can refer to pods associated with microservices that need to be expanded/shrunk.
- the decision service component 104 can predict that a certain microservice needs to be expanded in a certain period of time based on the resource portrait of the microservice, and can then issue resource adjustment instructions to the microservice at a preset time in advance to meet the business requirements of the microservice.
- the microservice is a life-type microservice and has a traffic peak from 7 to 9 p.m.
- the decision-making service component 104 can adjust the resources of the life-type microservice 5 minutes in advance, and the specific amount of resource adjustment can be based on Resource portraits are estimated and set.
- the decision service component 104 can issue resource adjustment instructions to the microservice before the large promotion starts to satisfy the requirements of the microservice.
- the specific amount of resource adjustment can be estimated and set based on the traffic data of historical large promotions.
- the decision service component 104 can also issue resource adjustment instructions for a certain microservice when the OLC detects that the traffic of a certain microservice has increased and the resources are approaching overload, so as to meet the business processing needs of the microservice.
- the decision service component 104 issues resource adjustment instructions to the nodes through the paging configuration component 106, and uses the docker component on the node to adjust the resources of the pods that meet the resource adjustment conditions. Second-level resource adjustment can be achieved. Compared with using HPA/VPA, Resource adjustment has less hysteresis.
- the resources when adjusting resources for a microservice, can be adjusted for all pods associated with the microservice, or it can be precise for one or several pods in the microservice, that is, the adjustment The pod can make the microservice have enough resources to cope with the current increase in business volume/traffic.
- the decision service component 104 can automatically issue resource adjustment instructions to the paging configuration component 106 to trigger resource adjustment for pods that meet the resource adjustment conditions.
- the decision service component 104 can also give corresponding resource adjustment suggestions, and notify the operation and maintenance personnel of the resource adjustment suggestions through the message center 107 for decision-making, that is, the operation and maintenance personnel can manually issue resource adjustments.
- Instructions are sent to the paging configuration component 106 to trigger resource adjustment for pods that meet resource adjustment conditions.
- Resource adjustment instructions can include the pods that require resource adjustment and the pod's resource adjustment method.
- the pod's resource adjustment method can mean increasing the pod's resource Limit by a1, or decreasing the pod's resource Limit by a2, or setting the pod's resource Limit. For a3 and other methods.
- the values of a1, a2, and a3 can be set according to actual needs. It can be understood that a1, a2, and a3 can each be a set of setting values of resources such as CPU, memory, disk IO, and network bandwidth.
- the paging configuration component 106 can be used to issue resource adjustment instructions to nodes.
- the kubelet on the node can listen to the resource adjustment instructions issued by the paging configuration component 106 and determine whether the resource adjustment is for the pod on the node. If the kubelet determines that it is not adjusting resources for the pod on this node, it can ignore the resource adjustment instruction. If kubelet determines that it is adjusting resources for pods on this node, kubelet can continue to determine which pods on this node are adjusting resources based on the resource adjustment instructions. For pods that require resource adjustment, kubelet can control the pod to call unix-socket to communicate with the docker process (the process of the docker component), and adjust the resources by calling the docker API.
- the paging configuration component 106 can be ZooKeeper.
- ZooKeeper can accept the registration of listeners. Once certain data changes, ZooKeeper can notify the listeners registered on ZooKeeper to respond accordingly. That is, the kubelet on the node can be registered with ZooKeeper to monitor the resource adjustment instructions issued by ZooKeeper.
- the docker component can set limits for resources such as CPU, memory, disk, and network bandwidth for each process, and then can set limits for process access to resources.
- the bottom layer of the docker component uses control groups (Control grpups, Cgroups) implementation.
- Cgroups is a feature of the Linux kernel that can be used to limit, control and separate the resources of a process group.
- Resource control in Cgroups is implemented in units of control groups.
- a process can join a certain control group or migrate from one process group to another control group. Processes in a process group can use Cgroups to allocate resources in units of control groups, and are subject to restrictions set by Cgroups in units of control groups.
- Cgroups can implement functions such as limiting the number of resources that a process group can use, controlling the priority of the process group, recording the number of resources used by the process group, process group isolation, and process group control.
- Cgroups information When deploying docker components on a node, by default, Cgroups information will be mounted in the node/sys/fs/cgroup/cpu/kubebpods/burstable/podxxx directory, so that each process will have separate configuration information, which can be called by calling docker API to update the configuration information of the process and adjust the resources of the pod.
- each microservice is configured with different priorities in a preset manner. For example, its own priority can be configured through the Annotation option of the microservice.
- the resource portrait service component 103 can obtain the priority of each microservice and transmit the priority information to the decision-making service component 104.
- the decision service component 104 can release the resources of low-priority microservices to high-priority microservices based on the priority of the microservices and the resource usage data of the microservices. If resources cannot be freed from low-priority microservices, the decision-making service component 104 can also schedule the low-priority microservices that are currently inactive (sleeping state) to other nodes based on the resource portrait of the microservices.
- high-priority microservices can be allocated more resources. For example, if the current time is night time, low-priority microservices that are only active during the day and dormant at night can be scheduled to other nodes, thereby freeing up more resources for high-priority microservices without Affects the operation of this low-priority microservice.
- multiple microservices are deployed on node 102_1.
- the multiple microservices include computing microservices, and the computing microservices are configured with the highest priority. If the pod associated with the computing microservice is running, the CPU Limit is too small, which limits the running speed of the process, or In situations such as when the memory usage is close to Limit, the resource portrait service component 103 can obtain the priority of each microservice on the node 102_1, and the decision service component 104 can combine the resource information of the node 102_1 and the resource occupancy information of each microservice to make decisions through The analysis reveals more resources (such as CPU or memory) that can be allocated to pods associated with computing microservices, which can then speed up the calculation of computing microservices and fully utilize node resources.
- resources such as CPU or memory
- the decision service component 104 can also send a pod scaling request to the manager 101 when the OLC detects that the traffic of a certain microservice has increased and the resources are approaching overload.
- the manager 101 can use HPA and/or VPA. Implement resource adjustment for pods that meet resource adjustment conditions.
- HAP/VPA When resources are allocated to microservices through HAP/VPA, HAP/VPA will collect the resource indicators of the microservice in the most recent preset time period and calculate the average, compare the average with the target value, and then adjust the resources based on the comparison results. Therefore, resource adjustment through HAP/VPA will cause the problem of response lag; in addition, since the default expansion cooling period of HPA/VPA is 3 minutes, the problem of response lag will be further amplified.
- microservice S1 is an e-commerce microservice.
- the e-commerce microservice starts a product flash sale or an e-commerce live broadcast of a certain type of product at a certain moment, resulting in a large increase in traffic.
- the resource scheduling system 10 includes a manager 101, a node 102_1, a node 102_2, a resource portrait service component 103, a decision service component 104, a monitoring service component 105, a paging configuration component 106 and a message center 107 as an example.
- the manager 101, resource portrait service component 103, decision service component 104, monitoring service component 105, paging configuration component 106 and message center 107 can all be deployed on node 102_1.
- the monitoring service component 105 may include a Prometheus component, and the OLC component may be deployed on the node 102_1. Assume that microservice S1 is deployed on node 102_1, and the pod associated with microservice S1 is pod_1.
- the internal interaction process of resource scheduling system 10 to implement resource scheduling for microservice S1 includes:
- the Prometheus component collects resource information of node 102_1, resource occupation information, Request information and Limit information of containers deployed on node 102_1, and reports it to the resource portrait service component 103.
- the OLC component collects the resource occupation information of the microservice S1 deployed on the node 102_1, and reports it to the decision service component 104.
- the resource portrait service component 103 builds a resource portrait of the microservice S1 based on the information collected by the Prometheus component, and reports the resource portrait of the microservice S1 and the information collected by the Prometheus component to the decision service component 104.
- the decision-making service component 104 determines that microservice S1 needs to adjust resources based on the resource occupancy information of microservice S1 collected by the OLC component, the decision-making service component 104 issues resources based on the resource portrait of microservice S1 and the information collected by the Prometheus component. Adjust the instructions to the paging configuration component 106, or send the pod scaling request to the manager 101.
- microservice S1 For example, if the OLC component collects that the resource occupation information of microservice S1 is close to the limit or has reached the limit, the decision service component 104 can determine that microservice S1 has a large increase in traffic. In order to ensure that microservice S1 can operate normally, microservice S1 needs to be Make resource adjustments to ensure that microservice S1 has sufficient resources to maintain normal operation.
- the decision service component 104 can determine that there are too many idle resources in microservice S1. In order to ensure that the resources on node 102_1 can be fully utilized, it is necessary to Microservice S1 adjusts resources so that node 102_1 has enough remaining resources to allocate to other resource-constrained microservices.
- calling the docker API to adjust the resources of pod_1 may mean calling the docker API to adjust the Cgroup parameters of pod_1, thereby adjusting the resources of pod_1.
- the manager 101 adjusts resources for pod_1 through HPA and/or VPA.
- the Prometheus component can also monitor the resource adjustment results of pod_1 and notify the message center 107, so that the message center 107 can notify the operation and maintenance personnel of the resource adjustment results of pod_1 via SMS or email.
- the Prometheus component can also monitor the running status of microservice S1 after adjusting the resources of pod_1, and feedback it to the decision service component 104, and check the running status of microservice S1 through the Prometheus component to determine the adjusted Whether the resources are sufficient for the operation of microservice S1. If the microservice S1 still runs abnormally due to insufficient resources, the decision service component 104 can be triggered again to adjust the resources of the microservice S1.
- the resource scheduling system 10 includes a manager 101, a node 102_1, a node 102_2, a resource portrait service component 103, a decision service component 104, a monitoring service component 105 and a paging configuration component 106 as an example.
- Microservice S1 may be an e-commerce microservice, a computing microservice, a life microservice, etc., which is not limited in this embodiment.
- microservice S1 When microservice S1 is started, it often performs a lot of initialization work, such as pulling image files, starting Tomcat containers, initializing Spring MVC/SpringBoot, instantiating Beans, instantiating Services, instantiating container engine base components, etc., and starts
- the time is directly proportional to the size of the microservice (such as the amount of code in the microservice), the number of Restful interfaces, the number of externally dependent components, and inversely proportional to the resource specifications of the container.
- the shorter the startup time of microservice S1 the sooner the Pod generated for microservice S1 through HPA or VPA will be ready, which can improve the stability and throughput of the cluster.
- microservice S1 is deployed on node 102_1, and the pod associated with microservice S1 is pod_1.
- the internal interaction process of resource scheduling system 10 to implement resource scheduling for microservice S1 includes:
- the monitoring service component 105 collects the resource information of the node 102, the resource occupation information of the containers deployed on the node 102_1, the Request information and the Limit information, and transmits them to the resource portrait service component 103.
- the monitoring service component 105 includes a Prometheus component.
- the Prometheus component can be used to collect resource information of the node 102, resource occupation information, Request information, and Limit information of the containers deployed on the node 102_1.
- the resource portrait service component 103 aggregates various information collected by the monitoring service component 105, and transmits the information aggregation result to the decision-making service component 104.
- the decision service component 104 listens to the creation event of pod_1, it analyzes and calculates the number of resources that node 102_1 can currently allocate to pod_1, and issues resource adjustment instructions to the paging configuration component 106.
- the manager 101 when creating pod_1, the manager 101 sets the resource Request and resource Limit of pod_1. In order to shorten the startup time of microservice S1, the resource Limit can be expanded. That is, the resource Limit of pod_1 can be expanded by calculating the additional resources that node 102_1 can currently allocate to pod_1.
- the monitoring service component 105 can listen to the event that the manager 101 creates pod_1, and notify the decision service component 104 of the creation event of pod_1.
- the unused resources of 3 can be allocated to pod_1, so that the resources of pod_1 change from 1 set by the manager 101 to 2, so as to achieve the purpose of quickly starting microservice S1.
- the decision-making service component 104 then recycles the resources allocated to pod_1, that is, the resources of pod_1 change from 2 to 1 again.
- additional resources allocated to pod_1 may include changing the CPU limit in pod_1 from 2 cores to 4 cores, changing the memory limit from b1MB to b2MB, etc., where b2 is greater than b1.
- the paging configuration component 106 sends the resource adjustment instructions to the pod service.
- the pod service controls pod_1 to call unix-socket to communicate with the docker process to call the docker API to adjust the resources of pod_1.
- a pod service may refer to a component on a node used to manage pods, such as Kubelet.
- the resource Request and resource Limit of each microservice, the information aggregated by the resource portrait service component 103, the information decided by the decision-making service component 104, etc. can be stored in the preset database.
- the preset database can record each pod.
- the unique identification for example, name or IP
- allocated resources for example, name or IP
- an embodiment of the present application provides a resource scheduling method, which can be applied to a computing device cluster.
- the resource scheduling method may include:
- Step S81 Obtain the resource information of each node in the cluster and the resource information of the container in each node.
- Each node is equipped with a container engine.
- the Prometheus component and the OLC component can be deployed in the cluster to collect the resource information of each node in real time, as well as the resource occupancy information, Request information, and Limit information of the containers deployed on each node.
- the container engine may refer to the docker component.
- the resource information may include information such as the total amount of each type of resource, the number of used resources, the number of remaining resources, the usage rate of each type of resource, and other information.
- the resources referred to in the embodiment of this application may include CPU resources, memory resources, network bandwidth resources, disk resources, etc.
- Step S82 Based on the resource information of each node and the resource information of the containers in each node, construct a resource portrait of the microservices deployed on each node.
- the microservices deployed on each node run based on one or more containers. .
- a resource portrait of the microservices deployed on each node For example, you can first obtain the resource information of the microservice deployed on each node based on the resource information of the container in each node, and then based on the resource information of each node and the resource information of the microservice deployed on each node, Build a resource portrait of the microservices deployed on each node.
- the time dimension combined with the resource occupation dimension can be used to characterize the resources occupied by the microservice at different times.
- resource allocation can be based on the resource portrait of the microservice, so that The resource adjustment of microservices is more targeted and can improve the resource utilization of nodes.
- Step S83 If it is determined that the first microservice deployed in the cluster requires resource adjustment, based on the resource portrait of the first microservice, the resource information of the first node where the first microservice is deployed, and the resource information of the container in the first node , generate resource adjustment instructions associated with the first microservice.
- a microservice with insufficient resources or a microservice with excess resources can be determined as the first microservice that requires resource adjustment. For example, if the resources occupied by the first microservice are less than the resource upper limit of the first microservice The difference is less than the first preset threshold, indicating that the resources of the first microservice are tight. The first microservice is expanded by triggering to meet the resource requirements required for the operation of the first microservice. If the resources occupied by the first microservice are When the difference between the resource upper limits of the first microservice is greater than the second preset threshold, indicating that the first microservice has excess resources, the first microservice is triggered to scale down so that the excess resources can be allocated to other resources with insufficient resources. Microservices.
- the resources occupied by the first microservice include one or more of processor resources, memory resources, disk resources, and network bandwidth resources. If the resources occupied by the first microservice include processor resources, memory resources, disk resources, and network bandwidth, If the difference between any one of the resources and the corresponding resource upper limit is less than the corresponding first preset threshold, it indicates that one or several resources of the microservice are tight, and it is determined that the microservice needs to be expanded. If the difference between any one of the processor resources, memory resources, disk resources, and network bandwidth resources occupied by the first microservice and the corresponding resource upper limit is greater than the corresponding second preset threshold, it indicates that a certain item of the microservice or Certain resources are excessive, and it is determined that microservices need to be scaled down.
- the number of resources required by the microservice can be predicted through the resource portrait of the first microservice, and then the first microservice is deployed based on the predicted number of resources.
- the resource information of the node and the resource information of the container in the node allocate resources to the first microservice, making the resource adjustment of the microservice more accurate, avoiding excessive or insufficient resource allocation, and improving the resource utilization of the node.
- Step S84 Adjust the resources of the pod associated with the first microservice based on the container engine and resource adjustment instructions.
- the resource adjustment instruction is to adjust resources for all pods associated with the microservice, or to adjust resources for one or several pods in the microservice, and call it through the container engine
- the resource adjustment application program interface adjusts resources for specified pods.
- the hysteresis of resource adjustment is small, and it can realize resource adjustment at the second level and enhance the ability of microservices deployed in the cluster to cope with sudden traffic.
- the container engine is a docker component.
- the docker component can set limits for resources such as CPU, memory, disk, and network bandwidth for each process, and then set limits for process access to resources.
- the bottom layer of the docker component is implemented through Cgroups. Cgroups can implement functions such as limiting the number of resources that a process group can use, controlling the priority of a process group, recording the number of resources used by a process group, process group isolation, and process group control.
- Cgroups information can be mounted in the node/sys/fs/cgroup/cpu/kubebpods/burstable/podxxx directory, so that each process will have separate configuration information, and the container engine can pass
- the docker API is called to update the configuration information of the process to implement resource adjustment for the pod associated with the first microservice.
- the microservices deployed on each node can be configured with different priorities in a preset manner.
- the resources of a microservice deployed on the node with a lower priority than the first microservice can be released, so that the node has enough free resources to allocate to the first microservice. For example, if the microservice deployed on the node has a lower priority than the first microservice as the second microservice, some of the resources occupied by the second microservice can be released based on the resource portrait of the second microservice. Resource profiling can determine and estimate how many resources the second microservice can currently release without affecting the operation of the second microservice.
- the nodes deployed on the node may be configured with a smaller number of resources than the first microservice.
- a microservice with low priority is migrated to other nodes, so that the node has enough free resources to allocate to the microservices that need resource adjustment. For example, migrate the third microservice deployed on the node with a lower priority than the first microservice to other nodes in the cluster, so that the node has enough free resources to allocate to the microservice that needs resource adjustment.
- a third microservice that can be scheduled to other nodes in the cluster can be selected based on the resource portrait of the microservice deployed on the node. For example, if the current time is night time, you can choose to be active only during the day and not active at night. The dormant low-priority third microservice is scheduled to other On the node, more resources can be allocated for the high-priority first microservice without affecting the operation of the low-priority third microservice.
- the resource scheduling method may include:
- Step S91 Obtain the resource information of each node in the cluster and the resource information of the container in each node.
- Each node is equipped with a container engine.
- the Prometheus component and the OLC component can be deployed in the cluster to collect the resource information of each node in real time, as well as the resource occupancy information, Request information, and Limit information of the containers deployed on each node.
- the container engine may refer to the docker component.
- the resource information may include information such as the total amount of each type of resource, the number of used resources, the number of remaining resources, the usage rate of each type of resource, and other information.
- the resources referred to in the embodiment of this application may include CPU resources, memory resources, network bandwidth resources, disk resources, etc.
- Step S92 In response to the startup instruction of the first microservice deployed in the cluster, create a first pod for the first microservice, and the first pod is set with a first resource upper limit.
- the first microservice can refer to any microservice deployed in the cluster.
- the cluster starts the first microservice, it can create the first pod for the first microservice, maintain the operation of the first microservice through the first pod, and the cluster sets the first resource upper limit (Limit) for the first pod.
- Limit first resource upper limit
- Step S93 Generate a resource adjustment instruction associated with the first pod based on the resource information of the first node where the first microservice is deployed and the resource information of the container in the first node.
- the upper limit of resource occupancy allocated by the system for the microservice is increased to achieve Quickly start microservices and shorten the startup time of microservices.
- Step S94 Adjust the resource usage upper limit of the first pod from the first resource upper limit value to the second resource upper limit value based on the container engine and the resource adjustment instruction.
- the second resource upper limit value is greater than the first resource upper limit value.
- the container engine calls the resource adjustment application program interface to adjust the upper limit of the first pod's resource usage from the first resource upper limit to the second resource upper limit.
- the resource adjustment has little hysteresis and can realize second-level resource adjustment.
- the container engine is a docker component, and the bottom layer of the docker component is implemented through Cgroups.
- Cgroups information can be mounted in the node/sys/fs/cgroup/cpu/kubebpods/burstable/podxxx directory, so that each process will have separate configuration information, and the container engine can pass
- the docker API is called to adjust the upper resource occupation limit of the first pod from the first resource upper limit value to the second resource upper limit value.
- the resource occupation upper limit of the first pod can be adjusted from the second resource upper limit value to the first resource upper limit value. That is, after the first microservice is started, Finally, the resources previously allocated to the first microservice in order to shorten the startup time of the first microservice are recycled to avoid excess resources of the first microservice and improve the resource utilization of the node.
- the first resource scheduling device 20 may include a first acquisition module 201, a construction module 202, a first generation module 203 and a first adjustment module 204.
- the first acquisition module 201 is used to acquire the resource information of each node in the cluster and the resource information of the containers in each node.
- Each node can have a container engine installed.
- the building module 202 is configured to build a resource portrait of the microservice deployed on each node based on the resource information of each node and the resource information of the container in each node. Microservices deployed on each node can run based on one or more containers.
- the first generation module 203 is used to, when the first microservice deployed in the cluster requires resource adjustment, based on the resource portrait of the first microservice, the resource information of the first node where the first microservice is deployed, and the resource information of the first node.
- the resource information of the container is obtained, and a resource adjustment instruction associated with the first microservice is generated.
- the first adjustment module 204 is used to adjust the resources of the pod associated with the first microservice based on the container engine and resource adjustment instructions.
- the first acquisition module 201, the construction module 202, the first generation module 203 and the first adjustment module 204 can all be implemented by software, or can be implemented by hardware.
- the implementation of the first acquisition module 201 is introduced next, taking the first acquisition module 201 as an example.
- the implementation of the building module 202, the first generation module 203 and the first adjustment module 204 can refer to the implementation of the first acquisition module 201.
- the first acquisition module 201 may include code running on a computing instance.
- the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the above computing instance may be one or more.
- the first acquisition module 201 may include code running on multiple hosts/virtual machines/containers. It should be noted that multiple hosts/virtual machines/containers used to run the code can be distributed in the same region (region) or in different regions. Furthermore, multiple hosts/virtual machines/containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs. Each AZ includes one data center or multiple AZs. geographically close data centers. Among them, usually a region can include multiple AZs.
- the multiple hosts/VMs/containers used to run the code can be distributed in the same virtual private cloud (VPC), or across multiple VPCs.
- VPC virtual private cloud
- Cross-region communication between two VPCs in the same region and between VPCs in different regions requires a communication gateway in each VPC, and the interconnection between VPCs is realized through the communication gateway. .
- the first acquisition module 201 may include at least one computing device, such as a server.
- the first acquisition module 201 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD).
- ASIC application-specific integrated circuit
- PLD programmable logic device
- the above-mentioned PLD can be a complex programmable logical device (CPLD), a field-operable Implemented by field-programmable gate array (FPGA), general array logic (GAL) or any combination thereof.
- CPLD complex programmable logical device
- FPGA field-operable Implemented by field-programmable gate array
- GAL general array logic
- the multiple computing devices included in the first acquisition module 201 may be distributed in the same region or in different regions.
- the multiple computing devices included in the first acquisition module 201 may be distributed in the same AZ or in different AZs.
- multiple computing devices included in the first acquisition module 201 may be distributed in the same VPC or in multiple VPCs.
- the plurality of computing devices may be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
- the first acquisition module 201 can be used to perform any steps in the resource scheduling method shown in Figure 8
- the building module 202 can be used to perform any steps in the resource scheduling method shown in Figure 8
- the first generation module 203 can be used to perform any step in the resource scheduling method shown in Figure 8
- the first adjustment module 204 can be used to perform any step in the resource scheduling method shown in Figure 8
- the first acquisition module 201, the construction module 202, the first generation module 203 and the first adjustment module 204 can be specified as needed, through the first acquisition module 201, the construction module 202, the first generation module 203 and the first adjustment module 204 respectively. Implement different steps in the resource scheduling method shown in Figure 8 to realize all functions of the first resource scheduling device 20.
- the second resource scheduling device 30 includes a second acquisition module 301, a creation module 302, a second generation module 303 and a second adjustment module 304.
- the second acquisition module 301 is used to acquire the resource information of each node in the cluster and the resource information of the containers in each node.
- Each node can have a container engine installed.
- the creation module 302 is configured to create a first pod for the first microservice in response to a startup instruction of the first microservice deployed in the cluster.
- the first pod can be set with a first resource upper limit.
- the second generation module 303 is configured to generate a resource adjustment instruction associated with the first pod based on the resource information of the first node where the first microservice is deployed and the resource information of the container in the first node.
- the second adjustment module 304 is configured to adjust the upper resource occupation limit of the first pod from the first upper resource limit value to the second upper resource limit value based on the container engine and resource adjustment instructions.
- the second resource upper limit value may be greater than the first resource upper limit value.
- the second acquisition module 301, the creation module 302, the second generation module 303 and the second adjustment module 304 can all be implemented by software, or can be implemented by hardware.
- the implementation of the second acquisition module 301 is introduced next, taking the second acquisition module 301 as an example.
- the implementation of the creation module 302, the second generation module 303 and the second adjustment module 304 can refer to the implementation of the second acquisition module 301.
- the second acquisition module 301 may include code running on the computing instance.
- the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container.
- the above computing instance may be one or more.
- the second acquisition module 301 may include code running on multiple hosts/virtual machines/containers. It should be noted that multiple hosts/virtual machines/containers used to run the code can be distributed in the same region (region) or in different regions. Further, for running this code Multiple hosts/virtual machines/containers can be distributed in the same availability zone (AZ) or in different AZs. Each AZ includes one data center or multiple geographically close data centers. Among them, usually a region can include multiple AZs.
- the multiple hosts/VMs/containers used to run the code can be distributed in the same VPC or across multiple VPCs.
- a VPC is set up in a region.
- Cross-region communication between two VPCs in the same region and between VPCs in different regions requires a communication gateway in each VPC, and the interconnection between VPCs is realized through the communication gateway. .
- the second acquisition module 301 may include at least one computing device, such as a server.
- the second acquisition module 301 may also be a device implemented using ASIC, or a PLD, or the like.
- the above-mentioned PLD can be implemented by CPLD, FPGA, GAL or any combination thereof.
- the multiple computing devices included in the second acquisition module 301 may be distributed in the same region or in different regions.
- the multiple computing devices included in the second acquisition module 301 may be distributed in the same AZ or in different AZs.
- multiple computing devices included in the second acquisition module 301 may be distributed in the same VPC or in multiple VPCs.
- the plurality of computing devices may be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
- the second acquisition module 301 can be used to perform any steps in the resource scheduling method shown in Figure 9, and the creation module 302 can be used to perform any steps in the resource scheduling method shown in Figure 9.
- the second generation module 303 can be used to perform any step in the resource scheduling method shown in Figure 9
- the second adjustment module 304 can be used to perform any step in the resource scheduling method shown in Figure 9, the second acquisition
- the steps responsible for implementation by the module 301, the creation module 302, the second generation module 303 and the second adjustment module 304 can be specified as needed, through the second acquisition module 301, the creation module 302, the second generation module 303 and the second adjustment module 304 respectively. Implement different steps in the resource scheduling method shown in Figure 9 to realize all functions of the second resource scheduling device 30.
- Embodiments of the present application also provide a computer storage medium.
- Computer instructions are stored in the computer storage medium.
- the computing device cluster executes the above related method steps to implement the above embodiments. Resource scheduling methods.
- An embodiment of the present application also provides a computer program product.
- the computer program product When the computer program product is run on a computing device cluster, it causes the computing device cluster to perform the above related steps to implement the resource scheduling method in the above embodiment.
- inventions of the present application also provide a device.
- This device may be a chip, a component or a module.
- the device may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and the device has an implementation
- the resource scheduling method provided in the above embodiment has the function of calculating device cluster behavior.
- Functions can be implemented by hardware, or by hardware executing corresponding software.
- Hardware or software includes one or more modules corresponding to the above functions.
- the computer storage media, computer program products or chips provided by the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the corresponding methods provided above. The beneficial effects will not be repeated here.
- the disclosed devices and methods can be implemented in other ways.
- the device embodiments described above are schematic.
- the division of modules or units is a logical function division.
- multiple units or components may be combined or can be integrated into another device, or some features can be ignored, or not implemented.
- the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated.
- the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. . Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
- each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
- the above integrated units can be implemented in the form of hardware or software functional units.
- the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium.
- the storage medium includes a number of instructions to cause a device (which may be a microcontroller, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of this application.
- the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code. .
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mathematical Physics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
Claims (19)
- 一种资源调度方法,其特征在于,所述方法包括:获取集群中的每个节点的资源信息,以及所述每个节点中的容器的资源信息,所述每个节点均安装有容器引擎;基于所述每个节点的资源信息和所述每个节点中的容器的资源信息,构建在所述每个节点上部署的微服务的资源画像,所述每个节点上部署的微服务基于一个或多个容器运行;若确定在所述集群中部署的第一微服务需进行资源调整,基于所述第一微服务的资源画像、部署所述第一微服务的第一节点的资源信息以及所述第一节点中的容器的资源信息,生成与所述第一微服务关联的资源调整指令;基于所述容器引擎及所述资源调整指令,调整与所述第一微服务关联的容器集合pod的资源。
- 如权利要求1所述的资源调度方法,其特征在于,所述基于所述每个节点的资源信息和所述每个节点中的容器的资源信息,构建在所述每个节点上部署的微服务的资源画像,包括:基于所述每个节点中的容器的资源信息,得到在所述每个节点上部署的微服务的资源信息;基于所述每个节点的资源信息及所述每个节点上部署的微服务的资源信息,构建在所述每个节点上部署的微服务的资源画像,所述资源画像包括资源占用维度与时间维度。
- 如权利要求1或2所述的资源调度方法,其特征在于,所述方法还包括:若所述第一微服务占用的资源与所述第一微服务的资源上限值之差小于第一预设阈值,确定所述第一微服务需进行资源调整;或者若所述第一微服务占用的资源与所述第一微服务的资源上限值之差大于第二预设阈值,确定所述第一微服务需进行资源调整。
- 如权利要求3所述的资源调度方法,其特征在于,所述第一微服务占用的资源包括处理器资源、内存资源、磁盘资源以及网络带宽资源中的一种或多种,所述确定所述第一微服务需进行资源调整,包括:若所述第一微服务占用的处理器资源、内存资源、磁盘资源以及网络带宽资源中的任意一者与对应的资源上限值之差小于对应的第一预设阈值,确定所述第一微服务需进行资源调整;或者若所述第一微服务占用的处理器资源、内存资源、磁盘资源以及网络带宽资源中的任意一者与对应的资源上限值之差大于对应的第二预设阈值,确定所述第一微服务需进行资源调整。
- 如权利要求4所述的资源调度方法,其特征在于,所述确定所述第一微服务需进行资源调整,包括:若所述第一微服务占用的处理器资源、内存资源、磁盘资源以及网络带 宽资源中的任意一者与对应的资源上限值之差小于对应的第一预设阈值,确定所述第一微服务需进行扩容调整;或者若所述第一微服务占用的处理器资源、内存资源、磁盘资源以及网络带宽资源中的任意一者与对应的资源上限值之差大于对应的第二预设阈值,确定所述第一微服务需进行缩容调整。
- 如权利要求1至5中任意一项所述的资源调度方法,其特征在于,基于所述第一微服务的资源画像、部署所述第一微服务的节点的资源信息以及所述节点中的容器的资源信息,生成与所述第一微服务关联的资源调整指令,包括:基于所述第一微服务的资源画像预测所述第一微服务所需的资源数量;基于所述预测的资源数量、部署所述第一微服务的节点的资源信息以及所述节点中的容器的资源信息,生成与所述第一微服务关联的资源调整指令。
- 如权利要求6所述的资源调度方法,其特征在于,所述生成与所述第一微服务关联的资源调整指令,包括:生成与所述第一微服务关联的所有pod的资源调整指令;或者生成与所述第一微服务关联的指定pod的资源调整指令。
- 如权利要求1至7中任意一项所述的资源调度方法,其特征在于,所述基于所述容器引擎及所述资源调整指令调整与所述第一微服务关联的pod的资源,包括:确定与所述资源调整指令关联的pod,及通过所述容器引擎调用资源调整应用程序接口API对与所述资源调整指令关联的pod进行资源调整。
- 如权利要求1至8中任意一项所述的资源调度方法,其特征在于,所述每个节点上部署的微服务配置有优先级,所述方法还包括:若所述第一节点的剩余资源无法满足所述第一微服务的资源调整需求,释放所述第一节点上部署的第二微服务占用的部分资源,所述第二微服务的优先级低于所述第一微服务的优先级。
- 如权利要求9所述的资源调度方法,其特征在于,所述释放所述第一节点上部署的第二微服务占用的部分资源,包括:根据所述第二微服务的资源画像,释放所述第二微服务占用的部分资源。
- 如权利要求1至8中任意一项所述的资源调度方法,其特征在于,所述每个节点上部署的微服务配置有优先级,所述方法还包括:若所述第一节点的剩余资源无法满足所述第一微服务的资源调整需求,将所述第一节点上部署的第二微服务调度至所述集群中的其他节点,所述第二微服务的优先级低于所述第一微服务的优先级。
- 如权利要求11所述的资源调度方法,其特征在于,所述将所述第一节点上部署的第二微服务调度至所述集群中的其他节点,包括:基于在所述第一节点上部署的微服务的资源画像,选择可调度至所述集群中的其他节点的第二微服务。
- 一种资源调度方法,其特征在于,所述方法包括:获取集群中的每个节点的资源信息,以及所述每个节点中的容器的资源信息,所述每个节点均安装有容器引擎;响应于在所述集群中部署的第一微服务的启动指令,为所述第一微服务创建第一容器集合pod,所述第一pod设置有第一资源上限值;基于部署所述第一微服务的第一节点的资源信息以及所述第一节点中的容器的资源信息,生成与所述第一pod关联的资源调整指令;基于所述容器引擎及所述资源调整指令将所述第一pod的资源占用上限由所述第一资源上限值调整为第二资源上限值,所述第二资源上限值大于所述第一资源上限值。
- 如权利要求13所述的资源调度方法,其特征在于,所述方法还包括:若确定所述第一微服务启动成功,将所述第一pod的资源占用上限由所述第二资源上限值调整为所述第一资源上限值。
- 一种资源调度装置,其特征在于,所述装置包括:第一获取模块,用于获取集群中的每个节点的资源信息,以及所述每个节点中的容器的资源信息,其中所述每个节点均安装有容器引擎;构建模块,用于基于所述每个节点的资源信息和所述每个节点中的容器的资源信息,构建在所述每个节点上部署的微服务的资源画像,其中所述每个节点上部署的微服务基于一个或多个容器运行;第一生成模块,用于在所述集群中部署的第一微服务为需进行资源调整时,基于所述第一微服务的资源画像、部署所述第一微服务的第一节点的资源信息以及所述第一节点中的容器的资源信息,生成与所述第一微服务关联的资源调整指令;第一调整模块,用于基于所述容器引擎及所述资源调整指令调整与所述第一微服务关联的容器集合pod的资源。
- 一种资源调度装置,其特征在于,所述装置包括:第二获取模块,用于获取集群中的每个节点的资源信息,以及所述每个节点中的容器的资源信息,所述每个节点均安装有容器引擎;创建模块,用于响应于在所述集群中部署的第一微服务的启动指令,为所述第一微服务创建第一容器集合pod,所述第一pod设置有第一资源上限值;第二生成模块,用于基于部署所述第一微服务的第一节点的资源信息以及所述第一节点中的容器的资源信息,生成与所述第一pod关联的资源调整指令;第二调整模块,用于基于所述容器引擎及所述资源调整指令将所述第一pod的资源占用上限由所述第一资源上限值调整为第二资源上限值,所述第二资源上限值大于所述第一资源上限值。
- 一种计算设备集群,其特征在于,包括至少一个计算设备,每个计算设备包括处理器和存储器;所述至少一个计算设备的处理器用于执行所述至少一个计算设备的存储器中存储的指令,以使得所述计算设备集群执行如权利要求1至权利要求 12中任一项所述的资源调度方法,或者执行如权利要求13或权利要求14所述的资源调度方法。
- 一种包含指令的计算机程序产品,其特征在于,当所述指令被计算设备集群运行时,使得所述计算设备集群执行如权利要求1至权利要求12中任一项所述的资源调度方法,或者执行如权利要求13或权利要求14所述的资源调度方法。
- 一种计算机可读存储介质,其特征在于,包括计算机程序指令,当所述计算机程序指令由计算设备集群执行时,所述计算设备集群执行如权利要求1至权利要求12中任一项所述的资源调度方法,或者执行如权利要求13或权利要求14所述的资源调度方法。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP23861939.9A EP4571506A4 (en) | 2022-09-05 | 2023-06-08 | RESOURCE PLANNING PROCESS AND ASSOCIATED DEVICE |
| US19/070,440 US20250199877A1 (en) | 2022-09-05 | 2025-03-04 | Resource scheduling method and related device |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211080778.9A CN117687739A (zh) | 2022-09-05 | 2022-09-05 | 资源调度方法及其相关设备 |
| CN202211080778.9 | 2022-09-05 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US19/070,440 Continuation US20250199877A1 (en) | 2022-09-05 | 2025-03-04 | Resource scheduling method and related device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024051236A1 true WO2024051236A1 (zh) | 2024-03-14 |
Family
ID=90125131
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/099201 Ceased WO2024051236A1 (zh) | 2022-09-05 | 2023-06-08 | 资源调度方法及其相关设备 |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US20250199877A1 (zh) |
| EP (1) | EP4571506A4 (zh) |
| CN (1) | CN117687739A (zh) |
| WO (1) | WO2024051236A1 (zh) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118245197A (zh) * | 2024-05-27 | 2024-06-25 | 中航信移动科技有限公司 | 一种多类型集群协同调度方法、存储介质及电子设备 |
| CN118689662A (zh) * | 2024-08-29 | 2024-09-24 | 浙江大华技术股份有限公司 | 基于分布式的资源调整方法、设备以及存储介质 |
| CN118802542A (zh) * | 2024-03-22 | 2024-10-18 | 中移动金融科技有限公司 | 信息下发调整方法、装置、设备、存储介质及程序产品 |
| CN119201620A (zh) * | 2024-09-20 | 2024-12-27 | 深圳市海豚互联网有限公司 | SaaS系统的云计算分析方法、装置、设备及存储介质 |
| CN119690347A (zh) * | 2024-12-04 | 2025-03-25 | 北京邮电大学 | 一种基于cgroup的IO控制优化方法 |
| CN119960921A (zh) * | 2025-04-10 | 2025-05-09 | 之江实验室 | 一种容器服务管理方法及装置 |
| CN120218873A (zh) * | 2025-05-28 | 2025-06-27 | 深圳市特区建工集团有限公司 | 基于微服务架构的工地应急管理方法、装置、设备及介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20200387372A1 (en) * | 2019-06-06 | 2020-12-10 | Dick's Sporting Goods, Inc. | Microservice file generation system |
| CN112948050A (zh) * | 2019-11-26 | 2021-06-11 | 西安华为技术有限公司 | 一种部署pod的方法及装置 |
| CN112988398A (zh) * | 2021-04-26 | 2021-06-18 | 北京邮电大学 | 一种微服务动态伸缩及迁移方法和装置 |
| CN113382077A (zh) * | 2021-06-18 | 2021-09-10 | 广西电网有限责任公司 | 微服务调度方法、装置、计算机设备和存储介质 |
| CN113395178A (zh) * | 2021-06-11 | 2021-09-14 | 聚好看科技股份有限公司 | 一种容器云弹性伸缩的方法及装置 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8554919B2 (en) * | 2011-09-09 | 2013-10-08 | Microsoft Corporation | Automatic preemption in multiple computer systems |
| US10719363B2 (en) * | 2018-01-22 | 2020-07-21 | Vmware, Inc. | Resource claim optimization for containers |
-
2022
- 2022-09-05 CN CN202211080778.9A patent/CN117687739A/zh active Pending
-
2023
- 2023-06-08 WO PCT/CN2023/099201 patent/WO2024051236A1/zh not_active Ceased
- 2023-06-08 EP EP23861939.9A patent/EP4571506A4/en active Pending
-
2025
- 2025-03-04 US US19/070,440 patent/US20250199877A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20200387372A1 (en) * | 2019-06-06 | 2020-12-10 | Dick's Sporting Goods, Inc. | Microservice file generation system |
| CN112948050A (zh) * | 2019-11-26 | 2021-06-11 | 西安华为技术有限公司 | 一种部署pod的方法及装置 |
| CN112988398A (zh) * | 2021-04-26 | 2021-06-18 | 北京邮电大学 | 一种微服务动态伸缩及迁移方法和装置 |
| CN113395178A (zh) * | 2021-06-11 | 2021-09-14 | 聚好看科技股份有限公司 | 一种容器云弹性伸缩的方法及装置 |
| CN113382077A (zh) * | 2021-06-18 | 2021-09-10 | 广西电网有限责任公司 | 微服务调度方法、装置、计算机设备和存储介质 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4571506A4 |
Cited By (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118802542A (zh) * | 2024-03-22 | 2024-10-18 | 中移动金融科技有限公司 | 信息下发调整方法、装置、设备、存储介质及程序产品 |
| CN118245197A (zh) * | 2024-05-27 | 2024-06-25 | 中航信移动科技有限公司 | 一种多类型集群协同调度方法、存储介质及电子设备 |
| CN118689662A (zh) * | 2024-08-29 | 2024-09-24 | 浙江大华技术股份有限公司 | 基于分布式的资源调整方法、设备以及存储介质 |
| CN119201620A (zh) * | 2024-09-20 | 2024-12-27 | 深圳市海豚互联网有限公司 | SaaS系统的云计算分析方法、装置、设备及存储介质 |
| CN119201620B (zh) * | 2024-09-20 | 2025-09-16 | 深圳市海豚互联网有限公司 | SaaS系统的云计算分析方法、装置、设备及存储介质 |
| CN119690347A (zh) * | 2024-12-04 | 2025-03-25 | 北京邮电大学 | 一种基于cgroup的IO控制优化方法 |
| CN119960921A (zh) * | 2025-04-10 | 2025-05-09 | 之江实验室 | 一种容器服务管理方法及装置 |
| CN120218873A (zh) * | 2025-05-28 | 2025-06-27 | 深圳市特区建工集团有限公司 | 基于微服务架构的工地应急管理方法、装置、设备及介质 |
| CN120218873B (zh) * | 2025-05-28 | 2025-10-10 | 深圳市特区建工集团有限公司 | 基于微服务架构的工地应急管理方法、装置、设备及介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| EP4571506A1 (en) | 2025-06-18 |
| US20250199877A1 (en) | 2025-06-19 |
| CN117687739A (zh) | 2024-03-12 |
| EP4571506A4 (en) | 2025-11-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP4571506A1 (en) | Resource scheduling method and related device | |
| CN108632365B (zh) | 服务资源调整方法、相关装置和设备 | |
| CN112583861B (zh) | 服务部署方法、资源配置方法、系统、装置及服务器 | |
| WO2017041556A1 (zh) | 虚拟资源调度方法、装置及系统 | |
| JP6538869B2 (ja) | ネットワーク管理 | |
| US9405563B2 (en) | Resource management method and apparatus for virtual machine system, and virtual machine system | |
| CN107968802B (zh) | 一种资源调度的方法、装置和过滤式调度器 | |
| US10587462B2 (en) | Method and apparatus for deploying virtual operation, administration and maintenance, and virtualized network system | |
| CN111338774A (zh) | 分布式定时任务调度系统及计算装置 | |
| CN115048260B (zh) | 一种基于云计算的核电厂PaaS平台资源配额监控方法和系统 | |
| CN105912401A (zh) | 一种分布式数据批处理系统和方法 | |
| CN107637111A (zh) | 用于提供和分配频谱资源的系统和方法 | |
| US20230388844A1 (en) | Translating commands for legacy radio access network | |
| CN106452818A (zh) | 一种资源调度的方法和系统 | |
| CN105893113A (zh) | 虚拟机的管理系统及管理方法 | |
| CN107562512A (zh) | 一种迁移虚拟机的方法、装置及系统 | |
| US12530241B2 (en) | Cloud instance scaling method and related device thereof | |
| CN105868004A (zh) | 一种基于云计算的业务系统的调度方法及调度装置 | |
| CN110851252A (zh) | 一种基于tsn架构的规约转换设备和规约转换方法 | |
| EP2996382B1 (en) | Physical resource adjustment method, device and controller | |
| CN118733502A (zh) | 一种数据传输方法、装置、电子设备及介质 | |
| CN110971532B (zh) | 一种网络资源管理方法、装置及设备 | |
| CN106843890A (zh) | 基于智能决策的传感器网络、节点及其运行方法 | |
| CN118689662A (zh) | 基于分布式的资源调整方法、设备以及存储介质 | |
| CN117149441A (zh) | 一种应用于IoT的任务调度优化方法 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23861939 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 2023861939 Country of ref document: EP |
|
| ENP | Entry into the national phase |
Ref document number: 2023861939 Country of ref document: EP Effective date: 20250310 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| WWP | Wipo information: published in national office |
Ref document number: 2023861939 Country of ref document: EP |