Flexible and efficient container scheduling method and system

The weighted minimum load average algorithm selects the optimal node for container scheduling, which solves the problems of low resource utilization and poor scheduling flexibility in cluster nodes, and achieves more efficient resource utilization and flexible container scheduling.

CN119149175APending Publication Date: 2024-12-17INSPUR TIANYUAN COMM INFORMATION SYST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411289509.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The resource utilization rate of cluster nodes is low and the flexibility of container scheduling is poor, especially due to the inflexibility problem caused by different node types.

Method used

The weighted minimum load average algorithm is used for container scheduling. By calculating the weighted load of the node, selecting the optimal node, scheduling container instances, and updating the node load, improving native cluster scheduling strategies to improve resource utilization and scheduling flexibility.

Benefits of technology

Improves the actual resource utilization and flexibility of cluster nodes and is suitable for all types of cluster infrastructure, including private and public clouds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149175A_ABST
    Figure CN119149175A_ABST
Patent Text Reader

Abstract

The invention discloses a flexible and efficient container scheduling method and system, and belongs to the technical field of software development, container scheduling is realized based on a weighted minimum average load algorithm: when a cluster receives a container instance creation request, an optimal node is calculated in the weighted minimum average load algorithm according to the requirement of a container real column creation request; and then the calculated scheduling node information is returned to the cluster, so that the cluster issues a container instance creation request to the calculated node. The method improves the utilization rate of actual resources of cluster nodes, optimizes different types of nodes, improves the scheduling flexibility, and is suitable for all available clusters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software development, and in particular to a flexible and efficient container scheduling method and system. Background Art

[0002] With the development of containerization technology, Kubernetes has become the de facto standard for container orchestration systems in enterprise IT services. In practical applications, the actual resource utilization of cluster nodes is not high, and due to the different types of nodes in the cluster, the flexibility of container scheduling is poor. Summary of the invention

[0003] The technical task of the present invention is to address the above shortcomings and provide a flexible and efficient container scheduling method and system, which can greatly improve the actual resource utilization of cluster nodes and improve the flexibility of container scheduling.

[0004] The technical solution adopted by the present invention to solve its technical problem is:

[0005] A flexible and efficient container scheduling method that implements container scheduling based on the weighted minimum average load algorithm:

[0006] When the cluster receives a container instance creation request, it calculates the optimal node in the weighted minimum average load algorithm based on the requirements of the container instance creation request;

[0007] The calculated scheduling node information is then returned to the cluster, allowing the cluster to send the container instance creation request to the calculated node.

[0008] This method proposes a flexible container scheduling method based on the idea of ​​weighted minimum average load algorithm to improve the utilization of actual resources of cluster nodes, optimize different types of nodes, and improve scheduling flexibility. The scope of application is all available clusters, including private clouds, public clouds and other infrastructures.

[0009] Furthermore, the optimal node is calculated in the weighted minimum average load algorithm, and is specifically implemented as follows:

[0010] Encode the weighted minimum average load algorithm logic, add calculations, and calculate the current actual load of the node;

[0011] Query node information to determine the conditions and weights related to node affinity in the request;

[0012] Query the node container to determine the number of containers and the load status of the containers on the node;

[0013] Calculate the weighted loads of all nodes and sort them, and select the node with the smallest weighted load as the optimal node.

[0014] Furthermore, the actual current load of the computing node includes the determination of the CPU, memory, disk and network io throughput.

[0015] Furthermore, the scheduling strategy of the native cluster is rewritten to be changed to the container scheduling method based on the weighted minimum average load algorithm; the container is scheduled to the node calculated by the weighted load, and the load of the node is updated.

[0016] Furthermore, we create a variety of test nodes and containers, call the weighted minimum average load algorithm, allocate containers to appropriate nodes, and output the scheduling results and node load conditions.

[0017] The present invention also claims protection for a flexible and efficient container scheduling system, comprising:

[0018] at least one cluster for receiving an output of the scheduling algorithm;

[0019] At least one available cluster node for container creation;

[0020] At least one container runtime implementation for use with containers;

[0021] When the cluster receives a container instance creation request, it calculates the optimal cluster node in the scheduling algorithm according to the requirements of the container instance creation request; returns the calculated scheduling node information to the cluster, so that the cluster sends the container instance creation request to the calculated cluster node;

