Load balancing distribution method, device, computer equipment and storage medium

By collecting and reporting resource usage information on the host, dynamically determining the load balancing weight of the container group, the problem of inaccurate load balancing scheduling in traditional methods is solved, and more efficient load balancing allocation is achieved.

CN111666131BActive Publication Date: 2025-02-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010631600.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-03
Publication Date
2025-02-18
Estimated Expiration
2040-07-03

AI Technical Summary

Technical Problem

Traditional load balancing scheduling methods cannot accurately sense the real load of the container group, resulting in inaccurate scheduling.

Method used

By running the first process on the host, collecting and reporting resource usage information to the load balancer, dynamically determine the load balancing weights of the container group, and making access request allocation based on these weights.

Benefits of technology

It improves the accuracy of load balancing allocation, can better perceive the real load of the host, thereby dynamically adjusting the load balancing weight of the container group and improving service responsiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111666131B_ABST
    Figure CN111666131B_ABST
Patent Text Reader

Abstract

The present application relates to a load balancing distribution method, device, computer equipment and storage medium. The method includes: for multiple container groups corresponding to the same service object, respectively obtaining the reported resource usage information of the host machine on which the container group runs; the resource usage information is collected and reported from the host machine by the first process running in the host machine; according to the resource usage information of each host machine, determining the load balancing weight of the container group running in the host machine; the resource usage information is related to the load balancing weight; according to the load balancing weight, the access request for the service object is allocated to the container group corresponding to the service object. The use of this method can improve the accuracy of load balancing scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, specifically to the field of cloud technology, and in particular to a load balancing distribution method, apparatus, computer equipment and storage medium. Background Art

[0002] With the rapid development of science and technology, cloud technology has emerged. In a cluster system such as container cloud, allocating requests to container groups in the container cloud through load balancing scheduling is an important application of cloud technology.

[0003] In the traditional method, the staff will pre-set the weight of each container group, and the load balancer will schedule the traffic according to the preset weight. This traditional method of scheduling according to the preset weight will have the problem of not knowing the actual load, resulting in inaccurate scheduling. Summary of the invention

[0004] Based on this, it is necessary to provide a load balancing distribution method, device, computer equipment and storage medium that can improve accuracy in response to the above technical problems.

[0005] A load balancing distribution method, characterized in that the method comprises:

[0006] For multiple container groups corresponding to the same service object, respectively obtain reported resource usage information of the host machine on which the container group runs; the resource usage information is collected and reported from the host machine by a first process running in the host machine;

[0007] Determine a load balancing weight of a container group running in the host machine according to the resource usage information of each host machine; the resource usage information is related to the load balancing weight;

[0008] According to the load balancing weight, the access request for the service object is allocated to the container group corresponding to the service object.

[0009] A load balancing distribution method, characterized in that the method comprises:

[0010] The host machine collects resource usage information of the host machine according to the running first process;

[0011] Reporting the resource usage information to the load balancer; the resource usage information is used to instruct the load balancer to determine the load balancing weight of the container group running on the host machine according to the resource usage information;

[0012] An access request for a service object corresponding to the container group running on the host machine and allocated by the load balancer according to the load balancing weight is received through the container group running on the host machine.

[0013] A load balancing distribution device, the device comprising:

[0014] an acquisition module, configured to respectively acquire, for a plurality of container groups corresponding to the same service object, resource usage information of a host machine on which the container groups are running, which is reported; the resource usage information is collected and reported from the host machine by a first process running in the host machine;

[0015] A weight determination module, configured to determine a load balancing weight of a container group running in each host machine according to the resource usage information of each host machine; the resource usage information is related to the load balancing weight;

[0016] The request allocation module is used to allocate the access request for the service object to the container group corresponding to the service object according to the load balancing weight.

[0017] In one embodiment, the acquisition module is further used to acquire, for multiple container groups corresponding to the same service object, resource usage information of the host machine on which each container group runs, forwarded by the controller.

[0018] In one embodiment, the weight determination module is further used to determine the load balancing weight of the container group running in the host machine according to the resource usage information of the host machine through a second process running on the load balancer; and through the second process, modify the original load balancing weight of the container group recorded in the load balancing program running on the load balancer to the determined load balancing weight.

[0019] In one embodiment, the weight determination module is further used to determine, for each of the host machines, a load balancing weight of the container group running in the host machine according to the resource usage information of the host machine and the total resource usage information corresponding to the service object; wherein the total resource usage information is the sum of resource usage information of each host machine on which each container group corresponding to the service object runs.

[0020] In one embodiment, the weight determination module is also used to determine a first proportion corresponding to the host machine according to the CPU usage information of the host machine when the resource usage information includes CPU usage information and network bandwidth usage information; the first proportion is the ratio of the CPU usage information of the host machine to the total CPU usage information corresponding to the service object; the total CPU usage information is the sum of the CPU usage information of the host machines on which the container groups corresponding to the service object run; according to the network bandwidth usage information of the host machine, determine a second proportion corresponding to the host machine; the second proportion is the ratio of the network bandwidth usage information of the host machine to the total network bandwidth usage information corresponding to the service object; the total network bandwidth usage information is the sum of the network bandwidth usage information of the host machines on which the container groups corresponding to the service object run; according to the first proportion and the second proportion, determine the load balancing weight of the container group running in the host machine.

[0021] In one embodiment, the weight determination module is further configured to, when the CPU usage information is the amount of idle CPU resources and the network bandwidth usage information is the amount of idle network bandwidth, take the minimum value of the first proportion and the second proportion to obtain the load balancing weight of the container group running in the host machine.

[0022] In one embodiment, the weight determination module is further used to divide the minimum value of the first proportion and the second proportion according to the number of container groups running in the host machine when multiple container groups are running in the host machine; and use the divided value as the load balancing weight of each container group running in the host machine.

[0023] A load balancing distribution device, the device comprising:

[0024] A collection module, used for the host machine to collect resource usage information of the host machine according to the running first process;

