Container cluster node preselection method and device

By analyzing application resource requirements and container cluster platform resources, constructing preference parameters, and calculating a reasonable number of node preselections, the problem of unreasonable setting of the number of container cluster node preselections is solved, and application response efficiency and resource utilization are improved.

CN114968541BActive Publication Date: 2024-10-01CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110200802.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-23
Publication Date
2024-10-01
Estimated Expiration
2041-02-23

AI Technical Summary

Technical Problem

During the container cluster node pre-selection process, the user sets an unreasonable number of candidate nodes, which affects system resource scheduling efficiency and application response efficiency.

Method used

By analyzing the resource information in the application request, the application's preference parameters for resources are constructed, and combined with the resource usage of the container cluster platform, a reasonable number of node preselections are calculated. The resource analysis unit, parameter construction unit, resource acquisition unit and The node calculation unit performs weighted calculation to determine the preselected number of nodes.

Benefits of technology

It improves application response efficiency and system resource utilization, avoids irrationality caused by artificial experience settings, and ensures the rationality of the preselected number of nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114968541B_ABST
    Figure CN114968541B_ABST
Patent Text Reader

Abstract

The present disclosure discloses a container cluster node preselection method and device, which relates to the field of cloud computing. The method includes: analyzing the resources in the application request; constructing the application's preference parameters for resources based on the resource information in the application request; obtaining the resource usage of the container cluster platform; and calculating the preselected number of container cluster nodes based on the resource usage of the container cluster platform, the resource information in the application request, and the application's preference parameters for resources. The present disclosure ignores the irrationality of setting the preselected number of nodes based on human experience, and comprehensively considers the resource request information required by the application and the real-time resource usage of the container cluster platform, so that the preselected number of nodes is set more reasonably, improves the response efficiency of the application, and improves the resource utilization of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of cloud computing, and in particular to a method and device for preselecting nodes in a container cluster. Background Art

[0002] With the rapid development of technologies such as big data and cloud computing and the ever-changing needs of enterprise applications, enterprise applications need to meet the needs of rapid development, rapid deployment, and rapid delivery. Container cluster platforms, such as the open source container orchestration system based on Kubernetes, were born. Kubernetes is a resource orchestration and scheduling system based on container technology. Pod (container instance) is the smallest unit in system resource scheduling. It is crucial to accurately schedule pods to the corresponding nodes through Kubernetes.

[0003] At present, the scheduling of resources by the scheduler is divided into two processes, namely the node pre-selection process and the node optimization process. The pre-selection process is to select a series of node candidates that meet the application resource request; the optimization process is to select the node with the highest score from the pre-selected nodes to run. However, in the pre-selection process, the user usually sets the number of candidate nodes that meet the requirements in the pre-selection stage based on his own experience. However, when the number of candidate nodes is set unreasonably, it seriously affects the resource scheduling efficiency of the system and improves the response efficiency of the application. Summary of the invention

[0004] A technical problem to be solved by the present disclosure is to provide a container cluster node pre-selection method and device, which can make the pre-selected number of nodes set more reasonable and improve the response efficiency of the application.

[0005] According to one aspect of the present disclosure, a container cluster node preselection method is proposed, including: analyzing resources in an application request; constructing an application preference parameter for resources based on resource information in the application request; obtaining resource usage of a container cluster platform; and calculating the preselected number of container cluster nodes based on the resource usage of the container cluster platform, the resource information in the application request, and the application preference parameter for resources.

[0006] In some embodiments, constructing the application's resource preference parameters based on the resource information in the application request includes: constructing the application's memory preference parameters and CPU preference parameters based on the application's memory requirement information and the application's central processing unit CPU requirement information.

[0007] In some embodiments, constructing an application's preference parameter for resources includes: obtaining an application's preference parameter for memory based on a ratio of the application's demand for memory to the sum of the application's demand for CPU and the application's demand for memory; and obtaining an application's preference parameter for CPU based on a ratio of the application's demand for CPU to the sum of the application's demand for CPU and the application's demand for memory.