[0022] Wherein, the scheduling algorithm is a weighted minimum average load algorithm.

[0023] Furthermore, the optimal cluster node is calculated in the scheduling algorithm, and is specifically implemented as follows:

[0024] Encode the weighted minimum average load algorithm logic, add calculations, and calculate the current actual load of the node;

[0025] Query node information to determine the conditions and weights related to node affinity in the request;

[0026] Query the node container to determine the number of containers and the load status of the containers on the node;

[0027] Calculate the weighted loads of all nodes and sort them, and select the node with the smallest weighted load as the optimal node.

[0028] The actual current load of the computing node includes the judgment of the CPU, memory, disk and network io throughput.

[0029] The cluster changes its scheduling strategy to the container scheduling method based on the weighted minimum average load algorithm; the container is scheduled to the cluster node calculated by the weighted load, and the load of the cluster node is updated.

[0030] The system also includes a variety of test cluster nodes and containers, calling the weighted minimum average load algorithm to allocate containers to appropriate cluster nodes and output scheduling results and node load conditions.

[0031] The present invention also claims a flexible and efficient container scheduling device, comprising: at least one memory and at least one processor;

[0032] The at least one memory is used to store a machine-readable program;

[0033] The at least one processor is used to call the machine-readable program to implement the above method.

[0034] The present invention also claims protection for a computer-readable medium having computer instructions stored thereon, which implement the above method when executed by a processor.

[0035] Compared with the prior art, the flexible and efficient container scheduling method and system of the present invention has the following advantages:

[0036] Beneficial effects:

[0037] This method proposes a flexible container scheduling method based on the idea of ​​weighted minimum average load algorithm to improve the utilization of actual resources of cluster nodes, optimize different types of nodes, and improve scheduling flexibility. The scope of application is all available clusters, including private clouds, public clouds and other infrastructures. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a schematic diagram of the principle of the container scheduling method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0039] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0040] A flexible and efficient container scheduling method that implements container scheduling based on the weighted minimum average load algorithm:

[0041] When the cluster receives a container instance creation request, it calculates the optimal node in the weighted minimum average load algorithm based on the requirements of the container instance creation request;

[0042] The calculated scheduling node information is then returned to the cluster, allowing the cluster to send the container instance creation request to the calculated node.

[0043] like Figure 1 The figure shows the phases of the weighted minimum load scheduling algorithm and how container instances are created through the scheduling algorithm. The specific implementation of this method is as follows:

[0044] 1. Encode the weighted minimum average load algorithm logic, add calculations, and calculate the current actual load of the node, including the judgment of CPU, memory, disk and network io throughput;

[0045] Query node information to determine the node affinity and other related conditions and their weights in the request;

[0046] Query the node container to determine the number of containers and the load status of the containers on the node;

[0047] Calculate the weighted loads of all nodes and sort them, and select the node with the smallest weighted load as the optimal node.

[0048] 2. Rewrite the scheduling strategy of the native cluster and change it to the container scheduling method based on the weighted minimum average load algorithm; schedule the container to the node calculated by the weighted load and update the node load.

[0049] 3. Create multiple test nodes and containers, call the weighted minimum average load algorithm, assign containers to appropriate nodes, and output the scheduling results and node load conditions.

[0050] This method proposes a flexible container scheduling method based on the idea of ​​weighted minimum average load algorithm to improve the utilization of actual resources of cluster nodes, optimize different types of nodes, and improve scheduling flexibility. The scope of application is all available clusters, including private clouds, public clouds and other infrastructures.

[0051] The embodiment of the present invention also provides a flexible and efficient container scheduling system, including:

[0052] at least one cluster for receiving an output of the scheduling algorithm;

[0053] At least one available cluster node for container creation;

[0054] At least one container runtime implementation for use with containers;

[0055] When the cluster receives a container instance creation request, it calculates the optimal cluster node in the scheduling algorithm according to the requirements of the container instance creation request; returns the calculated scheduling node information to the cluster, so that the cluster sends the container instance creation request to the calculated cluster node;

[0056] The scheduling algorithm is a weighted minimum average load algorithm. The optimal cluster node is calculated in the scheduling algorithm:

[0057] Encode the weighted minimum average load algorithm logic, add calculations, and calculate the current actual load of the node, including the judgment of CPU, memory, disk and network io throughput;