[0025] A reporting module, used to report the resource usage information to the load balancer; the resource usage information is used to instruct the load balancer to determine the load balancing weight of the container group running on the host machine according to the resource usage information;

[0026] The request receiving module is used to receive, through the container group running on the host machine, an access request to the service object corresponding to the container group running on the host machine and allocated by the load balancer according to the load balancing weight.

[0027] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the load balancing distribution method described in each embodiment of the present application are implemented.

[0028] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the load balancing distribution method described in each embodiment of the present application.

[0029] The above-mentioned load balancing distribution method, device, computer equipment and storage medium, for multiple container groups corresponding to the same service object, respectively obtain the reported resource usage information of the host machine on which the container group runs; the resource usage information is collected and reported from the host machine by the first process running in the host machine; according to the resource usage information of each host machine, the load balancing weight of the container group running in the host machine is determined; the resource usage information is related to the load balancing weight; according to the load balancing weight, the access request for the service object is distributed to the container group corresponding to the service object. The resource usage information of the host machine can accurately represent the actual load situation of the host machine, and then according to the resource usage information of the host machine, the load balancing weight of the container group can be more accurately and dynamically determined, so that based on the load balancing weight, load balancing distribution can be more accurately performed. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 An application environment diagram of a load balancing distribution method in an embodiment;

[0031] Figure 2 A schematic diagram of a flow chart of a load balancing distribution method in an embodiment;

[0032] Figure 3 A schematic diagram of the relationship between a service object, a container group, and a host machine in one embodiment;

[0033] Figure 4 The following is an architecture diagram of a load balancing distribution method in one embodiment;

[0034] Figure 5 A schematic diagram of a flow chart of a load balancing distribution method in another embodiment;

[0035] Figure 6 A block diagram of a load balancing distribution system in one embodiment;

[0036] Figure 7 A block diagram of a load balancing distribution system in another embodiment;

[0037] Figure 8 is a timing diagram of a load balancing distribution method in an embodiment;

[0038] Fig. 9 It is a structural block diagram of a load balancing distribution device in one embodiment;

[0039] Fig.10 It is a structural block diagram of a load balancing distribution device in another embodiment;

[0040] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0042] The load balancing distribution method provided in this application can be applied to Figure 1 In the application environment shown. Figure 1 , the application scenario includes a terminal 110, a service object (Service) 120, a load balancer (lb, LoadBalance) 130, a container group (pod) 140 and a host 150 that are connected to each other. The container group 140 runs in the host 150. At least one container group 140 can run in the same host 150. The same service object 120 corresponds to at least one container group 140. The service object 120 provides a unified fixed IP address as the entry address for the container group 140, and distributes the received access request to the corresponding container group 140 through the load balancer 130 according to the load balancing principle.

[0043] It can be understood that multiple host machines 104 form a cluster, and the host machine 104 serves as a node in the cluster. The cluster in each embodiment of the present application can be a distributed cluster or a non-distributed cluster, and the type of cluster is not limited here. Therefore, the host machine 104 can be an independent physical server or a virtual server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0044] The first process may be run in the host machine 150 to collect resource usage information of the host machine 150 from the host machine 150 and report the resource usage information to the load balancer 130. For each container group 140 corresponding to the same service object 120, the load balancer 130 may determine the load balancing weight of the container group 140 running in the host machine 150 according to the resource usage information of the host machine 150 on which these container groups 140 run; the size of the resource usage rate represented by the resource usage information is negatively correlated with the size of the load balancing weight. The terminal 110 may initiate an access request to the service object 120, and the load balancer 130 may allocate the access request for the service object 120 to the container group 140 corresponding to the service object 120 according to the load balancing weight of the container group 140 corresponding to the accessed service object 120. In this way, the access request may be load balanced and scheduled according to the resource usage of the host machine.

[0045] It can be understood that the load balancing distribution method in the embodiment of the present application is equivalent to using cloud technology to perform cloud computing processing.

[0046] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.

[0047] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.

[0048] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, allowing various application systems to obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's perspective, the resources in the "cloud" are infinitely scalable and can be obtained at any time, used on demand, expanded at any time, and paid for by use.

[0049] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.

[0050] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.

[0051] It can be understood that the container group in the embodiments of the present application is a combination of multiple containers in the container cloud. In each embodiment of the present application, load balancing is performed through cloud computing, and computing tasks are distributed on the container cloud composed of a large number of host machines, that is, the container cloud provides a resource pool, so that various application systems can obtain computing power, storage space and information services as needed.

[0052] In one embodiment, Figure 2 As shown, a load balancing distribution method is provided, which is applied to Figure 1 The load balancer 130 in FIG. 1 is used as an example to illustrate the method, which includes the following steps:

[0053] Step 202: For multiple container groups corresponding to the same service object, respectively obtain the resource usage information of the host machine on which the container group is running and reported.

[0054] A container group is a group of containers. A container is a group of processes that are resource-constrained and isolated from each other. It can be understood that a container contains a complete runtime environment.

[0055] The service object, namely Service, is an object abstracted from the upper layer of the container group. It is used to provide a fixed IP address for the container group as an access interface for providing external services.

[0056] It is understandable that once the container group is restarted, its corresponding IP address will change. Therefore, by receiving the client's access request through a service object with a fixed IP address, no matter how the IP address of the container group changes, it will not affect the client's access. That is, according to the mapping relationship between the service object and the container group, the access request received by the service object can be forwarded to the container group corresponding to the service object. Therefore, the container group is equivalent to the target server corresponding to the service object. The target server is the object that actually processes the access request.

[0057] A host machine is a computer that needs to install virtual machine software for performing calculations. It can be understood that the container group runs in the host machine, and the host machine provides computing power for the container group running on it. The host machine can be a virtual machine or a physical machine. Multiple host machines constitute a cluster. A cluster is a computer system that is connected by a set of integrated computer software and / or hardware to complete computing work in a highly collaborative manner.