[0008] In some embodiments, obtaining resource usage of the container cluster platform includes obtaining total memory information, total CPU information, used memory information, and used CPU information of the container cluster platform.

[0009] In some embodiments, calculating the preselected number of container cluster nodes includes: determining the available memory information of the container cluster platform based on the total memory information and used memory information of the container cluster platform; determining the available CPU information of the container cluster platform based on the total CPU information and used CPU information of the container cluster platform; determining the number of nodes in the container cluster platform that meet the memory requirements of the application based on the available memory information of the container cluster platform and the memory demand information of the application; determining the number of nodes in the container cluster platform that meet the CPU requirements of the application based on the available CPU information of the container cluster platform and the CPU demand information of the application; and performing weighted calculation on the number of nodes in the container cluster platform that meet the memory requirements of the application and the number of nodes that meet the CPU requirements of the application using the application's memory preference parameters and CPU preference parameters to obtain the preselected number of container cluster nodes.

[0010] According to another aspect of the present disclosure, a container cluster node preselection device is also proposed, including: a resource analysis unit, configured to analyze the resources in the application request; a parameter construction unit, configured to construct an application preference parameter for the resource according to the resource information in the application request; a resource acquisition unit, configured to obtain the resource usage of the container cluster platform; and a node calculation unit, configured to calculate the preselected number of container cluster nodes according to the resource usage of the container cluster platform, the resource information in the application request, and the application preference parameter for the resource.

[0011] In some embodiments, the parameter construction unit is configured to construct a memory preference parameter and a CPU preference parameter of the application according to the application's memory requirement information and the application's central processing unit CPU requirement information.

[0012] In some embodiments, the parameter construction unit is configured to obtain a parameter of the application's preference for memory based on the ratio of the application's demand for memory to the sum of the application's demand for CPU and the application's demand for memory; and to obtain a parameter of the application's preference for CPU based on the ratio of the application's demand for CPU to the sum of the application's demand for CPU and the application's demand for memory.

[0013] In some embodiments, the resource acquisition unit is configured to acquire total memory information, total CPU information, used memory information, and used CPU information of the container cluster platform.

[0014] In some embodiments, the node computing unit is configured to determine the available memory information of the container cluster platform based on the total memory information and used memory information of the container cluster platform; determine the available CPU information of the container cluster platform based on the total CPU information and used CPU information of the container cluster platform; determine the number of nodes in the container cluster platform that meet the memory requirements of the application based on the available memory information of the container cluster platform and the memory demand information of the application; determine the number of nodes in the container cluster platform that meet the CPU requirements of the application based on the available CPU information of the container cluster platform and the CPU demand information of the application; and perform weighted calculation on the number of nodes in the container cluster platform that meet the memory requirements of the application and the number of nodes that meet the CPU requirements of the application using the application's memory preference parameters and CPU preference parameters to obtain a pre-selected number of container cluster nodes.

[0015] According to another aspect of the present disclosure, a container cluster node preselection device is also proposed, including: a memory; and a processor coupled to the memory, the processor being configured to execute the container cluster node preselection method as described above based on instructions stored in the memory.

[0016] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium is further provided, on which computer program instructions are stored, and when the instructions are executed by a processor, the container cluster node preselection method as described above is implemented.

[0017] In the disclosed embodiment, the resources in the application request are analyzed to generate a personalized factor, and then the real-time resource data of the container cluster platform is obtained to calculate the pre-selected number of personalized container cluster nodes that meet the application needs. Since the resource request information required by the application and the real-time resource usage of the container cluster platform are comprehensively considered, the pre-selected number of nodes is set more reasonably, which can improve the response efficiency of the application and improve the resource utilization of the system.

[0018] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0020] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:

[0021] Figure 1 The present invention is a flowchart of some embodiments of the container cluster node preselection method disclosed herein.

[0022] Figure 2 Schematic diagram of the flow chart of other embodiments of the container cluster node preselection method disclosed in the present invention.

[0023] Figure 3 The diagram is a schematic diagram of the structure of some embodiments of the container cluster node preselection device disclosed in the present invention.

