Container scheduling method, device and system
By obtaining resource information of working nodes and applications in the container scheduling system and adopting a scheduling mode based on resource consumption and performance, the problem of resource waste in working nodes is solved, resource rebalancing and reasonable allocation are achieved, and overall resource utilization is improved.
Patent Information
- Application Number
- CN202211734066.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In existing container scheduling systems, as the number of applications increases, some remaining resources in working nodes cannot be utilized, resulting in resource waste and low overall resource utilization.
By obtaining resource information of working nodes and applications, and adopting a scheduling mode based on resource consumption and application performance, the scheduling of containers on working nodes can be flexibly adjusted to achieve resource rebalancing and reasonable configuration.
It improves the rationality and utilization of resource configuration, reduces resource waste, and optimizes the allocation of system resources.
Smart Images

Figure CN116225612B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of container scheduling, and in particular to a container scheduling method, device, and system. Background Art
[0002] Microservices architecture is a new technology for deploying applications in the cloud, with container technology being one of the key enabling technologies. Container technology partitions the computing resources of an operating system into multiple independent runtime environments. Each independent runtime environment corresponds to a container, which can run one or more applications (APPs) based on user needs. Clusters are formed by multiple hosts, each of which uses container technology to partition multiple independent runtime environments to host different applications, enabling independent deployment and operation of each application.
[0003] Cluster management and maintenance can be achieved based on the Kubernetes open source platform (k8s for short). Specifically, in k8s, the host used to host applications is called a worker node, and the host used to manage the worker nodes is called a control node. A cluster can include multiple control nodes and multiple worker nodes. The control node is used to receive user configuration requests for a specific application and, based on the application's configuration request, determines a worker node that meets the configuration request to host the application through the scheduler in the control node.
[0004] Among them, the control node schedules the containers in the determined working nodes to carry the corresponding applications based on the scheduling strategy determined by the scheduler. Currently, the common scheduling strategy is to traverse the remaining resources of all working nodes managed by the scheduler, select at least one working node that meets the resources required by the application, and further determine the working node with the best operating environment among at least one working node to carry the service. Among them, the operating environment can be judged by the remaining resources in the working nodes. For example, the user sends a configuration request to install application A. Based on the configuration request, the scheduler determines that the remaining resources of working node 1 and working node 2 among all the working nodes managed can carry application A. Among them, working node 1 is in an idle state and is not currently carrying other applications; working node 2 is in a non-idle state and is currently carrying other applications. At this time, the scheduler determines that working node 1 is used to carry application A.
[0005] In the above method, as the number of applications increases, after the control node schedules the containers carrying each application in each working node, some remaining resources in each working node may not be utilized because they do not meet the configuration requests of the application, thereby making it impossible to reasonably utilize the overall resources managed by the scheduler in the control node. Summary of the Invention
[0006] The embodiments of the present application provide a container scheduling method, device, and system for improving overall resource utilization.
[0007] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0008] In a first aspect, a container scheduling method is provided, comprising: obtaining resource information of at least two working nodes and resource information of at least one application, the resources of the at least two working nodes including at least one of the number of CPU cores, memory capacity, or hard disk capacity; wherein the resource information of the at least one application is used to describe the resources of the working node required by the at least one application during operation; determining a target working node based on the resource information of the at least one application and the resource information of the at least two working nodes, wherein the target working node is the minimum number of working nodes required for the operation of the at least one application, or the target working node is the working node with the shortest non-uniform memory access (NUMA) path required for the operation of the at least one application; and when the working node on which the at least one application is running is different from the target working node, scheduling the at least one application to a container on the target working node.
[0009] Because the current control node schedules containers in the working node for the new application based on the optimal method for the current environment, some of the remaining resources in the working node cannot be utilized, resulting in resource waste. In response to this, the container scheduling method proposed in this application obtains resource information of at least one application in the system and resource information of at least two working nodes, and provides two scheduling modes for container scheduling based on two factors: resource consumption and application performance. This rebalances system resources and flexibly adjusts the containers carrying applications in the working node, thereby achieving flexible resource configuration and improving the rationality of resource configuration.
[0010] In a possible implementation, the method further includes: when the at least one application is not running on at least one of the at least two working nodes, scheduling the at least one application to a container on the target working node.
[0011] This possible implementation provides a configuration method based on resource information when at least one application is not running, which helps to improve resource utilization.
[0012] In one possible implementation, scheduling at least one application to a container of a target work node specifically includes: determining an idle work node, where the idle work node is a work node that is not running at least one application; creating a copy of at least one application on the idle work node; scheduling the at least one application to a container of the target work node; and deleting the copy on the idle work node.
[0013] This possible implementation method provides a specific implementation method for container scheduling, which helps to utilize idle working nodes and improve container scheduling efficiency.
[0014] In one possible implementation, after determining the target work node based on resource information of at least one application and resource information of at least two work nodes, the method further includes: determining a first change amount between the target work node and the number of work nodes running at least one application; when the first change amount is less than or equal to a first threshold, scheduling at least one application to a container of the target work node is not executed; or, determining a second change amount between the NUMA path of the target work node and the NUMA path of the work node running at least one application; when the second change amount is less than or equal to a second threshold, scheduling at least one application to a container of the target work node is not executed.
[0015] This possible implementation method provides judgment conditions before scheduling execution, which helps to integrate system resources when the degree of resource changes in the system is large, thereby obtaining better scheduling results.
[0016] In a second aspect, a container scheduling method is provided, including: obtaining resource information of a first application, the resource information of the first application is used to describe the resources of the work node required by the first application during operation, and the resources include at least one of the number of CPU cores, memory capacity or hard disk capacity; obtaining resource information of at least two work nodes, one or more work nodes of the at least two work nodes run the second application; determining the first work node, the first work node meets the resources required for the operation of the first application; the at least two work nodes include the first work node; scheduling the first application to the container in the first work node; obtaining resource information of the second application; determining the target work node based on the resource information of the first application, the resource information of at least two work nodes and the resource information of the second application, wherein the target work node is the least work node that meets the operation of the first application and the second application, or the target work node is the work node with the shortest non-uniform memory access (NUMA) path that meets the operation of the first application and the second application; when the first work node and the target work node are different, scheduling the first application to the container on the target work node.
[0017] Because the current control node configures the optimal operating environment for the application based on the application's configuration request, some remaining resources in the system's working nodes may not be utilized, resulting in resource waste and inability to properly manage the resources in the working nodes. In response to this, the container scheduling method proposed in this application is used to configure a working node that meets the operating conditions for the first application and rebalance the overall resources, thereby optimizing the allocation of system resources and improving the rationality of resource allocation.
[0018] In one possible implementation, the target working node is determined based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the second application, specifically including: executing the determination of the target working node based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the second application according to user instructions; or, periodically executing the determination of the target working node based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the second application; or, when the number of working nodes already in use is greater than or equal to a preset threshold, executing the determination of the target working node based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the second application.
[0019] This possible implementation method provides a specific implementation scenario for determining the target working node, improving the feasibility of the solution.
[0020] In a third aspect, a container scheduling method is provided, including: obtaining resource information of a first application, the resource information of the first application is used to describe the resources of the working nodes required by the first application during operation, and the resources include at least one of the number of CPU cores, memory capacity or hard disk capacity; obtaining resource information of at least two working nodes, and some working nodes of at least two working nodes run the second application; when the number of working nodes already in use is less than a third threshold: determining a second working node, and the second working node meets the resources required for the first application to run; the at least two working nodes include the second working node; scheduling the first application to a container in the second working node; when the number of working nodes already in use is greater than or equal to the third threshold: obtaining resource information of the second application; determining a first target working node based on the resource information of the first application, the resource information of at least two working nodes and the resource information of the second application, wherein the first target working node is the least working node that meets the running of the first application and the second application, or the first target working node is the working node with the shortest non-uniform memory access (NUMA) path that meets the running of the first application and the second application; scheduling the first application to the container on the first target working node.
[0021] Because the current control node configures the working node with the best operating environment for the application based on the configuration request of the application, some of the remaining resources in the working nodes in the system may not be utilized, resulting in resource waste and inability to reasonably manage the resources in the working nodes. In this regard, the container scheduling method proposed in this application is adopted to directly configure the first application by determining the number of working nodes already in use, or to uniformly configure the first application and the second application by obtaining the resource information of the first application, the resource information of at least two working nodes, and the resource information of the second application in the system, thereby achieving flexible resource configuration and improving the rationality of resource configuration.
[0022] In one possible implementation, after scheduling the first application to a container in the second work node, the method further includes: obtaining resource information of a third application, the third application running on one or more work nodes of at least two work nodes; determining a second target work node based on the resource information of the first application, the resource information of at least two work nodes, and the resource information of the third application, wherein the second target work node is the minimum work node that satisfies the running of the first application and the third application, or the second target work node is the work node with the shortest non-uniform memory access (NUMA) path that satisfies the running of the first application and the third application; when the first work node and the second target work node are different, scheduling the first application to the container on the second target work node.
[0023] This possible implementation method helps to rebalance system resources and improve resource utilization after configuring nodes that meet the operating conditions for the first application.
[0024] In one possible implementation, the second target working node is determined based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the third application, specifically including: executing the determination of the second target working node based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the third application according to user instructions; or, periodically executing the determination of the second target working node based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the third application; or, when the number of working nodes already in use is greater than or equal to a preset threshold, executing the determination of the second target working node based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the third application.
[0025] This possible implementation method provides a specific implementation scenario for determining the target working node, improving the feasibility of the solution.
[0026] In a fourth aspect, a control node is provided, comprising a scheduler, a controller and a transceiver, wherein the scheduler and the controller are respectively connected to the transceiver; the scheduler is used to perform the following steps: obtain resource information of at least two working nodes and resource information of at least one application, the resources of at least two working nodes including at least one of the number of CPU cores, memory capacity or hard disk capacity; wherein the resource information of at least one application is used to describe the resources of the working node required by at least one application during operation; determine the target working node based on the resource information of at least one application and the resource information of at least two working nodes, wherein the target working node is the minimum number of working nodes required for the operation of at least one application, or the target working node is the working node with the shortest non-uniform memory access (NUMA) path required for the operation of at least one application; when the working node on which at least one application runs is different from the target working node, determine to schedule at least one application to a container on the target working node; the controller is used to determine a target instruction for scheduling at least one application to a container on the target working node; and the transceiver is used to send the target instruction to the target working node.
[0027] In a fifth aspect, a control node is provided, comprising a scheduler, a controller, and a transceiver, wherein the scheduler and the controller are respectively connected to the transceiver; the scheduler is configured to perform the following steps: obtaining resource information of a first application, wherein the resource information of the first application is used to describe the resources of a work node required by the first application during operation, wherein the resources include at least one of the number of CPU cores, memory capacity, or hard disk capacity; obtaining resource information of at least two work nodes, wherein one or more work nodes of the at least two work nodes run a second application; determining a first work node, wherein the first work node meets the resources required for the first application to be run; wherein the at least two work nodes include the first work node; and the controller is configured to determine a first instruction for scheduling the first application to a container in the first work node; A transceiver is used to send a first instruction; the scheduler is also used to perform the following steps: obtaining resource information of the second application; determining a target working node based on the resource information of the first application, resource information of at least two working nodes, and resource information of the second application, wherein the target working node is the minimum working node that satisfies the operation of the first application and the second application, or the target working node is the working node with the shortest non-uniform memory access (NUMA) path that satisfies the operation of the first application and the second application; when the first working node and the target working node are different, determining to schedule the first application to a container on the target working node; the controller is also used to determine a target instruction for scheduling the first application to the container on the target working node; the transceiver is also used to send the target instruction.
[0028] In a sixth aspect, a control node is provided, including a scheduler, a controller and a transceiver, the scheduler and the controller are respectively connected to the transceiver; the scheduler is used to perform the following steps: obtain resource information of a first application, the resource information of the first application is used to describe the resources of the working node required by the first application when running, and the resources include at least one of the number of CPU cores, memory capacity or hard disk capacity; obtain resource information of at least two working nodes, and some working nodes of at least two working nodes run the second application; when the number of working nodes already used is less than a third threshold: determine a second working node, and the second working node meets the resources required for the first application to run; the at least two working nodes include the second working node; the controller is used to determine a second instruction to schedule the first application to a container in the second working node command; a transceiver for sending a second instruction; a scheduler for performing the following steps: when the number of used work nodes is greater than or equal to a third threshold: obtaining resource information of the second application; determining a first target work node based on the resource information of the first application, the resource information of at least two work nodes, and the resource information of the second application, wherein the first target work node is the minimum work node that satisfies the operation of the first application and the second application, or the first target work node is the work node with the shortest non-uniform memory access (NUMA) path that satisfies the operation of the first application and the second application; determining to schedule the first application to a container on the first target work node; the controller is further used to determine a target instruction for scheduling the first application to the container on the target work node; the transceiver is further used to send the target instruction.
[0029] In the seventh aspect, a control node is provided, comprising a functional unit for executing any one of the methods provided in the first aspect, wherein the actions performed by each functional unit are implemented by hardware or by executing corresponding software implementations through hardware. For example, the control node may include: an acquisition unit, a processing unit, and a scheduling unit. The acquisition unit is used to acquire resource information of at least two working nodes and resource information of at least one application, wherein the resources of at least two working nodes include at least one of the number of CPU cores, memory capacity, or hard disk capacity; wherein the resource information of at least one application is used to describe the resources of the working node required by at least one application during operation; the processing unit is used to determine the target working node based on the resource information of at least one application and the resource information of at least two working nodes, wherein the target working node is the minimum number of working nodes required to run at least one application, or the target working node is the working node with the shortest non-uniform memory access (NUMA) path required to run at least one application; the scheduling unit is used to schedule at least one application to a container on the target working node when the working node running at least one application is different from the target working node.
[0030] In an eighth aspect, a control node is provided, comprising functional units for executing any one of the methods provided in the second aspect, wherein the actions performed by each functional unit are implemented via hardware or via hardware executing corresponding software implementations. For example, the control node may include: an acquisition unit, a processing unit, and a scheduling unit. An acquisition unit is used to acquire resource information of a first application, where the resource information of the first application is used to describe the resources of a work node required by the first application during operation, where the resources include at least one of the number of CPU cores, memory capacity, or hard disk capacity; the acquisition unit is also used to acquire resource information of at least two work nodes, where one or more work nodes of the at least two work nodes run a second application; a processing unit is used to determine a first work node, where the first work node meets the resources required for the first application to run; the at least two work nodes include the first work node; a scheduling unit is used to schedule the first application to a container in the first work node; the acquisition unit is also used to acquire resource information of the second application; the processing unit is also used to determine a target work node based on the resource information of the first application, the resource information of at least two work nodes, and the resource information of the second application, where the target work node is the least work node that meets the requirements for running the first application and the second application, or the target work node is the work node with the shortest non-uniform memory access (NUMA) path that meets the requirements for running the first application and the second application; when the first work node and the target work node are different, the scheduling unit is also used to schedule the first application to a container on the target work node.
[0031] In a ninth aspect, a control node is provided, comprising functional units for executing any one of the methods provided in the third aspect, wherein the actions performed by each functional unit are implemented via hardware or via hardware executing corresponding software implementations. For example, the control node may include: an acquisition unit, a processing unit, and a scheduling unit. An acquisition unit is configured to acquire resource information of a first application, where the resource information of the first application is used to describe the resources of a work node required by the first application during operation, where the resources include at least one of the number of CPU cores, memory capacity, or hard disk capacity. The acquisition unit is further configured to acquire resource information of at least two work nodes, where some of the at least two work nodes run a second application. A processing unit is configured to, when the number of used work nodes is less than a third threshold, determine a second work node, where the second work node meets the resources required for the first application to run. The at least two work nodes include the second work node. A scheduling unit is configured to schedule the first application to a container in the second work node. The processing unit is further configured to, when the number of used work nodes is greater than or equal to the third threshold, acquire resource information of the second application. The processing unit is further configured to determine a first target work node based on the resource information of the first application, the resource information of the at least two work nodes, and the resource information of the second application, where the first target work node is the minimum work node that meets the requirements for running the first application and the second application, or the first target work node is the work node with the shortest non-uniform memory access (NUMA) path that meets the requirements for running the first application and the second application. The scheduling unit is further configured to schedule the first application to a container on the first target work node.
[0032] In the tenth aspect, a container scheduling system is provided, comprising: a control node and at least two working nodes; the control node is used to perform the following steps: obtain resource information of at least two working nodes and resource information of at least one application, the resources of at least two working nodes including at least one of the number of CPU cores, memory capacity or hard disk capacity; wherein the resource information of at least one application is used to describe the resources of the working node required by at least one application during operation; determine the target working node based on the resource information of at least one application and the resource information of at least two working nodes, wherein the target working node is the minimum number of working nodes required for the operation of at least one application, or the target working node is the working node with the shortest non-uniform memory access (NUMA) path required for the operation of at least one application; when the working node on which at least one application runs is different from the target working node, send a target instruction to the target working node to schedule at least one application to the container on the target working node; the target working node is used to receive the target instruction and perform scheduling according to the target instruction.
[0033] In an eleventh aspect, a container scheduling system is provided, comprising: a control node and at least two working nodes; the control node is configured to perform the following steps: obtaining resource information of a first application, the resource information of the first application being used to describe the resources of the working node required by the first application when running, the resources including at least one of the number of CPU cores, memory capacity or hard disk capacity; obtaining resource information of at least two working nodes, one or more working nodes of at least two working nodes running a second application; determining a first working node, the first working node meeting the resources required by the first application when running; the at least two working nodes including the first working node; sending a first instruction to the first working node to schedule the first application to a container in the first working node; the first working node, using The control node is used to receive a first instruction and perform scheduling according to the first instruction; the control node is further used to perform the following steps: obtain resource information of the second application; determine the target working node according to the resource information of the first application, the resource information of at least two working nodes and the resource information of the second application, wherein the target working node is the minimum working node that satisfies the operation of the first application and the second application, or the target working node is the working node with the shortest non-uniform memory access (NUMA) path that satisfies the operation of the first application and the second application; when the first working node is different from the target working node, send a target instruction to the target working node to schedule the first application to the container on the target working node; the target working node is used to receive the target instruction and perform scheduling according to the target instruction.
[0034] In a twelfth aspect, a container scheduling system is provided, comprising: a control node and at least two working nodes; the control node is configured to perform the following steps: obtaining resource information of a first application, the resource information of the first application being used to describe the resources of the working node required by the first application during operation, the resources including at least one of the number of CPU cores, memory capacity, or hard disk capacity; obtaining resource information of at least two working nodes, some of the working nodes of at least two working nodes running a second application; when the number of used working nodes is less than a third threshold: determining a second working node, the second working node meeting the resources required for the first application to be run; the at least two working nodes including the second working node; sending a second instruction to the second working node to schedule the first application to a container in the second working node; the second working node, Used to receive a second instruction and perform scheduling according to the second instruction; the control node is also used to perform the following steps: when the number of working nodes already in use is greater than or equal to a third threshold: obtain resource information of the second application; determine a first target working node based on the resource information of the first application, the resource information of at least two working nodes and the resource information of the second application, wherein the first target working node is the minimum working node that satisfies the operation of the first application and the second application, or the first target working node is the working node with the shortest non-uniform memory access (NUMA) path that satisfies the operation of the first application and the second application; send a target instruction to the first target working node to schedule the first application to the container on the first target working node; the target working node is used to receive the target instruction and perform scheduling according to the target instruction.
[0035] In a thirteenth aspect, a communication device is provided, comprising: a processor and a memory. The processor is connected to the memory, the memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions stored in the memory, thereby implementing any one of the methods provided in the first to third aspects.
[0036] In the fourteenth aspect, a chip is provided, which includes: a processor and an interface circuit; the interface circuit is used to receive code instructions and transmit them to the processor; the processor is used to run the code instructions to execute any one of the methods provided in the first to third aspects.
[0037] In the fifteenth aspect, a computer-readable storage medium is provided, comprising computer execution instructions, which, when the computer execution instructions are executed on a computer, enable the computer to execute any one of the methods provided in the first to third aspects.
[0038] In the sixteenth aspect, a computer program product is provided, comprising computer execution instructions, which, when the computer execution instructions are run on a computer, enable the computer to execute any one of the methods provided in the first to third aspects.
[0039] The technical effects brought about by any implementation method in the fourth to sixteenth aspects can be referred to the technical effects brought about by the corresponding implementation methods in the first to third aspects, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of the composition of each node in a k8s provided in an embodiment of the present application;
[0041] Figure 2 A schematic diagram of a strategy for scheduling an application to a target working node provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of the hardware composition of a communication device provided in an embodiment of the present application;
[0043] Figure 4 A flowchart of a container scheduling method provided in an embodiment of the present application;
[0044] Figure 5 A schematic diagram of a working node with four processors deployed in a NUMA architecture according to an embodiment of the present application;
[0045] Figure 6 A flowchart of a container scheduling method provided in an embodiment of the present application;
[0046] Figure 7 A flowchart of a container scheduling method provided in an embodiment of the present application;
[0047] Figure 8 A flowchart of a container scheduling method provided in an embodiment of the present application;
[0048] Figure 9 A schematic diagram of the composition of a control node provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "a plurality" means two or more. Words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not limit them to be necessarily different.
[0050] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0051] Currently, container scheduling systems such as k8s provide a platform for configuring and managing containers for each worker node. In a container scheduling system, the host used to host applications can be called a worker node, and the host used to manage the worker node can be called a master node. Figure 1 As shown, the control node is used to manage worker nodes 1 and 2. It is understood that the container scheduling system may include multiple control nodes and multiple worker nodes managed by each control node. For ease of description, the following example uses one control node managing multiple worker nodes.
[0052] like Figure 1 As shown, a schematic diagram of the composition of a container scheduling system provided in an embodiment of the present application. Among them, the container scheduling system includes a control node and at least two working nodes. The resources in the working node are divided based on container technology, and the container carrying the application runs in the deployable unit (pod) in the working node. A pod may include one or more containers. The control node records the resource usage of the application in the working node by establishing a pod copy in the database (etcd), thereby achieving resource management of the working node. Specifically, the control node includes a command line tool (kuberctl), a transceiver (application program interface server, API server), a scheduler (scheduler), a controller (controller-manager, CM) and a database (etcd). kuberctl is used to receive commands for user-sent application configuration requests. The API server is used to receive the configuration request and, based on the configuration request, establish a pod copy in etcd based on the configuration request, wherein the pod copy is used to characterize the resource conditions required to run the application. The scheduler is used to determine the target working node to run the application in response to the new pod copy established by the API server. The controller sends instructions to create or schedule containers to the target worker node through the API server based on the scheduling policy. The database stores worker node resource information, application resource information, and the mapping between worker nodes and applications.
[0053] Among them, the worker node includes a worker proxy component (kubelet), a network proxy component (kube-proxy), a container engine (Docker), a deployable unit (pod), and a container (container). It is understandable that the control node needs to know the resource usage of the worker node to achieve unified management. Among them, the kubelet serves as the interaction component between the control node and the worker node to achieve information sharing and synchronization. Specifically, the kubelet is used to interact with the control node's API server, including creating, modifying, or deleting pods and containers in the worker node. In addition, the kubelet is also used to monitor the operation status of the worker node and report the abnormality information to the control node when an abnormality occurs. For example, it monitors the temperature of the CPU or memory in the worker node. When the temperature is too high, it feedbacks to the control node so that the control node can adjust the container in the worker node in a timely manner. The kube-proxy is used to receive user requests to access applications and locate the corresponding containers. The container engine is used to provide the operating environment for the operation of the pod.
[0054] As you can understand, users typically send configuration requests for an application using a command-line tool. The API server receives the configuration request and forwards it to the scheduler. The scheduler executes a scheduling policy based on the configuration request, determines which worker node to run the application from among the multiple worker nodes it manages, and ultimately schedules the container on that worker node to run the application through the controller and the API server. Based on this process, container scheduling enables the application to run, and users can subsequently access the application through the kube-proxy on that worker node.
[0055] like Figure 2 As shown, it provides Figure 1 A schematic diagram of a strategy for the container scheduling system in FIG. 1 when receiving a configuration request for a new application. The control node mainly determines the working node that hosts the application based on the strategy of filtering and calculating weights. For example, in Figure 2The control node includes hosts 1 through 8, each corresponding to a worker node. First, the control node filters out worker nodes that meet the application's configuration request based on all the worker nodes it manages. Specifically, the application's configuration request contains the computing resources used by the application during runtime, such as memory and the number of central processing unit (CPU) cores. Based on the parameters in the configuration request and the remaining resources of each host among all worker nodes, the control node filters out hosts that meet the configuration request, resulting in hosts 2, 4, 5, 7, and 8. Next, based on the remaining resources of each filtered host, the scheduler calculates a weight for each host. This weight indicates the host's resource usage. For example, it calculates parameters such as the host's CPU utilization and memory utilization. Hosts with lower CPU and memory utilization have better resource utilization. By calculating the weights of each host, the host with the best resource utilization is determined and selected as the target worker node for hosting the application. For example, based on the above method, host 2 is determined among host 2, host 4, host 5, host 7, and host 8 as the target working node that ultimately carries the application.
[0056] In the above method, as the number of applications increases, after the control node schedules each application to the working node, some remaining resources in each working node may not be utilized because they do not meet the configuration requests of the application, thereby making the overall resources managed by the scheduler unable to be reasonably utilized.
[0057] In this regard, the present application provides a container scheduling method, which integrates resources for the working nodes managed by the control node, calculates the optimal resource allocation strategy, and schedules the containers in the working nodes according to the resource allocation strategy, thereby improving the overall resource utilization.
[0058] The container scheduling method provided in the embodiment of the present application is mainly applied to a control node, which can be used as an independent communication device to execute the method provided in the present application. The present application does not limit the specific form of the communication device, which can be a terminal or a server. Among them, the terminal can be a mobile phone, augmented reality (AR) device, virtual reality (VR) device, tablet computer, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc. The server can be a physical or logical server.
[0059] In terms of hardware implementation, the above communication equipment can be implemented as follows: Figure 3 The communication device 30 shown in FIG. Figure 3 , which is a schematic diagram of the hardware structure of a communication device 30 provided in an embodiment of the present application.
[0060] Figure 3 The communication device 30 shown may include: a processor 301 , a memory 302 , a communication interface 303 , and a bus 304 . The processor 301 , the memory 302 , and the communication interface 303 may be connected via the bus 304 .
[0061] The processor 301 is the control center of the communication device 30 and can be a general-purpose CPU or other general-purpose processors, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0062] As an example, the processor 301 may include one or more CPUs, such as Figure 3 CPU 0 and CPU1 are shown in Figure 1.
[0063] The memory 302 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0064] In one possible implementation, memory 302 can exist independently of processor 301. Memory 302 can be connected to processor 301 via bus 304 and used to store data, instructions, or program code. When processor 301 calls and executes the instructions or program code stored in memory 302, the container scheduling method provided in the embodiments of the present application can be implemented.
[0065] In another possible implementation, the memory 302 may also be integrated with the processor 301 .
[0066] The communication interface 303 is used to connect the communication device 30 to other devices via a communication network. The communication network can be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 303 can include a receiving unit for receiving data and a sending unit for sending data.
[0067] The bus 304 can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0068] It should be pointed out that Figure 3 The structure shown in the figure does not constitute a limitation on the communication device 30, except Figure 3 In addition to the components shown, the communication device 30 may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0069] Combine Figure 1 The processor 301 in the communication device 30 is used to execute Figure 1 The functions implemented by the scheduler and controller. The memory 302 is used to execute Figure 1 Communication interface 303 is used to perform storage functions in etcd. Figure 1 The communication function of the API server. Or, Figure 1 Each component in the device can also be used as a device integrated control node with data processing and communication functions. This application does not limit this.
[0070] like Figure 4 The diagram is a flow chart of a container scheduling method provided by an embodiment of the present application, which can be applied to Figure 1 The control node in the container scheduling system shown includes steps S401-S403.
[0071] S401. Obtain resource information of at least two working nodes and resource information of at least one application.
[0072] The resource information of a worker node refers to the resources of the device corresponding to the worker node. This resource information includes information such as the number of CPU cores (referred to as CPU core count), memory capacity, and hard disk capacity. For example, Table 1 below provides a correspondence between worker nodes and their resource information.
[0073] Table 1. Correspondence between a work node and its resource information
[0074] Worker Node Number of CPU cores Memory capacity / GB Hard disk capacity / GB Worker Node 1 4 20 20 Worker Node 2 4 10 10
[0075] As shown in Table 1 above, Worker Node 1 has 4 CPU cores, 20 GB of memory, and 20 GB of hard disk capacity. Worker Node 2 also has 4 CPU cores, 10 GB of memory, and 10 GB of hard disk capacity.
[0076] The resource information of an application refers to the resources of the working node occupied by the application when it is running. For example, as shown in Table 2 below, a corresponding relationship between an application and its resource information is provided.
[0077] Table 2. Correspondence between an application and its resource information
[0078] application Number of CPU cores Memory capacity / GB Hard disk capacity / GB Application 1 5 3 2 Application 2 1 1 1
[0079] As shown in Table 2 above, Application 1 requires 5 CPU cores, 3 GB of memory capacity, and 2 GB of hard disk capacity.
[0080] It should be noted that the above-mentioned at least one application can be an application running in the working node, and can also include a new application that is not hosted in the working node and needs to be deployed. This application does not impose any restrictions on this.
[0081] It should be noted that the above-mentioned resource information of the application and the resource information of the working node are only examples. In actual applications, more or fewer resources and more or fewer types of resource information may be included.
[0082] If the application is currently hosted on a work node, the application's resource information also includes the original mapping relationship between the application and the work node. Specifically, it may also include information about the resources occupied by the application in the work node. For example, the original mapping relationship between an application and a work node is shown in Table 3 below.
[0083] Table 3. Original mapping relationship between an application and a working node
[0084]
[0085] As shown in Table 3 above, Application 1 occupies 2 CPU cores, 1 Gigabyte (GB) of memory, and 1 GB of hard disk space on Worker Node 1. Application 1 occupies 3 CPU cores, 2 GB of memory, and 1 GB of hard disk space on Worker Node 2. Application 2 occupies 1 CPU core, 1 GB of memory, and 1 GB of hard disk space on Worker Node 1.
[0086] It should be noted that the above resource information can be stored independently, or the above information can also be stored together. For example, as shown in Table 4, based on Table 3, resource information of applications that have not been configured can also be added.
[0087] Table 4. Original mapping relationship between an application and a working node
[0088]
[0089] As shown in Table 4, Application 3 has no working nodes with a mapping relationship because it has not been configured.
[0090] It should be noted that the above information is presented in the form of a table. In practical applications, it can also be presented in other forms, and this application does not limit this.
[0091] In one possible implementation, the scheduler in the control node obtains the resource information of the aforementioned applications and worker nodes through etcd. Specifically, the scheduler requests etcd to obtain the resource information of all currently stored worker nodes and applications. In response to the scheduler's request, etcd provides the scheduler with the required resource information.
[0092] S402: Determine a target working node according to resource information of at least one application and resource information of at least two working nodes.
[0093] The target working node may be one or more working nodes.
[0094] In this embodiment, at least one of the following two scheduling modes may be used to determine the target working node. The scheduling mode refers to a method for determining the target working node that hosts at least one application from at least two working nodes, including:
[0095] In the first scheduling mode, the control node determines the target working node according to the resource consumption. Specifically, the control node determines a first combination of working nodes that meets the resource information of at least one application, determines the combination with the least number of working nodes in the first combination as the first target combination, and determines the working nodes in the first target combination as the target working nodes. It can be understood that the more working nodes an application occupies, the greater the energy consumption of the working nodes in the running state, resulting in more overall resource consumption; and determining the minimum number of working nodes occupied by the application based on the resource information of the application helps to reduce the number of working nodes in the running state, thereby reducing energy consumption.
[0096] Specifically, the control node determines the target working node based on the resource information of at least one application. For example, in combination with the example shown in Table 4 above, including application 1, application 2 and application 3, if there is a working node 3, its CPU core number is 8, the memory capacity is 20GB, and the hard disk capacity is 20GB, then the working node 3 can be used as the target working node to carry application 1, application 2 and application 3, so that the working node 3 is in a running state, without the need to start two working nodes according to Table 4 above, thereby achieving energy consumption reduction. Among them, the original mapping relationship between application 1 and application 2 and working node 1, and the original mapping relationship between application 1 and working node 2, are updated to the target mapping relationship between application 1, application 2 and application 3 and working node 3, respectively. Among them, the target mapping relationship is used to represent the mapping relationship between an application and the target working node that carries the application.
[0097] The above method helps to integrate resources of control nodes and reduce the overall energy consumption of the system by adjusting the mapping relationship between applications and working nodes. In addition, it solves the problem in the existing technology that some remaining resources of working nodes cannot be utilized, thereby improving resource utilization.
[0098] In the second scheduling mode, the control node determines the target working node according to the performance of the application. The performance of the application can be represented by the time it takes to access the memory when the application is running in the working node. The shorter the time to access the memory, the better the performance of the application. Specifically, the working node may include multiple processors, and the multiple processors may adopt a non-uniform memory access (NUMA) architecture. In the NUMA architecture, the access time of the memory depends on the relative position of the processor and the memory. That is, each processor has a built-in memory, and each processor can access the local memory or the memory in other processors. However, since the paths for each processor to access the local memory and the memory in other processors are different, there are differences in the time it takes for the processor to access the memory in different locations, which in turn affects the performance of the application. Specifically, the control node determines a second combination of all working nodes that meet the resource information of at least two working nodes, determines the combination with the shortest NUMA path in the second combination as the second target combination, and determines the working node in the second target combination as the target working node. For example, Figure 5 Figure 1 shows a schematic diagram of a work node deploying four processors using a NUMA architecture. The path that the processor takes to access local memory is the shortest, which can also be expressed as the shortest NUMA path.
[0099] It should be noted that the control node can determine the scheduling mode adopted by the target working node in the following specific ways. Method one, preset any one of the above scheduling modes in the control node, and execute it according to the preset scheduling mode. Method two, determine based on user instructions. For example, the user receives the user's instructions through the command line tool of the control node, and determines to adopt the first scheduling mode or the second scheduling mode. Furthermore, at least one application can also be divided into multiple parts, and different scheduling modes are used to execute in combination with method one or method two. For example, when at least one application includes multiple applications, the scheduling mode of a first threshold number of applications in the multiple applications is determined as the first scheduling mode, and the scheduling mode of the remaining number of applications in the multiple applications is determined as the second scheduling mode. For another example, the user specifies that some applications in at least one application execute the first scheduling mode, and the remaining applications execute the second scheduling mode.
[0100] It should be noted that the above step S402 can be executed in the following scenarios. Scenario one, scheduling is performed based on user instructions. For example, when the user receives the user's execution instruction through the command line tool of the control node, the above step S402 is executed. Scenario two, execution is performed according to the preset cycle. Scenario three, the number of working nodes already used is determined, and execution is performed when certain conditions are met. For example, when the number of working nodes already used is greater than or equal to a preset threshold, the above method is executed. The preset threshold is a preset value or is obtained based on a first preset percentage of the total number of working nodes. For example, the first preset percentage is 30%. If the total number of working nodes managed by the control node is 100, then when the number of working nodes already used is greater than or equal to 30, the control node executes the above step S402.
[0101] It is understandable that when an application is configured to run on a processor with local memory, that is, when the shortest NUMA path is provided for the application, its performance is optimal. However, due to the large number of applications, when the application performance is optimized, the number of working nodes in operation is large, resulting in high system energy consumption and waste of processor or memory resources. In this regard, the above-mentioned control node adopts different scheduling modes for different applications, specifically including: configuring some applications in a manner with optimal performance, and configuring the remaining applications in a manner with the least number of nodes. For example, the application using the second scheduling mode can be the application corresponding to the second preset percentage of the number of applications in the container scheduling system. For example, if the second preset percentage is 30%, the application using the second scheduling mode is 30% of the number of applications in the container scheduling system. Furthermore, the remaining 70% of the applications can determine the target working nodes according to the first scheduling mode.
[0102] For example, in combination with the applications shown in Table 4 above, if the applications using the second scheduling mode account for 30% of the number of applications in the container scheduling system, one of the applications needs to meet the configuration method with the best performance and occupy a working node. At this time, the remaining applications in the container scheduling system may need to occupy other working nodes in order not to affect the operation of the application with the best performance. In other words, in this way, the number of occupied working nodes may be greater than or equal to the number of working nodes determined based on the resource consumption situation. For example, if there is a working node 4, its number of CPUs is 4, the number of CPU cores is 8, the memory capacity is 20GB, and the hard disk capacity is 20GB, then the working node 4 can be used as a target working node to carry application 1, application 2 and application 3, wherein application 3 occupies an independent CPU and its corresponding memory, so that the performance of application 3 is optimal. In this way, only one working node is in operation in the system, and there is no need to start two working nodes according to Table 4 above, thereby reducing energy consumption. The original mapping relationships between application 1 and application 2 and worker node 1, and the original mapping relationship between application 1 and worker node 2, are updated to target mapping relationships between application 1, application 2, and application 3 and worker node 4, respectively.
[0103] It should be noted that the result of the number of applications calculated based on the first preset percentage or the second preset percentage can be rounded down or rounded up to obtain an integer number of applications, thereby facilitating resource allocation by the control node. The target applications whose number of applications meets the first threshold can be randomly selected, or they can be selected according to other rules. For example, a sequence is determined based on the resource usage of each application, and applications with less resource usage are selected as target applications. The above content is only for example. In actual applications, other methods can be used for implementation, and this application does not impose any restrictions on this.
[0104] Optionally, the target worker node for an application running in the container scheduling system is determined based on the resource usage cap of each worker node. For example, the resource usage cap of each worker node is 95% of its available resources, and the target worker node is determined for the application in the container scheduling system based on this cap.
[0105] It is understood that the above process is independently completed by the scheduler in the control node, and the scheduling strategy is determined based on the resource information obtained from etcd. Among them, the number of applications and the number of working nodes to be adjusted can be part or all of the system, and this application does not limit this.
[0106] S403: When the working node on which the at least one application runs is different from the target working node, schedule the at least one application to a container on the target working node.
[0107] Scheduling a container refers to scheduling the container corresponding to the application in the changed mapping relationship in the target mapping relationship on the target working node according to the target mapping relationship. The changed mapping relationship includes the following two situations.
[0108] In case 1, the application has been configured with a worker node, and the worker node it runs on is different from the target worker node. This application has an original mapping relationship, which needs to be changed to the target mapping relationship. Based on the above example, the original mapping relationships between Application 1 and Application 2 and Worker Node 1 in Table 4 are changed to the target mapping relationship between Application 1 and Worker Node 3, and the target mapping relationship between Application 2 and Worker Node 3, respectively.
[0109] Specifically, the controller in the control node sends instructions to create pod replicas of Application 1 and Application 2 to the kubelet of the idle worker node through the API server based on the scheduler's scheduling policy. These pod replicas are used to continuously provide business services to users and avoid service interruptions during the migration process. When the pod replicas are created, the kubelet sends a response message back to the API server of the control node. The controller of the control node monitors the response message received by the API server and sends instructions to migrate the pods of Application 1 and Application 2 to the kubelet of Worker Node 1. After the migration is complete, the controller instructs the kubelet of the idle worker node to delete the pod replicas in the idle worker node.
[0110] This method helps to reserve some resources for the target working node that hosts the application during the process of determining the target working node, thereby avoiding the working node being in a fully loaded state.
[0111] Case 2: The application is not configured with a worker node. There is no original mapping relationship for the application. A new pod needs to be created for the application in the target worker node based on the target mapping relationship.
[0112] Specifically, the controller in the control node sends a pod creation instruction to the target worker node through the API server according to the target mapping relationship determined by the scheduling policy. In response, the kubelet in the target worker node receives the instruction and creates the pod. After the creation is completed, it feedbacks the response information to the API server of the control node, thereby completing the configuration of the application.
[0113] It's understandable that in the above process, pods are the smallest deployable unit in the container scheduling system. Therefore, container scheduling requires pod migration during actual execution. This approach helps change the original application mapping and completes the container scheduling process for the application.
[0114] Optionally, the above step S403 can be performed when the change amount between the target mapping relationship determined in step S402 and the original mapping relationship meets the first condition. In one possible implementation, when the scheduling mode is the first scheduling mode, after the above step S402, the method further includes determining a first change amount between the target working node and the number of working nodes running at least one application; if the first change amount is less than the first threshold, step S403 is not performed; if the first change amount is greater than the first threshold, step S403 is performed. If the change amount is equal to the first threshold, step S403 may be performed, or step S403 may not be performed. Wherein, whether the first change amount meets the first condition is represented by the relationship between the number of working nodes started before and after scheduling and the first threshold. This possible implementation corresponds to the above method of determining the scheduling strategy based on resource consumption.
[0115] This method helps to determine whether to execute scheduling based on the change in the number of working nodes before and after scheduling, thereby avoiding executing the above method when the number change is small, resulting in a small change in overall resource utilization and unnecessary energy consumption.
[0116] In another possible implementation, when the scheduling mode is the second scheduling mode, after the above step S402, the method further includes determining a second change amount between the NUMA path of the target working node and the NUMA path of the working node running at least one application. Specifically, if the change in the number of applications with the shortest NUMA path before and after scheduling is less than the second threshold, step S403 is not executed; if the change in the number of applications is greater than the second threshold, step S403 is executed; if the change in the number of applications is equal to the second threshold, step S403 may be executed, or step S403 may not be executed. Whether the second change amount satisfies the first condition is represented by the relationship between the number of applications with the shortest NUMA path before and after scheduling and the second threshold. This possible implementation corresponds to the above method of determining the scheduling strategy based on the performance of the application.
[0117] This method helps to determine whether to execute scheduling based on the performance changes of the application before and after scheduling, thereby avoiding unnecessary energy consumption due to the small performance changes of the applications carried by the running working nodes and the small overall performance changes of the system after executing the above method.
[0118] It is understandable that the above-mentioned method of scheduling containers can further determine whether to execute scheduling based on the changes before and after scheduling after determining the scheduling strategy, thereby helping to improve resource integration efficiency and avoid executing resource integration when the overall resource utilization rate changes little, causing unnecessary energy consumption.
[0119] It should be noted that the two possible implementation methods provided above can also be considered comprehensively to determine whether to execute step S403. The above is only an example and this application does not impose any limitation on this.
[0120] Optionally, the following steps S11-S12 are further included after the above step S403.
[0121] S11. Repeat the above step S401 to obtain the resource information of the application and the resource information of the working node.
[0122] It is understandable that during the execution of steps S401-S404, the control node may receive a new application configuration request, or some applications on the worker nodes may go offline, causing the resource information of the application in the etcd of the control node to change from that of the worker nodes. Step S11 helps the control node obtain information about resource usage in the container scheduling system.
[0123] S12. Determine the change status based on the target mapping relationship.
[0124] Among them, the change is used to indicate the change in the number of working nodes updated based on step S403 and the number of working nodes obtained in step S11, or to indicate the change in the performance value updated based on step S403 and the performance value of the application obtained in step S11.
[0125] S13. Determine whether to repeat the above steps S401-S403 according to the change situation.
[0126] Specifically, if the above changes are within the preset range, the above steps are not repeated; if the above changes exceed the preset range, the above steps are repeated.
[0127] Among them, when the change is the change in the number of working nodes or the change in the performance value, if the change is within the preset range, for example, when the change in the number is less than or equal to the fourth threshold, or when the change in the performance value is less than or equal to the fifth threshold, the above steps are not repeated. If the change exceeds the preset range, for example, when the number is greater than the fourth threshold, or when the performance value is greater than the fifth threshold, the above steps are repeated. Among them, the performance value is used to represent the ratio of applications with the shortest NUMA path among the running applications, and can also be understood as the ratio of applications with the best performance among the running applications.
[0128] It will be appreciated that the above method is used to indicate that when the number of working nodes increases or decreases compared to the updated target number of working nodes, the change is less than or equal to the fourth threshold. The control node will then deem the change small and will not need to execute the above method again. Similarly, if the change in performance value is small, there is no need to execute the above method again, thereby avoiding repeated adjustments to overall resources due to changes in the number of working nodes, which could cause system oscillation and affect system stability.
[0129] Through steps S401-S403, the mapping between applications and worker nodes is reconfigured based on the resources occupied by the applications and the resources available on the worker nodes. The containers hosting the applications are then scheduled based on this mapping. This process can be called a system rebalancing process. This system rebalancing process helps consolidate unused remaining resources in each worker node, allowing them to be utilized in the subsequent configuration of new applications, thereby improving overall system resource utilization.
[0130] In the above embodiment, a specific implementation of the system rebalancing process is provided, wherein when the system receives a configuration request of a new application, it may have different effects on the system rebalancing process. Figure 6-Figure 8 The container scheduling method shown.
[0131] like Figure 6 As shown, the embodiment of the present application also provides a container scheduling method, which can be applied to Figure 1 The control node in the container scheduling system shown includes steps S601-S607.
[0132] S601: Obtain resource information of a first application.
[0133] The resource information of the first application is used to describe the resources of the working node required by the first application when running, and the resources include at least one of the number of CPU cores, memory capacity, or hard disk capacity. For a detailed description of the resource information, please refer to the above step S401.
[0134] Optionally, the resource information of the first application is obtained based on a configuration request of the first application, wherein the configuration request of the first application is used to request determination of a working node that carries the first application for the first application, and the configuration request includes the resource information of the first application.
[0135] Specifically, the API server in the control node receives a configuration request from the first application and, based on the configuration request, creates a first pod replica for the first application in etcd based on the resource information of the first application. Furthermore, the scheduler in the control node obtains the resource information of the first application from etcd.
[0136] S602: Obtain resource information of at least two working nodes.
[0137] One or more working nodes of the at least two working nodes run the second application.
[0138] S603: Determine a first working node, where the first working node meets the resources required when the first application is running.
[0139] Specifically, based on the resource occupancy condition, the container scheduling system can determine one by one whether the working node meets the resource occupancy condition in a polling manner. If so, the working node is output and the polling ends.
[0140] Specifically, the scheduler in the control node polls the working nodes in the container scheduling system for the first application based on the resource information of the above-mentioned first application, determines the first working node that meets the resource occupation conditions, and determines the scheduling strategy of the container in the first working node for carrying the first application.
[0141] S604: Schedule the first application to a container in the first working node.
[0142] Specifically, based on the above scheduling strategy, the controller in the control node sends an instruction to create a pod to the kubelet in the first working node through the API server. The kubelet of the first working node receives the instruction accordingly and creates a pod and a container for carrying the first application.
[0143] S605: Obtain resource information of the second application.
[0144] The second application may be one or more, and the one or more second applications run on one or more working nodes of the at least two working nodes.
[0145] Specifically, the scheduler in the control node obtains the resource information of the second application through etcd
[0146] S606: Determine a target working node according to the resource information of the first application, the resource information of at least two working nodes, and the resource information of the second application.
[0147] The resource information of the first application is obtained through the above step S601.
[0148] The scheduling mode includes a first scheduling mode and a second scheduling mode. When the scheduling mode is the first scheduling mode, a first combination of all working nodes that meet the resource information of the first application and at least one historical application is determined, the combination with the least number of working nodes in the first combination is determined as the first target combination, and the working node corresponding to the first application in the first target combination is determined as the target working node. When the scheduling mode is the second scheduling mode, a second combination of all working nodes that meet the resource information of the first application and at least one historical application is determined, the combination with the shortest non-uniform memory access (NUMA) path in the second combination is determined as the second target combination, and the working node corresponding to the first application in the second target combination is determined as the target working node.
[0149] Specifically, the scheduler in the control node determines the target working node. The process of determining the target working node based on the scheduling mode can refer to the description of step S402 above.
[0150] S607: When the first working node is different from the target node, schedule the first application to a container on the target working node.
[0151] Specifically, the controller and API server in the control node schedule the first application to the container on the target working node.
[0152] It can be understood that in the above steps S601-S607, the resource information of the first application that is not running in at least two working nodes is obtained, and the first working node that carries the first application is determined in at least two working nodes based on the resource information; further, the configured second application and the first application are integrated according to the scheduling result to optimize the resource configuration. Through the above method, when determining the working node for the first application for the first time, any one working node that meets the configuration request can be determined in at least two working nodes to carry the first application, thereby avoiding the use of the existing technology of filtering and weighting all working nodes in the container scheduling system to determine the working node to carry the application, greatly improving the configuration efficiency, and saving the computing resources of the control node. Furthermore, after the first application is deployed to the first working node, a system rebalancing process is performed to integrate the resources of the working nodes in the system including the first working node, adjust the configuration method of the resources in the system, and improve the utilization rate of the system resources.
[0153] Optionally, the above steps S605-S607 can be performed in the following scenarios. Scenario one, scheduling is performed based on user instructions. For example, when the user receives the user's execution instruction through the command line tool of the control node, the above method is executed. Scenario two, execution is performed according to a preset period. Scenario three, the number of working nodes already used is determined, and execution is performed when certain conditions are met. For example, when the number of working nodes already used is greater than or equal to a preset threshold, the above method is executed. The preset threshold is a preset value or is obtained based on a first preset percentage of the total number of working nodes. For example, the first preset percentage is 30%. If the total number of working nodes managed by the control node is 100, then when the number of working nodes already used is greater than or equal to 30, the control node executes the above method.
[0154] like Figure 7 As shown, the embodiment of the present application also provides a container scheduling method, which can be applied to Figure 1 The control node in the container scheduling system shown includes steps S701-S708.
[0155] S701: Obtain resource information of a first application.
[0156] S702: Obtain resource information of at least two working nodes.
[0157] Among them, steps S701-S702 are the same as the above steps S601-S602 and will not be repeated here.
[0158] S703: Determine whether the number of used working nodes is greater than or equal to a third threshold. If so, execute steps S704-S706; if not, execute steps S707-S708.
[0159] The third threshold is a preset value or is obtained based on a third preset percentage of the total number of working nodes. For example, if the third preset percentage is 30%, and the total number of working nodes managed by the control node is 100, then when the number of used working nodes is greater than or equal to 30, the control node executes steps S704-S706.
[0160] S704: Obtain resource information of the second application.
[0161] S705 . Determine a first target working node according to resource information of the first application, resource information of at least two working nodes, and resource information of the second application.
[0162] The first target working node is the minimum working node that satisfies the running of the first application and the second application, or the first target working node is the working node with the shortest NUMA path that satisfies the running of the first application and the second application.
[0163] S706. Schedule the first application to a container on the first target working node.
[0164] The above steps S704-S705 are similar to steps S605-S606 and will not be repeated here.
[0165] When the number of used working nodes is less than the third threshold, steps S707 - S708 are executed.
[0166] S707: Determine a second working node.
[0167] The at least two working nodes include a second working node, and the second working node meets the resources required by the first application when it is running.
[0168] S708. Schedule the first application to a container in the second working node.
[0169] The above steps S707-S708 are similar to steps S603-S604, and reference may be made to the above description.
[0170] It can be understood that when the first application is not running in at least two working nodes, the control node can determine the configuration method of the first application based on the number of working nodes already running in the current system, which helps to reduce the power consumption caused by the rebalancing process when the system is relatively idle. When the system is relatively busy, the new applications that need to be configured will be integrated with the running applications for unified resource integration, reducing the power consumption problem caused by multiple scheduling of applications and improving resource utilization.
[0171] Optionally, after the above step S708, the method also includes: obtaining resource information of the third application, wherein the third application runs on some of the working nodes of at least two working nodes; determining the second target working node based on the resource information of the first application, the resource information of at least two working nodes and the resource information of the third application, wherein the second target working node is the minimum working node that satisfies the running of the first application and the third application, or the second target working node is the working node with the shortest NUMA path that satisfies the running of the first application and the third application.
[0172] It should be noted that the above-mentioned third application can also be understood as the second application running in at least two working nodes.
[0173] Among them, the control node determines the second target working node based on the resource information of the first application, the resource information of at least two working nodes and the resource information of the third application, specifically including: executing according to the user instruction the resource information of the first application, the resource information of at least two working nodes and the resource information of the third application to determine the second target working node; or, periodically executing according to the resource information of the first application, the resource information of at least two working nodes and the resource information of the third application to determine the second target working node; or, when the number of working nodes already in use is greater than or equal to a preset threshold, executing according to the resource information of the first application, the resource information of at least two working nodes and the resource information of the third application to determine the second target working node.
[0174] It can be understood that the above method helps to integrate the configured resources after determining the working node for the first application, thereby improving the overall resource utilization.
[0175] like Figure 8 As shown, another container scheduling method according to the embodiment of the present application can be applied to Figure 1 The control node in the container scheduling system shown includes steps S801-S807.
[0176] S801-S802 are the same as the above steps S701-S702.
[0177] S803. Determine whether the number of used working nodes is greater than or equal to a third threshold. If so, execute steps S804-S807; if not, execute steps S806-S807.
[0178] S804: Obtain resource information of the fourth application.
[0179] The fourth application runs on one or more working nodes among the at least two working nodes.
[0180] It should be noted that the number of the fourth application can be one or more and is not limited.
[0181] S805: Determine a third target working node according to the resource information of the fourth application and the resource information of at least two working nodes.
[0182] It can be understood that the third target working node is used to host the container running the fourth application.
[0183] S806: Determine a third working node.
[0184] The third working node meets the resources required by the first application during operation, and the at least two working nodes include the third working node.
[0185] It is understood that when step S806 is executed after step S805, the control node determines the third work node for the first application based on the resource information of the third target work node and the remaining resource information in the system. If step S806 is executed after determining that the number of used work nodes is less than the third threshold, the control node determines the third work node based on the fact that the resources occupied by the fourth application have not been integrated.
[0186] S807. Schedule the first application to a container in the third working node.
[0187] It is understandable that Figure 8 The described method integrates currently used resources when the first application is not configured with a working node, and then configures the remaining resources after integration with the first application, which helps to provide as many optional operating environments as possible when deploying the first application.
[0188] The above mainly introduces the solution of the embodiment of the present application from the perspective of the method. It is understandable that, in order to realize the above functions, the control node includes at least one of the hardware structure and software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0189] The embodiment of the present application can divide the control node into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical functional division. In actual implementation, there may be other division methods.
[0190] In the case of dividing each functional module into corresponding functional modules, Figure 9 FIG. 1 is a schematic diagram showing a possible structure of the control node involved in the above embodiment. Figure 9As shown, the control node 90 includes an acquisition unit 901, a processing unit 902, and a scheduling unit 903. The acquisition unit 901 is used to acquire resource information of at least two working nodes and resource information of at least one application, and the resources of the at least two working nodes include at least one of the number of CPU cores, memory capacity, or hard disk capacity; wherein the resource information of at least one application is used to describe the resources of the working node required by at least one application during operation. The processing unit 902 is used to determine the target working node based on the resource information of at least one application and the resource information of at least two working nodes, wherein the target working node is the minimum number of working nodes required to run at least one application, or the target working node is the working node with the shortest non-uniform memory access (NUMA) path required to run at least one application. The scheduling unit 903 is used to schedule at least one application to a container on the target working node when the working node on which at least one application runs is different from the target working node.
[0191] In one example, the scheduling unit 903 is further configured to schedule the at least one application to a container on a target working node when the at least one application is not running on at least one working node of the at least two working nodes.
[0192] In one example, the scheduling unit 903 is specifically used to determine an idle working node, which is a working node that is not running at least one application; create a copy of at least one application on the idle working node; schedule at least one application to a container of a target working node; and delete the copy on the idle working node.
[0193] In one example, the processing unit 902 is further used to determine a first change in the number of target work nodes and the number of work nodes running at least one application; when the first change is less than or equal to a first threshold, scheduling at least one application to the container of the target work node is not executed; or, determine a second change in the NUMA path of the target work node and the NUMA path of the work node running at least one application; when the second change is less than or equal to a second threshold, scheduling at least one application to the container of the target work node is not executed.
[0194] In an example, the control node 90 further includes a storage unit 904. The storage unit 904 is used to store computer-executable instructions, and other units in the control node can perform corresponding actions according to the computer-executable instructions stored in the storage unit 904.
[0195] For the detailed description of the above optional manners, please refer to the above method embodiments, which will not be repeated here. In addition, the explanation of any of the control nodes 90 provided above and the description of the beneficial effects can refer to the above corresponding method embodiments, which will not be repeated here.
[0196] The present application also provides a control node. Figure 3 The hardware structure diagram of the communication device shown in the figure shows that the control node includes: a processor and a communication interface, the communication interface is used to obtain resource information of at least two working nodes and resource information of at least one application, the resources of the at least two working nodes include at least one of the number of CPU cores, memory capacity, or hard disk capacity; wherein the resource information of the at least one application is used to describe the resources of the working node required by the at least one application during operation. The processor is used to determine the target working node based on the resource information of the at least one application and the resource information of the at least two working nodes, wherein the target working node is the minimum number of working nodes required for the operation of the at least one application, or the target working node is the working node with the shortest non-uniform memory access (NUMA) path required for the operation of the at least one application; the processor is further used to schedule the at least one application to a container on the target working node when the working node on which the at least one application is running is different from the target working node.
[0197] The control node also includes a memory. The memory may include computer program code. The processor is used to execute the computer program code stored in the memory, thereby implementing the method provided in the embodiment of the present application.
[0198] During implementation, each step of the method provided in this embodiment can be completed by hardware integrated logic circuits in the processor of the control node or by software instructions. The steps of the method disclosed in the embodiments of this application can be directly implemented as execution by a hardware processor, or as a combination of hardware and software modules in the processor.
[0199] In the case of dividing each functional module into corresponding functional modules, Figure 9 The structural diagram of the control node shown in FIG. 1 can also implement another embodiment. Figure 9As shown, control node 90 includes an acquisition unit 901, a processing unit 902, and a scheduling unit 903. Acquisition unit 901 is configured to acquire resource information for a first application. The resource information for the first application describes the resources of the worker nodes required by the first application during operation. The resources include at least one of the number of CPU cores, memory capacity, or hard disk capacity. Acquisition unit 901 is also configured to acquire resource information for at least two worker nodes, one or more of which run a second application. Processing unit 902 is configured to determine a first worker node, which meets the resources required for the first application to run; the at least two worker nodes include the first worker node. Scheduling unit 903 is configured to schedule the first application to a container on the first worker node. Acquisition unit 901 is also configured to acquire resource information for the second application. Processing unit 902 is also configured to determine a target worker node based on the resource information for the first application, the resource information for the at least two worker nodes, and the resource information for the second application. The target worker node is the minimum worker node required to run the first and second applications, or the target worker node is the worker node with the shortest non-uniform memory access (NUMA) path required for the first and second applications to run. The scheduling unit 903 is further configured to schedule the first application to a container on the target working node when the first working node is different from the target working node.
[0200] In one example, the processing unit 902 is specifically used to determine the target working node based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the second application according to user instructions; or, periodically determine the target working node based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the second application; or, when the number of working nodes already in use is greater than or equal to a preset threshold, determine the target working node based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the second application.
[0201] In an example, the control node 90 further includes a storage unit 904. The storage unit 904 is used to store computer-executable instructions, and other units in the control node can perform corresponding actions according to the computer-executable instructions stored in the storage unit 904.
[0202] For the detailed description of the above optional manners, please refer to the above corresponding method embodiments, which will not be repeated here. In addition, the explanation of any of the control nodes 90 provided above and the description of the beneficial effects can refer to the above corresponding method embodiments, which will not be repeated here.
[0203] The present application also provides a control node. Figure 3The hardware structure diagram of the communication device shown in the figure shows a control node comprising: a processor and a communication interface. The communication interface is configured to obtain resource information of a first application, which describes the resources of a worker node required by the first application during operation. The resources include at least one of the number of CPU cores, memory capacity, or hard disk capacity. The communication interface is configured to obtain resource information of at least two worker nodes, one or more of which are running a second application. The processor is configured to determine a first worker node, which meets the resources required for the first application to run. The at least two worker nodes include the first worker node. The first application is scheduled to a container on the first worker node. The communication interface is further configured to obtain resource information of the second application. The processor is further configured to determine a target worker node based on the resource information of the first application, the resource information of the at least two worker nodes, and the resource information of the second application. The target worker node is the minimum number of worker nodes required to run the first and second applications, or the worker node with the shortest non-uniform memory access (NUMA) path required to run the first and second applications. If the first worker node and the target worker node are different, the first application is scheduled to a container on the target worker node.
[0204] The control node also includes a memory. The memory may include computer program code. The processor is used to execute the computer program code stored in the memory, thereby implementing the method provided in the embodiment of the present application.
[0205] During implementation, each step of the method provided in this embodiment can be completed by hardware integrated logic circuits in the processor of the control node or by software instructions. The steps of the method disclosed in the embodiments of this application can be directly implemented as execution by a hardware processor, or as a combination of hardware and software modules in the processor.
[0206] In the case of dividing each functional module into corresponding functional modules, Figure 9 The structural diagram of the control node shown in FIG. 1 can also implement another embodiment. Figure 9As shown, the control node 90 includes an acquisition unit 901, a processing unit 902 and a scheduling unit 903. The acquisition unit 901 is used to acquire resource information of the first application, and the resource information of the first application is used to describe the resources of the working node required by the first application during operation, and the resources include at least one of the number of CPU cores, memory capacity or hard disk capacity. The acquisition unit 901 is also used to acquire resource information of at least two working nodes, and some working nodes of at least two working nodes run the second application. The processing unit 902 is used to determine the second working node when the number of working nodes already in use is less than a third threshold value, and the second working node meets the resources required for the operation of the first application; at least two working nodes include the second working node. The scheduling unit 903 is used to schedule the first application to the container in the second working node. Processing unit 902 is further configured to, when the number of used work nodes is greater than or equal to a third threshold, obtain resource information for the second application; and determine a first target work node based on the resource information of the first application, the resource information of at least two work nodes, and the resource information of the second application, where the first target work node is the minimum number of work nodes required to run the first and second applications, or the first target work node is the work node with the shortest non-uniform memory access (NUMA) path required to run the first and second applications. Scheduling unit 903 is further configured to schedule the first application to a container on the first target work node.
[0207] In one example, the acquisition unit 901 is also used to obtain resource information of a third application, which runs on one or more work nodes of at least two work nodes; the processing unit 902 is also used to determine the second target work node based on the resource information of the first application, the resource information of at least two work nodes, and the resource information of the third application, wherein the second target work node is the minimum work node that satisfies the running of the first application and the third application, or the second target work node is the work node with the shortest non-uniform memory access (NUMA) path that satisfies the running of the first application and the third application; the scheduling unit 903 is also used to schedule the first application to the container on the second target work node when the first work node is different from the second target work node.
[0208] In one example, the processing unit 902 is specifically used to determine the second target working node based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the third application according to user instructions; or, periodically determine the second target working node based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the third application; or, when the number of working nodes already used is greater than or equal to a preset threshold, determine the second target working node based on the resource information of the first application, the resource information of at least two working nodes, and the resource information of the third application.
[0209] In an example, the control node 90 further includes a storage unit 904. The storage unit 904 is used to store computer-executable instructions, and other units in the control node can perform corresponding actions according to the computer-executable instructions stored in the storage unit 904.
[0210] For the detailed description of the above optional manners, please refer to the above corresponding method embodiments, which will not be repeated here. In addition, the explanation of any of the control nodes 90 provided above and the description of the beneficial effects can refer to the above corresponding method embodiments, which will not be repeated here.
[0211] The present application also provides a control node. Figure 3 The hardware structure diagram of the communication device shown in the figure shows a control node including: a processor and a communication interface, the communication interface being configured to obtain resource information of a first application, the resource information of the first application being used to describe the resources of the work nodes required by the first application during operation, the resources including at least one of the number of CPU cores, memory capacity, or hard disk capacity; obtain resource information of at least two work nodes, some of which are used to run a second application; and the processor being configured to, when the number of used work nodes is less than a third threshold, determine a second work node, the second work node meeting the resources required for the first application to run; the at least two work nodes including the second work node; and schedule the first application to a container on the second work node. When the number of used work nodes is greater than or equal to the third threshold, obtain resource information of the second application; determine a first target work node based on the resource information of the first application, the resource information of the at least two work nodes, and the resource information of the second application, wherein the first target work node is the minimum work node required for the operation of the first application and the second application, or the first target work node is the work node with the shortest non-uniform memory access (NUMA) path required for the operation of the first application and the second application; and schedule the first application to a container on the first target work node.
[0212] The control node also includes a memory. The memory may include computer program code. The processor is used to execute the computer program code stored in the memory, thereby implementing the method provided in the embodiment of the present application.
[0213] During implementation, each step of the method provided in this embodiment can be completed by hardware integrated logic circuits in the processor of the control node or by software instructions. The steps of the method disclosed in the embodiments of this application can be directly implemented as execution by a hardware processor, or as a combination of hardware and software modules in the processor.
[0214] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is run on a computer, the computer is caused to execute the method executed by any one of the communication devices provided above.
[0215] For explanations of the relevant contents and descriptions of the beneficial effects of any of the computer-readable storage media provided above, reference may be made to the corresponding embodiments described above, and no further details will be given here.
[0216] The embodiment of the present application also provides a chip. The chip integrates a control circuit and one or more ports for implementing the functions of the above-mentioned control node. Optionally, the functions supported by the chip can be referred to above and will not be repeated here. Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned embodiment can be completed by instructing the relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The above-mentioned processing unit or processor can be a central processing unit, a general-purpose processor, an application specific integrated circuit (ASIC), a microprocessor (digital signal processor, DSP), a field programmable gate array (FPGA) or other programmable logic device, transistor logic device, hardware component or any combination thereof.
[0217] The present application also provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to perform any of the methods described in the above embodiments. The computer program product comprises one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available media may be magnetic media (e.g., floppy disk, hard disk, tape), optical media (e.g., DVD), or semiconductor media (e.g., SSD).
[0218] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to the above-mentioned memories, computer-readable storage media and communication chips, etc., are all non-transitory.
[0219] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more media that can be integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0220] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by reviewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0221] Although the present application has been described with reference to specific features and embodiments thereof, it is apparent that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely illustrative of the present application as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, the present application is intended to include such modifications and variations as fall within the scope of the claims of the present application and their equivalents.
Claims
1. A container scheduling method, characterized in that: The method comprises: Obtaining resource information of at least two working nodes and resource information of at least one application, where the resources of the at least two working nodes include at least one of the number of CPU cores, memory capacity, or hard disk capacity; wherein the resource information of the at least one application is used to describe the resources of the working nodes required by the at least one application during execution; Determining a target work node based on the resource information of the at least one application and the resource information of the at least two work nodes, wherein the target work node is a minimum number of work nodes required for running the at least one application, or the target work node is a work node with the shortest non-uniform memory access (NUMA) path required for running the at least one application; When the working node on which the at least one application runs is different from the target working node, the at least one application is scheduled to a container on the target working node.
2. The method according to claim 1, characterized in that The method further comprises: When the at least one application is not running on at least one of the at least two working nodes, the at least one application is scheduled to a container on the target working node.
3. The method according to claim 1, characterized in that Scheduling the at least one application to the container of the target working node specifically includes: Determining an idle working node, where the idle working node is a working node that is not running the at least one application; Creating a copy of the at least one application on the idle working node; Scheduling the at least one application to a container of the target working node; Delete the replica on the idle worker node.
4. The method according to any one of claims 1 to 3, characterized in that After determining the target working node according to the resource information of the at least one application and the resource information of the at least two working nodes, the method further includes: Determine a first change between the target working node and the number of working nodes running the at least one application; When the first change amount is less than or equal to a first threshold, scheduling the at least one application to the container of the target working node is not performed; or, Determine a second change amount between a NUMA path of the target working node and a NUMA path of a working node running the at least one application; When the second change amount is less than or equal to a second threshold, scheduling the at least one application to the container of the target working node is not performed.
5. A container scheduling method, characterized in that: The method comprises: Obtaining resource information of the first application, where the resource information of the first application is used to describe resources of a work node required by the first application when running, the resources including at least one of the number of CPU cores, memory capacity, or hard disk capacity; Obtaining resource information of at least two working nodes, where one or more working nodes of the at least two working nodes run a second application; Determining a first working node, where the first working node meets resources required by the first application when it is running; the at least two working nodes include the first working node; Scheduling the first application to a container in the first working node; Obtaining resource information of the second application; Determining a target work node based on the resource information of the first application, the resource information of the at least two work nodes, and the resource information of the second application, wherein the target work node is the minimum work node required for running the first application and the second application, or the target work node is the work node with the shortest non-uniform memory access (NUMA) path required for running the first application and the second application; When the first working node is different from the target working node, the first application is scheduled to a container on the target working node.
6. The method according to claim 5, characterized in that The determining the target working node according to the resource information of the first application, the resource information of the at least two working nodes, and the resource information of the second application specifically includes: Executing the step of determining the target working node based on the resource information of the first application, the resource information of the at least two working nodes, and the resource information of the second application according to a user instruction; or Periodically performing the step of determining a target working node based on the resource information of the first application, the resource information of the at least two working nodes, and the resource information of the second application; or When the number of used working nodes is greater than or equal to a preset threshold, the target working node is determined according to the resource information of the first application, the resource information of the at least two working nodes, and the resource information of the second application.
7. A container scheduling method, characterized in that: The method comprises: Obtaining resource information of the first application, where the resource information of the first application is used to describe resources of a work node required by the first application when running, the resources including at least one of the number of CPU cores, memory capacity, or hard disk capacity; Obtain resource information of at least two working nodes, some of the at least two working nodes running a second application; When the number of used worker nodes is less than the third threshold: Determining a second working node, where the second working node meets the resources required for the first application to run; the at least two working nodes include the second working node; and scheduling the first application to a container in the second working node; When the number of used working nodes is greater than or equal to the third threshold: Obtain resource information of the second application; determine a first target work node based on the resource information of the first application, the resource information of the at least two work nodes, and the resource information of the second application, wherein the first target work node is the minimum work node required to run the first application and the second application, or the first target work node is the work node with the shortest non-uniform memory access (NUMA) path required to run the first application and the second application; and schedule the first application to a container on the first target work node.
8. The method according to claim 7, characterized in that After scheduling the first application to the container in the second working node, the method further includes: Obtaining resource information of a third application, where the third application runs on one or more working nodes of the at least two working nodes; determining a second target work node based on the resource information of the first application, the resource information of the at least two work nodes, and the resource information of the third application, wherein the second target work node is the minimum work node required for running the first application and the third application, or the second target work node is the work node with the shortest non-uniform memory access (NUMA) path required for running the first application and the third application; When the second working node is different from the second target working node, the first application is scheduled to a container on the second target working node.
9. The method according to claim 8, characterized in that The determining the second target working node according to the resource information of the first application, the resource information of the at least two working nodes, and the resource information of the third application specifically includes: Executing the step of determining the second target working node based on the resource information of the first application, the resource information of the at least two working nodes, and the resource information of the third application according to a user instruction; or periodically performing the step of determining the second target working node based on the resource information of the first application, the resource information of the at least two working nodes, and the resource information of the third application; or When the number of used working nodes is greater than or equal to a preset threshold, the second target working node is determined based on the resource information of the first application, the resource information of the at least two working nodes, and the resource information of the third application.
10. A control node, characterized in that: include: A scheduler, a controller, and a transceiver, wherein the scheduler and the controller are respectively connected to the transceiver; The scheduler is used to perform the following steps: Obtaining resource information of at least two working nodes and resource information of at least one application, where the resources of the at least two working nodes include at least one of the number of CPU cores, memory capacity, or hard disk capacity; wherein the resource information of the at least one application is used to describe the resources of the working nodes required by the at least one application during execution; Determining a target work node based on the resource information of the at least one application and the resource information of the at least two work nodes, wherein the target work node is a minimum number of work nodes required for running the at least one application, or the target work node is a work node with the shortest non-uniform memory access (NUMA) path required for running the at least one application; When the working node on which the at least one application is running is different from the target working node, determining to schedule the at least one application to a container on the target working node; The controller is configured to determine a target instruction for scheduling the at least one application to a container on the target working node; The transceiver is used to send the target instruction to the target working node.
11. The control node according to claim 10, characterized in that: The scheduler is further configured to determine, when the at least one application is not running on at least one of the at least two working nodes, to schedule the at least one application to a container on the target working node.
12. The control node according to claim 10, characterized in that: The scheduler is specifically configured to determine an idle working node, where the idle working node is a working node that is not running the at least one application; The controller is specifically configured to create a copy of the at least one application on the idle working node; Scheduling the at least one application to a container of the target working node; The controller is further configured to delete the replica on the idle working node.
13. The control node according to any one of claims 10 to 12, characterized in that: The scheduler is further configured to: Determine a first change between the target working node and the number of working nodes running the at least one application; When the first change amount is less than or equal to a second threshold, scheduling the at least one application to the container of the target working node is not performed; or, Determine a second change amount between a NUMA path of the target working node and a NUMA path of a working node running the at least one application; When the second change amount is less than or equal to a second threshold, scheduling the at least one application to the container of the target working node is not performed.
14. A control node, characterized in that: include: A scheduler, a controller, and a transceiver, wherein the scheduler and the controller are respectively connected to the transceiver; The scheduler is used to perform the following steps: Obtaining resource information of the first application, where the resource information of the first application is used to describe resources of a work node required by the first application when running, the resources including at least one of the number of CPU cores, memory capacity, or hard disk capacity; Obtaining resource information of at least two working nodes, where one or more working nodes of the at least two working nodes run a second application; Determining a first working node, where the first working node meets the resources required by the first application when it is running; The at least two working nodes include the first working node; The controller is configured to determine a first instruction for scheduling the first application to a container in the first working node; The transceiver is configured to send the first instruction; The scheduler is further configured to perform the following steps: Obtaining resource information of the second application; Determining a target work node based on the resource information of the first application, the resource information of the at least two work nodes, and the resource information of the second application, wherein the target work node is the minimum work node required for running the first application and the second application, or the target work node is the work node with the shortest non-uniform memory access (NUMA) path required for running the first application and the second application; When the first working node is different from the target working node, determining to schedule the first application to a container on the target working node; The controller is further configured to determine a target instruction for scheduling the first application to a container on the target working node; The transceiver is further configured to send the target instruction.
15. The control node according to claim 14, characterized in that: The scheduler is specifically used to: Executing the step of determining the target working node based on the resource information of the first application, the resource information of the at least two working nodes, and the resource information of the second application according to a user instruction; or Periodically performing the step of determining a target working node based on the resource information of the first application, the resource information of the at least two working nodes, and the resource information of the second application; or, When the number of used working nodes is greater than or equal to a fourth threshold, the step of determining the target working node according to the resource information of the first application, the resource information of the at least two working nodes, and the resource information of the second application is performed.
16. A container scheduling system, characterized in that: include: One control node and at least two worker nodes; The control node is configured to perform the following steps: Obtaining resource information of the at least two working nodes and resource information of at least one application, where the resources of the at least two working nodes include at least one of the number of CPU cores, memory capacity, or hard disk capacity; wherein the resource information of the at least one application is used to describe the resources of the working nodes required by the at least one application during execution; Determining a target work node based on the resource information of the at least one application and the resource information of the at least two work nodes, wherein the target work node is a minimum number of work nodes required for running the at least one application, or the target work node is a work node with the shortest non-uniform memory access (NUMA) path required for running the at least one application; When the working node on which the at least one application is running is different from the target working node, sending a target instruction to the target working node to schedule the at least one application to a container on the target working node; The target working node is used to receive the target instruction and perform scheduling according to the target instruction.
17. A container scheduling system, characterized in that: include: One control node and at least two worker nodes; The control node is configured to perform the following steps: Obtaining resource information of the first application, where the resource information of the first application is used to describe resources of a work node required by the first application when running, the resources including at least one of the number of CPU cores, memory capacity, or hard disk capacity; Obtaining resource information of at least two working nodes, where one or more working nodes of the at least two working nodes run a second application; Determining a first working node, where the first working node meets the resources required by the first application when it is running; The at least two working nodes include the first working node; Sending a first instruction to the first working node to schedule the first application to a container in the first working node; The first working node is configured to receive the first instruction and perform scheduling according to the first instruction; The control node is further configured to: Obtaining resource information of the second application; Determining a target work node based on the resource information of the first application, the resource information of the at least two work nodes, and the resource information of the second application, wherein the target work node is the minimum work node required for running the first application and the second application, or the target work node is the work node with the shortest non-uniform memory access (NUMA) path required for running the first application and the second application; When the first working node is different from the target working node, sending a target instruction to the target working node to schedule the first application to a container on the target working node; The target working node is used to receive the target instruction and perform scheduling according to the target instruction.
18. A communication device, characterized in that: The method comprises a memory and a processor; the memory is used to store program code; the processor is used to call the program code to execute the method according to any one of claims 1-4, claims 5-6 or claims 7-9.
Citation Information
Patent Citations
Container resource allocation method and device, computer equipment and storage medium
CN110597623A
Task scheduling method and device
CN114327881A