[0058] It can be understood that a service object can correspond to at least one container group, and a container group runs on a host machine. A host machine can run at least one container group. Multiple container groups corresponding to the same service object can run on the same or different hosts. That is, the container groups running in the same host machine can be container groups corresponding to different service objects.

[0059] In order to understand the relationship between service objects, container groups and hosts, Figure 3 The topology diagram in the figure is used as an example. Figure 3 , service object A (i.e. ServiceA) corresponds to container group 1 and container group 2 (i.e. container group 1 and container group 2 are the target servers of service object A), service object B (i.e. ServiceB) corresponds to container group 3 (i.e. container group 3 is the target server of service object B), and container group 2 and container group 3 run on the same host machine 2. That is, the container groups running on host machine 2 are the container groups corresponding to the two different service objects, service object A and service object B. Container group 1 and container group 2 corresponding to the same service object A run on two different host machines, host machine 1 and host machine 2.

[0060] The resource usage information is used to describe the resource usage in the host machine. The resource usage information is collected and reported from the host machine by the first process running in the host machine.

[0061] The first process refers to a process capable of collecting resource usage information of the host machine from the host machine.

[0062] In one embodiment, the first process may be a native process in the host machine, that is, the native process in the host machine may be improved so that it has the function of collecting resource usage information of the host machine. For example, the first process may be an agent daemon process in the host machine, that is, an agent process. It is understood that the first process may also be a non-native process newly added in the host machine.

[0063] In one embodiment, the resource usage information may be a resource usage rate, or may be specific usage information of a resource used to characterize the resource usage rate. In one embodiment, the resource may include at least one of a CPU, a network bandwidth, a disk, and a memory. Therefore, the resource usage information may include at least one of CPU usage information, network bandwidth usage information, disk usage information, and memory usage information.

[0064] Specifically, each host machine can run the first process, and the first process can collect resource usage information of the host machine from the host machine on which it runs, and report the collected resource usage information. When the load balancer needs to determine the load balancing weights of each container group corresponding to the same service object, it can obtain the resource usage information of the host machine on which each container group of the same service object runs from the reported resource usage information of each host machine.

[0065] It can be understood that the resource usage information can be reported directly by the host machine, or reported by the host machine to a third party, which is then forwarded to the load balancer. That is, the host machine can directly report the collected resource usage information of the host machine to the load balancer through the first process, or report the resource usage information of the host machine to a third-party device, which is then forwarded to the load balancer.

[0066] Step 204: Determine the load balancing weight of the container group running in the host according to the resource usage information of each host.

[0067] Among them, resource usage information is related to the load balancing weight.

[0068] Resource usage information can characterize the size of the resource usage rate of the host machine. In one embodiment, the resource usage information can be the resource usage rate itself. In another embodiment, the resource usage information can also be information used to characterize the size of the resource usage rate, that is, information used to reflect the resource usage situation.

[0069] In one embodiment, the resource usage rate represented by the resource usage information is negatively correlated with the load balancing weight.

[0070] When the resource usage information indicates that the resource usage rate of the host machine is higher, it means that the remaining resources available on the host machine are less, and the load balancing weight of the container group running on the host machine is smaller. Conversely, when the resource usage information indicates that the resource usage rate of the host machine is lower, it means that the remaining resources available on the host machine are more, and the load balancing weight of the container group running on the host machine is greater.

[0071] It can be understood that what is determined in step 204 is the load balancing weight of the container group running in the host machine and corresponding to the service object.

[0072] Step 206: Allocate access requests for the service object to the container group corresponding to the service object according to the load balancing weight.

[0073] Specifically, the terminal can send an access request to the service object, and the load balancer can distribute the access request for the service object to the container group corresponding to the service object according to the load balancing weight of the container group corresponding to the accessed service object, that is, implement load balancing scheduling.

[0074] It should be noted that the access request of the client or terminal is first sent to the service object. The load balancer forwards the access request received from the service object to the container group corresponding to the service object according to the load balancing weight of the container group corresponding to the service object. It can be understood that when the service object is only for one container group, the access request received by the service object is forwarded to the unique corresponding container group. When the service object corresponds to multiple container groups, the access request received from the service object can be forwarded to the container group corresponding to the service object according to the load balancing weight of the container group corresponding to the service object.

[0075] Now Figure 3Take for example. Assume that when a large number of requests access service object B, the container group 3 corresponding to service object B will be accessed, so that the load of host machine 2 will increase, resulting in a decrease in the processing capacity of container group 2 of service object A on host machine 2. In the traditional method, the load balancer cannot perceive this, and will still send the access request received by service object A to container group 2 according to the statically configured scheduling algorithm. This leads to a decrease in the overall service efficiency of service object A. According to the scheme of the present application, the load balancer can obtain the resource usage information of host machines 1 and 2 corresponding to service object A, and determine that the load of host machine 2 is very heavy. Then, it can be perceived that the processing capacity of container group 2 running on host machine 2 is declining, and then dynamically allocate less load balancing weight to container group 2, and dynamically allocate more load balancing weight to container group 1. Furthermore, access requests for service object A can be dynamically allocated to container group 1 and container group 2 according to the load balancing weights of the corresponding container groups (container group 1 and container group 2) of service object A. In this way, more access requests can be transferred to container group 1, thereby improving the overall service efficiency of service object A.

[0076] The above-mentioned load balancing allocation method, for multiple container groups corresponding to the same service object, respectively obtains the reported resource usage information of the host machine on which the container group runs; the resource usage information is collected and reported from the host machine by the first process running in the host machine; according to the resource usage information of each host machine, the load balancing weight of the container group running in the host machine is determined; the resource usage information is related to the load balancing weight; according to the load balancing weight, the access request for the service object is allocated to the container group corresponding to the service object. The resource usage information of the host machine can accurately characterize the actual load situation of the host machine, and then according to the resource usage information of the host machine, the load balancing weight of the container group can be more accurately and dynamically determined, so that based on the dynamically determined load balancing weight, load balancing allocation can be more accurately performed. In addition, actual tests have found that when the host machine is unbalanced in load, the method in each embodiment of the present application greatly improves the responsiveness of the service object, and the resource overhead used by the method in each embodiment of the present application is very low.