[0024] Figure 4 Schematic diagrams of structures of other embodiments of the container cluster node preselection device disclosed in the present invention. DETAILED DESCRIPTION

[0025] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.

[0026] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0027] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0028] Technologies, methods, and apparatus known to ordinary technicians in the relevant field may not be discussed in detail, but where appropriate, such technologies, methods, and apparatus should be considered part of the authorization specification.

[0029] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0030] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0031] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0032] Figure 1 The present invention is a flowchart of some embodiments of the container cluster node preselection method disclosed herein.

[0033] In step 110, the resources in the application request are analyzed.

[0034] In some embodiments, the application's memory requirement information and the application's CPU requirement information are obtained. The unit of the memory information is, for example, G, and the unit of the CPU (Central Processing Unit) information is, for example, the number of cores.

[0035] In step 120, a parameter of the preference of the application for the resource is constructed according to the resource information in the application request.

[0036] In some embodiments, the application's preference parameters for memory and CPU are determined based on the application's requirement information for memory and the application's requirement information for CPU. The application's preference parameters for memory and CPU are personalized factors.

[0037] In step 130, resource usage of the container cluster platform is obtained.

[0038] In some embodiments, total memory information, total CPU information, used memory information, and used CPU information of the container cluster platform are obtained.

[0039] In step 140, the pre-selected number of container cluster nodes is calculated according to the resource usage of the container cluster platform, the resource information in the application request, and the application's preference parameter for resources.

[0040] In this embodiment, by analyzing the resources in the application request, a personalized factor is generated, and then by obtaining the real-time resource data of the container cluster platform, the pre-selected number of personalized container cluster nodes that meet the application needs is calculated, that is, the corresponding resources are matched to the application, which can improve the response efficiency of the application and improve the resource utilization of the system.

[0041] Figure 2 Schematic diagram of the flow chart of other embodiments of the container cluster node preselection method disclosed in the present invention.

[0042] In step 210, the resources in the application request are analyzed to obtain the application's memory requirement information and the application's CPU requirement information.

[0043] For example, the application's memory demand information is recorded as App_memory_need, and the application's CPU demand information is recorded as App_cpu_need.

[0044] In some embodiments, for a kubernetes system, the memory and CPU requirements of the Pod may be obtained.

[0045] In step 220, based on the application's memory requirement information and the application's CPU requirement information, a memory preference parameter and a CPU preference parameter of the application are constructed.

[0046] In some embodiments, the memory preference parameter of the application is obtained based on the ratio of the application's demand for memory to the sum of the application's demand for CPU and the application's demand for memory.

[0047] For example, the parameter α of the application's preference for memory is calculated using the formula α=App_memory_need / (APP_cpu_need+App_memory_need).

[0048] In some embodiments, the application's preference parameter for the CPU is obtained based on the ratio of the application's demand for the CPU to the sum of the application's demand for the CPU and the application's demand for the memory.

[0049] For example, the preference parameter β of the application to the CPU is calculated using the formula β=App_cpu_need / (APP_cpu_need+App_memory_need).

[0050] In this step, the memory and CPU requirements of the application are normalized so that the memory requirement and the CPU requirement are balanced.

[0051] In some embodiments, for the Kubernetes system, the Pod's preference parameters for memory and CPU are calculated separately.

[0052] In step 230, total memory information, total CPU information, used memory information, and used CPU information of the container cluster platform are obtained in real time.

[0053] In some embodiments, for the kubernetes system, the total memory information is recorded as kube_all_memory, the total CPU information is recorded as kube_all_cpu, the used memory information is recorded as kube_used_memory, and the used CPU information is recorded as kube_used_cpu.

[0054] In step 240, available memory information of the container cluster platform is determined according to the total memory information and used memory information of the container cluster platform; and available CPU information of the container cluster platform is determined according to the total CPU information and used CPU information of the container cluster platform.