[0058] Query node information to determine the conditions and weights related to node affinity in the request;

[0059] Query the node container to determine the number of containers and the load status of the containers on the node;

[0060] Calculate the weighted loads of all nodes and sort them, and select the node with the smallest weighted load as the optimal node.

[0061] The cluster changes its scheduling strategy to the container scheduling method based on the weighted minimum average load algorithm; the container is scheduled to the cluster node calculated by the weighted load, and the load of the cluster node is updated.

[0062] The system also includes a variety of test cluster nodes and containers, calling the weighted minimum average load algorithm to allocate containers to appropriate cluster nodes and output scheduling results and node load conditions.

[0063] The embodiment of the present invention also provides a flexible and efficient container scheduling device, comprising: at least one memory and at least one processor;

[0064] The at least one memory is used to store a machine-readable program;

[0065] The at least one processor is used to call the machine-readable program to implement the flexible and efficient container scheduling method described in the above embodiment.

[0066] The embodiment of the present invention also provides a computer-readable medium, on which computer instructions are stored, and when the computer instructions are executed by the processor, the flexible and efficient container scheduling method described in the above embodiment is implemented. Specifically, a system or device equipped with a storage medium can be provided, on which software program codes that implement the functions of any of the above embodiments are stored, and the computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.

[0067] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

[0068] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.

[0069] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0070] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0071] The present invention is shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.

Claims

1. A flexible and efficient container scheduling method, characterized in that: Container scheduling based on weighted minimum average load algorithm: When the cluster receives a container instance creation request, it calculates the optimal node in the weighted minimum average load algorithm based on the requirements of the container instance creation request; The calculated scheduling node information is then returned to the cluster, allowing the cluster to send the container instance creation request to the calculated node.

2. A flexible and efficient container scheduling method according to claim 1, characterized in that: The optimal node is calculated in the weighted minimum average load algorithm, and is specifically implemented as follows: Encode the weighted minimum average load algorithm logic, add calculations, and calculate the current actual load of the node; Query node information to determine the conditions and weights related to node affinity in the request; Query the node containers to determine the number of containers and the load status of the containers on the node; Calculate the weighted loads of all nodes and sort them, and select the node with the smallest weighted load as the optimal node.

3. A flexible and efficient container scheduling method according to claim 2, characterized in that: The actual current load of the computing node includes the judgment of CPU, memory, disk and network IO throughput.

4. A flexible and efficient container scheduling method according to claim 1, characterized in that: Rewrite the scheduling strategy of the native cluster to the container scheduling method based on the weighted minimum average load algorithm; schedule the container to the node calculated by the weighted load, and update the node load.

5. A flexible and efficient container scheduling method according to claim 1, characterized in that: Create multiple test nodes and containers, call the weighted minimum average load algorithm, assign containers to appropriate nodes, and output the scheduling results and node load conditions.

6. A flexible and efficient container scheduling system, characterized in that: include: at least one cluster for receiving an output of the scheduling algorithm; At least one available cluster node for container creation; At least one container runtime implementation for use with containers; When the cluster receives a container instance creation request, it calculates the optimal cluster node in the scheduling algorithm according to the requirements of the container instance creation request; returns the calculated scheduling node information to the cluster, so that the cluster sends the container instance creation request to the calculated cluster node; Wherein, the scheduling algorithm is a weighted minimum average load algorithm.

7. A flexible and efficient container scheduling system according to claim 6, characterized in that: The optimal cluster node is calculated in the scheduling algorithm, and is specifically implemented as follows: Encode the weighted minimum average load algorithm logic, add calculations, and calculate the current actual load of the node; Query node information to determine the conditions and weights related to node affinity in the request; Query the node containers to determine the number of containers and the load status of the containers on the node; Calculate the weighted loads of all nodes and sort them, and select the node with the smallest weighted load as the optimal node.

8. A flexible and efficient container scheduling system according to claim 6, characterized in that: The cluster changes its scheduling strategy to the container scheduling method based on the weighted minimum average load algorithm; the container is scheduled to the cluster node calculated by the weighted load, and the load of the cluster node is updated.

9. A flexible and efficient container scheduling device, characterized in that: include: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is used to call the machine-readable program to implement the method described in any one of claims 1 to 5.

10. A computer-readable medium, characterized in that The computer readable medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 5 is implemented.