[0077] In one embodiment, for multiple container groups corresponding to the same service object, respectively obtaining resource usage information of the host machines on which the reported container groups are running includes: for multiple container groups corresponding to the same service object, obtaining resource usage information of the host machines on which each container group is running, forwarded by a controller.

[0078] The resource usage information forwarded by the controller is collected from the host machine by the first process running in the host machine and reported to the controller.

[0079] The controller is a model that controls resources to achieve the "expected" state. The controller is equivalent to a state machine, which is used to control the specific state and behavior of the container group.

[0080] Specifically, the host machine can collect resource usage information of the host machine through the first process running on the host machine, and report the resource usage information to the controller through the first process. The controller can forward the reported resource usage information to the load balancer.

[0081] For ease of understanding, now combined Figure 4 The architecture diagram is used as an example. Figure 4 , container group 1 and container group 2 are respectively running on host 1 and host 2. An agent daemon process (i.e., the first process) is run on each of host 1 and host 2 to collect their respective resource usage rates (i.e., resource usage information), and report the collected resource usage rates to the controller, which can notify the load balancer lb of the reported resource usage rates. The load balancer runs a weight setting process weight-setter (i.e., the second process) and a load balancing program (e.g., Linux IPVS, i.e., the load balancing software program that comes with the Linux system). The load balancer can determine the load balancing weights of the container groups running in each host through the weight setting process according to the reported resource usage rates of the host machines, and modify the original load balancing weights of each container group recorded in the load balancing program to the determined load balancing weights through the weight setting process. Subsequently, after the service object receives the access request, the load balancer can allocate the access request for the service object to the service object according to the modified load balancing weights of each container group corresponding to the service object.

[0082] In the above embodiment, the host machine reports the resource usage information of the host machine to the controller through the first process, and then the controller forwards it to the load balancer. Therefore, by only adding the first process, the resource usage information of the host machine can be reported under the original framework, which is very convenient and avoids unnecessary costs caused by too many changes.

[0083] In one embodiment, step 204 determines the load balancing weight of the container group running in the host machine according to the resource usage information of each of the host machines, including: determining the load balancing weight of the container group running in the host machine according to the resource usage information of the host machine through a second process running on the load balancer; and modifying the original load balancing weight of the container group recorded in the load balancing program running on the load balancer to the determined load balancing weight through the second process.

[0084] The second process is a process running in the load balancer and used to set the load balancing weight. It can be called a weight setting process. The load balancing program is a software program running in the load balancer and recording the load balancing weights of each container group. It can be understood that the load balancing program can implement load balancing distribution processing according to the recorded load balancing weights.

[0085] Specifically, the load balancer can determine the load balancing weight of the container group running in the host machine according to the resource usage information of the host machine reported by the second process running in the load balancer. The load balancer can modify the original load balancing weight of the container group in the load balancing program running in the load balancer to the load balancing weight determined in step 204 through the second process, so as to dynamically modify and set the load balancing weight of the container group. In this way, the dynamically modified load balancing weight is recorded in the load balancing program. The load balancer can dynamically allocate the access request for the service object to the container group corresponding to the service object according to the dynamically modified load balancing weight recorded in the load balancing program.

[0086] In the above embodiment, by setting a second process in the load balancer, the load balancing weight of the container group in the host can be dynamically determined and modified according to the resource usage information of the host, which is very convenient and avoids changes to the original framework, thereby avoiding cost waste.

[0087] In one embodiment, step 204 determines the load balancing weight of the container group running in the host machine according to the resource usage information of each of the host machines, including: for each of the host machines, determining the load balancing weight of the container group running in the host machine according to the resource usage information of the host machine and the total resource usage information corresponding to the service object.

[0088] The total resource usage information is the sum of resource usage information of each host machine on which each container group corresponding to the service object runs.

[0089] Specifically, when the load balancer needs to determine the load balancing weights of each container group of the same service object, it can determine each host machine on which each container group corresponding to the service object runs, and obtain the total resource usage information corresponding to the service object based on the sum of the resource usage information of each determined host machine. For each host machine on which each container group corresponding to the service object runs, the load balancer can determine the load balancing weight of the container group running in the host machine based on the resource usage information of the host machine and the total resource usage information corresponding to the service object.

[0090] For ease of understanding, now combined Figure 3Let's take an example. Assuming that the access requests received by service object A need to be load balanced, then it is necessary to determine the load balancing weights of container group 1 and container group 2 corresponding to service object A. The load balancer can obtain the resource usage information of host machine 1 on which container group 1 runs, and the resource usage information of host machine 2 on which container group 2 runs. The load balancer can determine the total resource usage information corresponding to service object A (that is, the sum of the resource usage information corresponding to host machine 1 and host machine 2). The load balancer can determine the load balancing weight corresponding to container group 1 on host machine 1 based on the resource usage information of host machine 1 and the total resource usage information corresponding to service object A. Similarly, the load balancer can determine the load balancing weight corresponding to container group 2 on host machine 2 based on the resource usage information of host machine 2 and the total resource usage information corresponding to service object A.

[0091] In one embodiment, for each of the host machines, the load balancer can determine the load balancing weight of the container group running in the host machine through a second process based on the resource usage information of the host machine and the total resource usage information corresponding to the service object. Furthermore, through the second process, the original load balancing weight of the container group recorded in the load balancing program running on the load balancer is modified to the determined load balancing weight.

[0092] In the above embodiment, the load balancing weight of the container group running in the host can be accurately and conveniently determined based on the resource usage information of the host and the total resource usage information corresponding to the service object, thereby improving the accuracy of subsequent load balancing distribution.