[0055] In step 250, the number of nodes in the container cluster platform that meet the memory requirements of the application is determined based on the available memory information of the container cluster platform and the memory requirement information of the application; the number of nodes in the container cluster platform that meet the CPU requirements of the application is determined based on the available CPU information of the container cluster platform and the CPU requirement information of the application.

[0056] In step 260, the number of nodes that meet the application memory requirement and the number of nodes that meet the application CPU requirement in the container cluster platform are weightedly calculated using the application's memory preference parameter and CPU preference parameter to obtain a preselected number of container cluster nodes.

[0057] In some embodiments, using the formula The pre-selected number PONTS of container cluster nodes is calculated.

[0058] In the above embodiment, when calculating the pre-selected number of container cluster nodes, the irrationality of setting the pre-selected number of nodes based on human experience is ignored, and the resource request information required by the application and the real-time resource usage of the container cluster platform are comprehensively considered, so that the pre-selected number of nodes is set more reasonably, the response efficiency of the application is improved, and the resource utilization of the system is improved.

[0059] Figure 3 The schematic diagram is a structural diagram of some embodiments of the container cluster node preselection device disclosed in the present invention. The device includes a resource analysis unit 310, a parameter construction unit 320, a resource acquisition unit 330 and a node calculation unit 340.

[0060] The resource analysis unit 310 is configured to analyze resources in the application request.

[0061] In some embodiments, the resources in the application request are analyzed to obtain the application's memory requirement information and the application's CPU requirement information.

[0062] The parameter construction unit 320 is configured to construct a parameter of the preference degree of the application for the resource according to the resource information in the application request.

[0063] In some embodiments, the memory preference parameter and the CPU preference parameter of the application are determined based on the memory requirement information and the CPU requirement information of the application.

[0064] The resource acquisition unit 330 is configured to acquire resource usage of the container cluster platform.

[0065] In some embodiments, total memory information, total CPU information, used memory information, and used CPU information of the container cluster platform are obtained.

[0066] The node calculation unit 340 is configured to calculate the pre-selected number of container cluster nodes according to the resource usage of the container cluster platform, the resource information in the application request, and the application's preference parameter for resources.

[0067] In some embodiments, the available memory information of the container cluster platform is determined based on the total memory information and used memory information of the container cluster platform; the available CPU information of the container cluster platform is determined based on the total CPU information and used CPU information of the container cluster platform; the number of nodes in the container cluster platform that meet the memory requirements of the application is determined based on the available memory information of the container cluster platform and the memory demand information of the application; the number of nodes in the container cluster platform that meet the CPU requirements of the application is determined based on the available CPU information of the container cluster platform and the CPU demand information of the application; and the number of nodes in the container cluster platform that meet the memory requirements of the application and the number of nodes that meet the CPU requirements of the application are weightedly calculated using the application's memory preference parameters and CPU preference parameters to obtain a pre-selected number of container cluster nodes.

[0068] In the above embodiment, the resources in the application request are analyzed to generate a personalized factor, and then the real-time resource data of the container cluster platform is obtained to calculate the pre-selected number of personalized container cluster nodes that meet the application needs. Since the resource request information required by the application and the real-time resource usage of the container cluster platform are comprehensively considered, the pre-selected number of nodes is set more reasonably, which can improve the response efficiency of the application and improve the resource utilization of the system.

[0069] Figure 4 Schematic diagram of the structure of some other embodiments of the container cluster node preselection device disclosed in the present invention. The device includes a memory 410 and a processor 420. The memory 410 can be a disk, a flash memory or any other non-volatile storage medium. The memory 410 is used to store Figure 1 , 2 The processor 420 is coupled to the memory 410 and can be implemented as one or more integrated circuits, such as a microprocessor or a microcontroller. The processor 420 is used to execute the instructions stored in the memory.

[0070] In some embodiments, the processor 420 is coupled to the memory 410 via a BUS 430. The device 400 can also be connected to an external storage system 450 via a storage interface 440 to call external data, and can also be connected to a network or another computer system (not shown) via a network interface 460. No further detailed description will be given here.

[0071] In this embodiment, the memory stores data instructions, and the processor processes the instructions, so that the pre-selected number of nodes is set more reasonably, which can improve the response efficiency of the application and improve the resource utilization of the system.

[0072] In some other embodiments, a computer readable storage medium stores computer program instructions, which when executed by a processor implement Figure 1 , 2 The steps of the method in the corresponding embodiment. Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, devices, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0073] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0074] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0075] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0076] So far, the present disclosure has been described in detail. In order to avoid obscuring the concept of the present disclosure, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solution disclosed here.

[0077] Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. It should be understood by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.

Claims

1. A container cluster node preselection method, comprising: Analyze the resources in the application request to obtain the application's memory demand information and the application's CPU demand information; Obtaining a memory preference parameter of the application according to a ratio of the memory requirement of the application to the sum of the CPU requirement of the application and the memory requirement of the application; Obtaining a CPU preference parameter of the application according to a ratio of the application's demand for the CPU to the sum of the application's demand for the CPU and the application's demand for the memory; Obtain resource usage of the container cluster platform to determine the number of nodes in the container cluster platform that meet the application memory requirements and the number of nodes in the container cluster platform that meet the application CPU requirements; as well as The number of nodes that meet the application memory requirement and the number of nodes that meet the application CPU requirement in the container cluster platform are weightedly calculated by using the application's memory preference parameter and CPU preference parameter to calculate the pre-selected number of container cluster nodes.

2. The container cluster node preselection method according to claim 1, wherein: Obtaining resource usage of the container cluster platform includes: Obtain total memory information, total CPU information, used memory information, and used CPU information of the container cluster platform.

3. The container cluster node preselection method according to claim 2, wherein: Determining the number of nodes in the container cluster platform that meet the application memory requirement and the number of nodes in the container cluster platform that meet the application CPU requirement includes: Determine available memory information of the container cluster platform according to the total memory information and the used memory information of the container cluster platform; Determine available CPU information of the container cluster platform according to total CPU information and used CPU information of the container cluster platform; Determine the number of nodes in the container cluster platform that meet the memory requirement of the application according to the available memory information of the container cluster platform and the memory requirement information of the application; The number of nodes in the container cluster platform that meet the CPU requirement of the application is determined according to the available CPU information of the container cluster platform and the CPU requirement information of the application.

4. A container cluster node preselection device, comprising: A resource analysis unit is configured to analyze the resources in the application request, and obtain the application's demand information for memory and the application's demand information for a central processing unit (CPU); A parameter construction unit, configured to construct a parameter of the preference of the application for the resource according to the resource information in the application request; A resource acquisition unit is configured to acquire resource usage of the container cluster platform, and is used to determine the number of nodes in the container cluster platform that meet the application memory requirement and the number of nodes in the container cluster platform that meet the application CPU requirement; as well as The node calculation unit is configured to use the memory preference parameter and the CPU preference parameter of the application to perform weighted calculation on the number of nodes that meet the application memory requirement and the number of nodes that meet the application CPU requirement in the container cluster platform, and calculate the pre-selected number of container cluster nodes.

5. The container cluster node preselection device according to claim 4, wherein: The resource acquisition unit is configured to acquire total memory information, total CPU information, used memory information, and used CPU information of the container cluster platform.

6. The container cluster node preselection device according to claim 5, wherein: The node computing unit is configured to determine the available memory information of the container cluster platform according to the total memory information and the used memory information of the container cluster platform; determine the available CPU information of the container cluster platform according to the total CPU information and the used CPU information of the container cluster platform; determine the number of nodes in the container cluster platform that meet the memory requirements of the application according to the available memory information of the container cluster platform and the memory requirement information of the application; determine the number of nodes in the container cluster platform that meet the CPU requirements of the application according to the available CPU information of the container cluster platform and the CPU requirement information of the application.

7. A container cluster node preselection device, comprising: Memory; as well as A processor coupled to the memory, wherein the processor is configured to execute the container cluster node preselection method according to any one of claims 1 to 3 based on instructions stored in the memory.

8. A non-transitory computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the container cluster node preselection method as described in any one of claims 1 to 3.