[0093] In one embodiment, determining the load balancing weight of the container group running in the host machine according to the resource usage information of the host machine and the total resource usage information corresponding to the service object includes: when the resource usage information includes CPU usage information and network bandwidth usage information, determining a first proportion corresponding to the host machine according to the CPU usage information of the host machine; determining a second proportion corresponding to the host machine according to the network bandwidth usage information of the host machine; and determining the load balancing weight of the container group running in the host machine according to the first proportion and the second proportion.

[0094] The first ratio is the ratio of the CPU usage information of the host machine to the total CPU usage information corresponding to the service object. That is, the first ratio is the CPU resource ratio. The total CPU usage information is the sum of the CPU usage information of each host machine on which each container group corresponding to the service object runs.

[0095] The second ratio is the ratio of the network bandwidth usage information of the host machine to the total network bandwidth usage information corresponding to the service object. The second ratio is the network bandwidth ratio. The total network bandwidth usage information is the sum of the network bandwidth usage information of each host machine on which each container group corresponding to the service object runs.

[0096] It can be understood that the CPU usage information is used to characterize the amount of CPU resources used. Therefore, the CPU usage information can be the amount of CPU resources used (i.e., occupied) or the amount of idle (i.e., surplus, unused) CPU resources. The network bandwidth usage information is used to characterize the use of network bandwidth. Therefore, the network bandwidth usage information can be the amount of network bandwidth used or the amount of idle network bandwidth.

[0097] In one embodiment, the data structure of the host machine's resource usage information (ie, structure node_cfg) may be as follows:

[0098]

[0099] This structure indicates that for a container group (pod) corresponding to a service object (service), the surplus CPU hertz and network bandwidth of the host machine (i.e., node) on which these container groups run are obtained to obtain the resource usage information of the host machine.

[0100] In one embodiment, determining the load balancing weight of the container group running in the host machine according to the first proportion and the second proportion includes: when the CPU usage information is the amount of idle CPU resources, and the network bandwidth usage information is the amount of idle network bandwidth, taking the minimum value of the first proportion and the second proportion to obtain the load balancing weight of the container group running in the host machine.

[0101] It is understandable that the load balancer can directly use the minimum value as the load balancing weight of the container group running in the host machine. The minimum value can also be further converted (for example, linearly converted) to obtain the load balancing weight of the container group running in the host machine.

[0102] In the above embodiment, because the usage of either the CPU or the network bandwidth affects the load of the host machine, selecting the one with less idle time from the CPU idle time and the network bandwidth idle time to determine the load balancing weight can improve accuracy.

[0103] In one embodiment, when only one container group is running in the host machine, the minimum value can be used as the load balancing weight of the container group. When there are multiple container groups in the host machine, the load balancing weights of each container group running in the host machine can be further determined based on the minimum value.

[0104] In one embodiment, taking the minimum value of the first proportion and the second proportion to obtain the load balancing weight of the container group running in the host includes: when multiple container groups are running in the host, taking the minimum value of the first proportion and the second proportion; dividing the minimum value according to the number of container groups running in the host; and using the divided value as the load balancing weight of the container group running in the host.

[0105] It can be understood that the “multiple” in each embodiment of the present application refers to at least two.

[0106] In one embodiment, the load balancer can determine the number of container groups running in the host machine, divide the minimum value into equal parts according to the number of container groups running in the host machine, and use the divided value as the load balancing weight of each container group running in the host machine.

[0107] For example, for each host's resource usage information structure node_cfg, calculate the ratio of the idle CPU hertz (i.e., cpu_hz, idle CPU resources) to the idle total CPU resources of all hosts corresponding to the service object (i.e., the sum of the idle CPU resources node cpu_hz of each host), and obtain the first ratio cpu_ratio. Then calculate the ratio of the idle network bandwidth (i.e., net_pps) to the idle total network bandwidth of all hosts corresponding to the service object (i.e., the sum of the idle network bandwidth node net_pps of each host), and obtain the second ratio net_ratio. Finally, min(cpu_ratio, net_ratio), that is, the minimum value of the first ratio and the second ratio, is taken as the load balancing weight of the container group (pod) on the host. If there are N container groups (pods) on the same host (node), min(cpu_ratio,net_ratio) / N can be used as the load balancing weight of each container group on the host. In other words, the minimum value is divided equally and the divided value is used as the load balancing weight of each container group on the host.

[0108] In the above embodiment, when multiple container groups are running in the host machine, the minimum value is divided according to the number of container groups running in the host machine; the divided value is used as the load balancing weight of the container group running in the host machine, which can take into account each container group in the same host machine, thereby improving the accuracy of the load balancing weight of each container group.

[0109] In one embodiment, determining the load balancing weight of the container group running in the host machine according to the first proportion and the second proportion includes: when the CPU usage information is the amount of CPU resources occupied, and the network bandwidth usage information is the amount of network bandwidth occupied, taking the maximum value of the first proportion and the second proportion, and determining the load balancing weight of the container group running in the host machine according to the maximum value taken. Among them, the size of the load balancing weight of the container group is negatively correlated with the size of the maximum value taken. That is, the larger the maximum value taken, the larger the amount of resources occupied, and the smaller the load balancing weight. The smaller the maximum value taken, the smaller the amount of resources occupied, and the larger the load balancing weight.

[0110] In other embodiments, the load balancer may also combine the first proportion and the second proportion (for example, linear calculation) to determine a new value as the load balancing weight of the container group running in the host machine.

[0111] In the above embodiment, the CPU usage information and the network bandwidth usage information can more accurately reflect the load of the host machine. Therefore, according to the CPU usage ratio (i.e., the first ratio) and the network bandwidth usage ratio (i.e., the second ratio) of the host machine, the load balancing weight of the container group running in the host machine can be accurately determined, thereby improving the accuracy of subsequent load balancing distribution.

[0112] like Figure 5 As shown, in one embodiment, a load balancing distribution method is provided, and the method is applied to Figure 1 The host machine 150 in the example is used as an example for illustration. The method includes the following steps:

[0113] Step 502: The host machine collects resource usage information of the host machine according to the running first process.

[0114] Step 504, reporting resource usage information to the load balancer; the resource usage information is used to instruct the load balancer to determine the load balancing weight of the container group running on the host machine according to the resource usage information.

[0115] Step 506: Receive, through the container group running on the host machine, an access request to the service object corresponding to the container group running on the host machine, which is allocated by the load balancer according to the load balancing weight.

[0116] In one embodiment, the first process is a native process running in the local end of the host machine and used to collect resource usage information of the host machine. In other embodiments, the first process may also be a newly added non-native process.

[0117] In one embodiment, the resource usage information is used to instruct the load balancer to determine the load balancing weight of the container group running on the host machine according to the resource usage information through the second process, and to modify the original load balancing weight of the container group in the load balancing program running on the load balancer to the determined load balancing weight. The second process is a process responsible for running in the balancer and used to determine and modify the load balancing weight.

[0118] In the above embodiment, by running the first process in the host machine to collect and report the resource usage information of the host machine, the resource usage information of the host machine can accurately represent the actual load situation of the host machine, and then according to the resource usage information of the host machine, the load balancing weight of the container group can be more accurately and dynamically determined, so as to more accurately perform load balancing on the received access request.

[0119] like Figure 6 As shown, in one embodiment, a resource balancing allocation system 600 is provided, the system 600 includes a host machine 602, a container group 604 running in the host machine 602, and a load balancer 606; wherein:

[0120] The host machine 602 is used to collect resource usage information of the host machine according to the first process, and report the resource usage information to the load balancer 606.

[0121] The load balancer 606 is used to determine the load balancing weight of the container group 604 running in the host machine 602 for multiple container groups 604 corresponding to the same service object according to the resource usage information of the host machine 602 on which each of the container groups 604 runs; the resource usage information is related to the load balancing weight.

[0122] The load balancer 606 is further configured to distribute the access request for the service object to the container group 602 corresponding to the service object according to the load balancing weight.

[0123] like Figure 7 As shown, in one embodiment, the system further includes a controller 605 .

[0124] The host machine 604 is further configured to collect resource usage information of the host machine according to the first process, and report the resource usage information to the controller 605 .

[0125] The controller 605 is further configured to forward the resource usage information to the load balancer.

[0126] In one embodiment, the load balancer 606 runs a second process and a load balancing program; the load balancing program records the original load balancing weight of the container group;

[0127] The load balancer 606 is also used to determine, through the second process, for multiple container groups corresponding to the same service object, the load balancing weight of the container group running in the host machine according to resource usage information of the host machine on which each of the container groups runs; and modify, through the second process, the original load balancing weight recorded in the load balancing program to the determined load balancing weight.

[0128] In one embodiment, the load balancer 606 is further used to determine, for each of the host machines, a load balancing weight of the container group running in the host machine according to the resource usage information of the host machine and the total resource usage information corresponding to the service object; wherein the total resource usage information is the sum of the resource usage information of each host machine on which each container group corresponding to the service object runs.

[0129] In one embodiment, the load balancer 606 is further used to determine a first proportion corresponding to the host machine according to the CPU usage information of the host machine when the resource usage information includes CPU usage information and network bandwidth usage information; the first proportion is the ratio of the CPU usage information of the host machine to the total CPU usage information corresponding to the service object; the total CPU usage information is the sum of the CPU usage information of the host machines on which the container groups corresponding to the service object run; determine a second proportion corresponding to the host machine according to the network bandwidth usage information of the host machine; the second proportion is the ratio of the network bandwidth usage information of the host machine to the total network bandwidth usage information corresponding to the service object; the total network bandwidth usage information is the sum of the network bandwidth usage information of the host machines on which the container groups corresponding to the service object run; and determine the load balancing weight of the container group running in the host machine according to the first proportion and the second proportion.

[0130] In one embodiment, the load balancer 606 is further configured to, when the CPU usage information is the amount of idle CPU resources and the network bandwidth usage information is the amount of idle network bandwidth, take the minimum value of the first proportion and the second proportion to obtain the load balancing weight of the container group running in the host machine.

[0131] In one embodiment, the load balancer 606 is further used to, when there are multiple container groups running in the host machine, divide the minimum value of the first proportion and the second proportion according to the number of container groups running in the host machine; and use the divided value as the load balancing weight of each container group running in the host machine.

[0132] Figure 8 The following is a timing diagram of a load balancing distribution method in an embodiment. Specifically, the following steps are included:

[0133] (1) The host machine reports the idle CPU resources and idle network bandwidth of the host machine to the controller through the proxy daemon process.

[0134] (2) The controller notifies the load balancer of the reported idle CPU resources and idle network bandwidth.

[0135] (3) For multiple container groups corresponding to the same service object, the load balancer can obtain the idle CPU resources and idle network bandwidth of the host machine where each container group runs based on the reported situation.

[0136] (4) For each host machine, the load balancer can obtain the first proportion corresponding to the host machine according to the ratio of the idle CPU resources of the host machine to the total idle CPU resources corresponding to the service object through a weight setting process.

[0137] (5) The load balancer can obtain the second proportion corresponding to the host machine according to the ratio of the idle network bandwidth usage information of the host machine and the total amount of idle network bandwidth corresponding to the service object through a weight setting process.

[0138] (6) When only one container group is running in the host machine, the load balancer can take the minimum value of the first proportion and the second proportion to obtain the load balancing weight of the container group.

[0139] (7) When multiple container groups are running in the host machine, the load balancer may divide the minimum value of the first proportion and the second proportion according to the number of container groups running in the host machine to obtain the load balancing weight of each container group.

[0140] (8) The load balancer can distribute the access request for the service object to the container group corresponding to the service object according to the load balancing weight of each container group.

[0141] like Fig. 9As shown, in one embodiment, a load balancing distribution device is provided, which is arranged in a load balancer. The device includes: an acquisition module 902, a weight determination module 904 and a request distribution module 906; wherein:

[0142] The acquisition module 902 is used to respectively acquire, for multiple container groups corresponding to the same service object, resource usage information of the host machine on which the container group is running, which is reported; the resource usage information is collected and reported from the host machine by the first process running in the host machine.

[0143] The weight determination module 904 is used to determine the load balancing weight of the container group running in the host machine according to the resource usage information of each host machine; the resource usage information is related to the load balancing weight.

[0144] The request allocation module 906 is configured to allocate the access request for the service object to the container group corresponding to the service object according to the load balancing weight.

[0145] In one embodiment, the acquisition module 902 is further configured to acquire, for multiple container groups corresponding to the same service object, resource usage information of the host machine on which each container group runs, forwarded by the controller.

[0146] In one embodiment, the weight determination module 904 is further used to determine the load balancing weight of the container group running in the host machine according to the resource usage information of the host machine through a second process running on the load balancer; through the second process, the original load balancing weight of the container group recorded in the load balancing program running on the load balancer is modified to the determined load balancing weight.

[0147] In one embodiment, the weight determination module 904 is further used to determine, for each of the host machines, the load balancing weight of the container group running in the host machine according to the resource usage information of the host machine and the total resource usage information corresponding to the service object; wherein the total resource usage information is the sum of the resource usage information of each host machine on which each container group corresponding to the service object runs.

[0148] In one embodiment, the weight determination module 904 is also used to determine a first proportion corresponding to the host machine according to the CPU usage information of the host machine when the resource usage information includes CPU usage information and network bandwidth usage information; the first proportion is the ratio of the CPU usage information of the host machine to the total CPU usage information corresponding to the service object; the total CPU usage information is the sum of the CPU usage information of the host machines on which the container groups corresponding to the service object run; according to the network bandwidth usage information of the host machine, determine a second proportion corresponding to the host machine; the second proportion is the ratio of the network bandwidth usage information of the host machine to the total network bandwidth usage information corresponding to the service object; the total network bandwidth usage information is the sum of the network bandwidth usage information of the host machines on which the container groups corresponding to the service object run; according to the first proportion and the second proportion, determine the load balancing weight of the container group running in the host machine.

[0149] In one embodiment, the weight determination module 904 is further used to take the minimum value of the first proportion and the second proportion when the CPU usage information is the amount of idle CPU resources and the network bandwidth usage information is the amount of idle network bandwidth, so as to obtain the load balancing weight of the container group running in the host machine.

[0150] In one embodiment, the weight determination module 904 is further used to divide the minimum value of the first proportion and the second proportion according to the number of container groups running in the host machine when multiple container groups are running in the host machine; and use the divided value as the load balancing weight of each container group running in the host machine.

[0151] like Fig.10 As shown, in one embodiment, a load balancing distribution device is provided. Taking the load balancing distribution device set in a host machine as an example, the load balancing distribution device includes a collection module 1002, a reporting module 1004 and a request receiving module 1006; wherein:

[0152] The collection module 1002 is used for the host machine to collect resource usage information of the host machine according to the running first process.

[0153] The reporting module 1004 is used to report the resource usage information to the load balancer; the resource usage information is used to instruct the load balancer to determine the load balancing weight of the container group running on the host machine according to the resource usage information.

[0154] The request receiving module 1006 is used to receive, through the container group running on the host machine, an access request to the service object corresponding to the container group running on the host machine and allocated by the load balancer according to the load balancing weight.

[0155] For the specific definition of the load balancing distribution device, please refer to the definition of the load balancing distribution method above, which will not be repeated here. Each module in the above-mentioned load balancing distribution device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0156] In one embodiment, a computer device is provided. The computer device may be a load balancer or a host machine, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store search data. The network interface of the computer device is used to communicate with an external computer device through a network connection. When the computer program is executed by the processor, a load balancing distribution method is implemented. It can be understood that the server implements the background processing steps in the load balancing distribution method.

[0157] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0158] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0159] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0160] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0161] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0162] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0163] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A load balancing distribution method, characterized in that: Executed by a load balancer, the method includes: For multiple container groups corresponding to the same service object, respectively obtain reported resource usage information of the host machine on which the container group runs; the resource usage information is collected and reported from the host machine by a first process running in the host machine; Determining a load balancing weight of a container group running in the host machine according to the resource usage information of each of the host machines; Allocating access requests for the service object to the container group corresponding to the service object according to the load balancing weight; The step of determining the load balancing weight of the container group running in the host machine according to the resource usage information of each host machine includes: For each of the host machines, when the resource usage information includes CPU usage information and network bandwidth usage information, determining a first percentage corresponding to the host machine according to the CPU usage information of the host machine; Determining a second proportion corresponding to the host machine according to the network bandwidth usage information of the host machine; A load balancing weight of a container group running in the host machine is determined according to the first proportion and the second proportion.

2. The method according to claim 1, characterized in that The step of obtaining, for each of the plurality of container groups corresponding to the same service object, respectively the reported resource usage information of the host machines on which the container groups are running includes: For multiple container groups corresponding to the same service object, resource usage information of the host machine on which the container group runs, forwarded by the controller, is obtained.

3. The method according to claim 1, characterized in that Determining the load balancing weight of the container group running in the host machine according to the resource usage information of each host machine includes: Determining, by a second process running on the load balancer, a load balancing weight of a container group running on the host machine according to the resource usage information of the host machine; Through the second process, the original load balancing weight of the container group recorded in the load balancing program running on the load balancer is modified to the determined load balancing weight.

4. The method according to claim 1, characterized in that: The first proportion is a ratio of the CPU usage information of the host machine to the total CPU usage information corresponding to the service object; the total CPU usage information is the sum of the CPU usage information of the hosts on which the container groups corresponding to the service object run; the second proportion is a ratio of the network bandwidth usage information of the host machine to the total network bandwidth usage information corresponding to the service object; the total network bandwidth usage information is the sum of the network bandwidth usage information of the hosts on which the container groups corresponding to the service object run.

5. The method according to claim 4, characterized in that The determining, according to the first proportion and the second proportion, a load balancing weight of the container group running in the host machine includes: When the CPU usage information is the amount of idle CPU resources, and the network bandwidth usage information is the amount of idle network bandwidth, a minimum value of the first proportion and the second proportion is taken to obtain a load balancing weight of the container group running in the host machine.

6. The method according to claim 5, characterized in that The step of taking the minimum value of the first proportion and the second proportion to obtain the load balancing weight of the container group running in the host machine includes: When multiple container groups are running in the host machine, the minimum value of the first proportion and the second proportion is divided according to the number of container groups running in the host machine; The divided value is used as the load balancing weight of each container group running in the host machine.

7. A load balancing distribution method, characterized in that: The method comprises: The host machine collects resource usage information of the host machine according to the running first process; Reporting the resource usage information to the load balancer; the resource usage information is used to instruct the load balancer to determine a first proportion corresponding to the host machine according to the CPU usage information of the host machine when the resource usage information includes CPU usage information and network bandwidth usage information; determine a second proportion corresponding to the host machine according to the network bandwidth usage information of the host machine; determine a load balancing weight of a container group running in the host machine according to the first proportion and the second proportion; An access request for a service object corresponding to the container group running on the host machine and allocated by the load balancer according to the load balancing weight is received through the container group running on the host machine.

8. A resource balanced allocation system, characterized in that: The system includes a host machine, a container group and a load balancer running in the host machine; The host machine is used to collect resource usage information of the host machine according to the first process, and report the resource usage information to the load balancer; The load balancer is used for, for multiple container groups corresponding to the same service object, when the resource usage information includes CPU usage information and network bandwidth usage information, determining a first share corresponding to the host machine on which the container group is running according to the CPU usage information of the host machine on which the container group is running; determining a second share corresponding to the host machine on which the container group is running according to the network bandwidth usage information of the host machine on which the container group is running; and determining a load balancing weight of the container group running in the host machine according to the first share and the second share; The load balancer is further configured to distribute the access request for the service object to the container group corresponding to the service object according to the load balancing weight.

9. The system according to claim 8, characterized in that The system also includes a controller; The host machine is further used to collect resource usage information of the host machine according to the first process, and report the resource usage information to the controller; The controller is further configured to forward the resource usage information to the load balancer.

10. The system according to claim 9, characterized in that The load balancer runs a second process and a load balancing program; the load balancing program records the original load balancing weight of the container group; The load balancer is further configured to determine, through the second process, for multiple container groups corresponding to the same service object, a load balancing weight of the container group running in the host machine according to resource usage information of the host machine on which the container group runs; Through the second process, the original load balancing weight recorded in the load balancing program is modified to the determined load balancing weight.

11. A load balancing distribution device, characterized in that: Set in a load balancer, the device includes: an acquisition module, configured to respectively acquire, for a plurality of container groups corresponding to the same service object, resource usage information of a host machine on which the container groups are running, which is reported; the resource usage information is collected and reported from the host machine by a first process running in the host machine; A weight determination module, for each of the host machines, when the resource usage information includes CPU usage information and network bandwidth usage information, determining a first proportion corresponding to the host machine according to the CPU usage information of the host machine; determining a second proportion corresponding to the host machine according to the network bandwidth usage information of the host machine; and determining a load balancing weight of a container group running in the host machine according to the first proportion and the second proportion; The request allocation module is used to allocate the access request for the service object to the container group corresponding to the service object according to the load balancing weight.

12. The device according to claim 11, characterized in that The acquisition module is further configured to acquire, for multiple container groups corresponding to the same service object, resource usage information of the host machine on which the container groups are running, forwarded by the controller.

13. The device according to claim 11, characterized in that The weight determination module is further configured to determine, through a second process running on the load balancer, a load balancing weight of a container group running on the host machine according to the resource usage information of the host machine; Through the second process, the original load balancing weight of the container group recorded in the load balancing program running on the load balancer is modified to the determined load balancing weight.

14. The device according to claim 11, characterized in that The first proportion is a ratio of the CPU usage information of the host machine to the total CPU usage information corresponding to the service object; the total CPU usage information is the sum of the CPU usage information of the hosts on which the container groups corresponding to the service object run; the second proportion is a ratio of the network bandwidth usage information of the host machine to the total network bandwidth usage information corresponding to the service object; the total network bandwidth usage information is the sum of the network bandwidth usage information of the hosts on which the container groups corresponding to the service object run.

15. The device according to claim 14, characterized in that The weight determination module is further configured to, when the CPU usage information is the amount of idle CPU resources and the network bandwidth usage information is the amount of idle network bandwidth, take a minimum value of the first proportion and the second proportion to obtain a load balancing weight of the container group running in the host machine.

16. The device according to claim 15, characterized in that The weight determination module is also used to, when multiple container groups are running in the host machine, divide the minimum value of the first proportion and the second proportion according to the number of container groups running in the host machine; and use the divided value as the load balancing weight of each container group running in the host machine.

17. A load balancing distribution device, characterized in that: The device is arranged in a host machine and comprises: A collection module, configured to collect resource usage information of the host machine according to the first process being run; A reporting module, configured to report the resource usage information to a load balancer; the resource usage information is configured to instruct the load balancer to determine, when the resource usage information includes CPU usage information and network bandwidth usage information, a first proportion corresponding to the host machine according to the CPU usage information of the host machine; determine a second proportion corresponding to the host machine according to the network bandwidth usage information of the host machine; and determine a load balancing weight of a container group running in the host machine according to the first proportion and the second proportion; The request receiving module is used to receive, through the container group running on the host machine, an access request to the service object corresponding to the container group running on the host machine and allocated by the load balancer according to the load balancing weight.

18. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

19. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

20. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Docker cloud platform based dynamic-priority-queue-feedback load-balanced resource scheduling method

    CN106790726A

  • Load balancing algorithm based on Docker container cluster

    CN107888708A