CN111666131A - Load balancing distribution method and device, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN111666131A
CN111666131A CN202010631600.3A CN202010631600A CN111666131A CN 111666131 A CN111666131 A CN 111666131A CN 202010631600 A CN202010631600 A CN 202010631600A CN 111666131 A CN111666131 A CN 111666131A
Authority
CN
China
Prior art keywords
load balancing
host
usage information
running
host machine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010631600.3A
Other languages
Chinese (zh)
Inventor
范建明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010631600.3A priority Critical patent/CN111666131A/en
Publication of CN111666131A publication Critical patent/CN111666131A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application relates to a load balancing distribution method, a load balancing distribution device, computer equipment and a storage medium. The method comprises the following steps: respectively acquiring reported resource use information of a host machine in which the container group operates aiming at a plurality of container groups corresponding to the same service object; the resource use information is collected and reported from the host machine by a first process running in the host machine; determining load balancing weights of container groups running in the hosts according to the resource use information of each host; the resource usage information is related to the load balancing weight; and distributing the access request aiming at the service object to the container group corresponding to the service object according to the load balancing weight. By adopting the method, the accuracy of load balancing scheduling can be improved.

Description

Load balancing distribution method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, in particular to the field of cloud technologies, and in particular, to a load balancing allocation method and apparatus, a computer device, and a storage medium.
Background
With the rapid development of scientific technology, cloud technology is produced. In a container cloud cluster system, requests are reasonably distributed to container groups in a container cloud through load balancing scheduling, and the method belongs to an important application in cloud technology.
In the traditional method, a worker can preset the weight of each container group, and the load balancer can carry out flow scheduling according to the preset weight. The conventional scheduling method according to the preset weight has a problem that the real load is unknown, so that the scheduling is not accurate enough.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a load balancing allocation method, apparatus, computer device, and storage medium capable of improving accuracy.
A method for load balancing distribution, the method comprising:
respectively acquiring reported resource use information of a host machine in which the container group operates aiming at a plurality of container groups corresponding to the same service object; the resource use information is collected and reported from the host machine by a first process running in the host machine;
determining load balancing weights of container groups running in the hosts according to the resource use information of each host; the resource usage information is related to the load balancing weight;
and distributing the access request aiming at the service object to the container group corresponding to the service object according to the load balancing weight.
A method for load balancing distribution, the method comprising:
the host machine acquires resource use information of the host machine according to the running first process;
reporting the resource use information to a load balancer; the resource use information is used for indicating the load balancer to determine the load balancing weight of the container group running on the host machine according to the resource use information;
and receiving an access request which is distributed by the load balancer according to the load balancing weight and is directed to a service object corresponding to the container group running on the host machine through the container group running on the host machine.
A load balancing distribution apparatus, the apparatus comprising:
an obtaining module, configured to obtain, for multiple container groups corresponding to a same service object, reported resource usage information of a host in which the container groups operate; the resource use information is collected and reported from the host machine by a first process running in the host machine;
a weight determining module, configured to determine load balancing weights of container groups running in the hosts according to the resource usage information of each host; the resource usage information is related to the load balancing weight;
and the request distribution module is used for distributing the access request aiming at the service object to the container group corresponding to the service object according to the load balancing weight.
In one embodiment, the obtaining module is further configured to obtain, for a plurality of container groups corresponding to the same service object, resource usage information of a host on which each of the container groups operates, which is forwarded by the controller.
In one embodiment, the weight determining module is further configured to determine, by a second process running on a load balancer, load balancing weights of container groups running on the host according to the resource usage information of the host; and modifying the original load balancing weight of the container group recorded in a load balancing program running in a load balancer into the determined load balancing weight through the second process.
In one embodiment, the weight determining module is further configured to determine, for each of the hosts, a load balancing weight of a container group running in the host according to the resource usage information of the host and total resource usage information corresponding to the service object; the total resource usage information is the sum of the resource usage information of the hosts on which the container groups corresponding to the service objects operate.
In one embodiment, the weight determining module is further configured to determine, when the resource usage information includes CPU usage information and network bandwidth usage information, a first percentage corresponding to the host according to the CPU usage information of the host; the first occupation ratio is a ratio of the CPU usage information of the host 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 operate; determining a second occupation ratio corresponding to the host according to the network bandwidth use information of the host; the second occupation ratio is a ratio of the network bandwidth usage information of the host to the total network bandwidth usage information corresponding to the service object; the total network bandwidth usage information is a sum of network bandwidth usage information of hosts on which each container group corresponding to the service object operates; and determining the load balancing weight of the container group running in the host machine according to the first occupation ratio and the second occupation ratio.
In an embodiment, the weight determining module is further configured to, when the CPU usage information is an idle CPU resource amount and the network bandwidth usage information is an idle network bandwidth amount, take a minimum value for the first occupation ratio and the second occupation ratio to obtain a load balancing weight of a container group running in the host.
In one embodiment, the weight determining module is further configured to, when a plurality of container groups run in the host, divide a minimum value of the first proportion and the second proportion by the number of container groups running in the host; and taking the divided numerical value as the load balancing weight of each container group running in the host machine.
A load balancing distribution apparatus, the apparatus comprising:
the acquisition module is used for acquiring the resource use information of the host machine according to the running first process;
a reporting module, configured to report the resource usage information to a load balancer; the resource use information is used for indicating the load balancer to determine the load balancing weight of the container group running on the host machine according to the resource use information;
and the request receiving module is used for receiving an access request which is distributed by the load balancer according to the load balancing weight and aims at a service object corresponding to the container group running on the host machine through the container group running on the host machine.
A computer device includes a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the load balancing allocation method described in the embodiments of the present application when executing the computer program.
A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the load balancing distribution method described in the embodiments of the present application.
According to the load balancing distribution method, the load balancing distribution device, the computer equipment and the storage medium, the reported resource use information of the host machine in which the container group operates is respectively obtained for a plurality of container groups corresponding to the same service object; the resource use information is collected and reported from the host machine by a first process running in the host machine; determining load balancing weights of container groups running in the hosts according to the resource use information of each host; the resource usage information is related to the load balancing weight; and distributing the access request aiming at the service object to the container group corresponding to the service object according to the load balancing weight. The resource use information of the host machine can accurately represent the real load condition of the host machine, and further the load balancing weight of the volume group can be more accurately and dynamically determined according to the resource use information of the host machine, so that the load balancing distribution can be more accurately carried out based on the load balancing weight.
Drawings
FIG. 1 is a diagram of an exemplary implementation of a load balancing distribution method;
FIG. 2 is a flow diagram illustrating a load balancing distribution method according to an embodiment;
FIG. 3 is a diagram illustrating relationships between service objects, groups of containers, and hosts, in one embodiment;
FIG. 4 is an architecture diagram of a load balancing distribution method in one embodiment;
FIG. 5 is a flow chart of a load balancing distribution method in another embodiment;
FIG. 6 is a block diagram of a load balancing distribution system in one embodiment;
FIG. 7 is a block diagram of a load balancing distribution system in another embodiment;
FIG. 8 is a timing diagram of a load balancing distribution method in one embodiment;
FIG. 9 is a block diagram showing the structure of a load balancing apparatus according to an embodiment;
fig. 10 is a block diagram showing the structure of a load balancing and distributing apparatus according to another embodiment;
FIG. 11 is a diagram illustrating an internal structure of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The load balancing distribution method provided by the application can be applied to the application environment shown in fig. 1. Referring to fig. 1, the application scenario includes a terminal 110, a Service object (Service)120, a load balancer (lb) 130, a container group (pod)140, and a host 150, which are communicatively connected to each other. The group of containers 140 runs in a host 150. At least one container group 140 may be 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 uniform fixed IP address as an 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.
It is to be appreciated that a plurality of hosts 104 form a cluster, with hosts 104 acting as nodes (nodes) in the cluster. The cluster in the embodiments of the present application may be a distributed cluster or a non-distributed cluster, and the type of the cluster is not limited herein. Therefore, the host 104 may be an independent physical server or a virtual server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform.
A first process may be run in host 150 to collect resource usage information of host 150 from host 150 and report the resource usage information to load balancer 130. For each container group 140 corresponding to the same service object 120, the load balancer 130 may determine load balancing weights of the container groups 140 running in the hosts 150 according to resource usage information of the hosts 150 on which the container groups 140 run; the size of the resource utilization rate represented by the resource utilization information is inversely related to 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 distribute 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. Therefore, the load balancing scheduling can be carried out on the access request according to the resource use condition of the host machine.
It can be understood that the load balancing distribution method in the embodiment of the present application is equivalent to performing cloud computing processing by using a cloud technology.
Cloud technology refers to a hosting technology for unifying serial resources such as hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data.
Cloud technology (Cloud technology) is based on a general term of network technology, information technology, integration technology, management platform technology, application technology and the like applied in a Cloud computing business model, can form a resource pool, is used as required, and is flexible and convenient. Cloud computing technology will become an important support. Background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture-like websites and more web portals. With the high development and application of the internet industry, each article may have its own identification mark and needs to be transmitted to a background system for logic processing, data in different levels are processed separately, and various industrial data need strong system background support and can only be realized through cloud computing.
Cloud computing (cloud computing) is a computing model that distributes computing tasks over a pool of resources formed by a large number of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. The network that provides the resources is referred to as the "cloud". Resources in the "cloud" appear to the user as being infinitely expandable and available at any time, available on demand, expandable at any time, and paid for on-demand.
As a basic capability provider of cloud computing, a cloud computing resource pool (called as an ifas (Infrastructure as a Service) platform for short is established, and multiple types of virtual resources are deployed in the resource pool and are selectively used by external clients.
According to the logic function division, a PaaS (Platform as a Service) layer can be deployed on an IaaS (Infrastructure as a Service) layer, a SaaS (Software as a Service) layer is deployed on the PaaS layer, and the SaaS can be directly deployed on the IaaS. PaaS is a platform on which software runs, such as a database, a web container, etc. SaaS is a variety of business software, such as web portal, sms, and mass texting. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
It is to be understood that the container group in the embodiment of the present application is a combination of a plurality of containers in a container cloud. In the embodiments of the application, load balancing distribution is performed through cloud computing, and computing tasks are distributed on a container cloud formed by 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 required.
In one embodiment, as shown in fig. 2, a load balancing allocation method is provided, which is described by taking the method as an example applied to the load balancer 130 in fig. 1, and includes the following steps:
step 202, for a plurality of container groups corresponding to the same service object, respectively obtaining the reported resource usage information of the host in which the container group operates.
Wherein, the container group is the combination of a group of containers. A container is a set of resource-constrained processes that are isolated from each other. It will be appreciated that the container contains the complete runtime environment.
The Service object, i.e. Service, is an object abstracted from the upper layer of the container group, and is used for providing a fixed IP address for the container group as an access interface for providing services to the outside.
It will be appreciated that as soon as a container group is restarted, its corresponding IP address changes. Therefore, the access request of the client is received through a service object with a fixed and unchangeable IP address, so that the access of the client is not influenced no matter how the IP address of the container group changes, namely, the access request received by the service object can be forwarded to the container group corresponding to the service object according to the mapping relation between the service object and the container group. Therefore, the group of containers corresponds to the target server corresponding to the service object. The target server is the object that actually processes the access request finally.
The host is a computer for executing calculation that needs to be installed with virtual machine software. It will be appreciated that the set of containers is run in a host machine, with the host machine providing the computing power for the set of containers run thereon. The host machine may be a virtual machine or a physical machine. A plurality of hosts form a cluster. A cluster is a computer system that cooperates to perform computing tasks with a high degree of closeness through a set of integrated computer software and/or hardware connections.
It is to be understood that a service object may correspond to at least one container group, one container group running on one host. A host may 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 may be container groups corresponding to different service objects.
To facilitate understanding of the relationship between service objects, container groups and hosts, an example is now illustrated in connection with the topology diagram in FIG. 3. Referring to fig. 3, a service object a (i.e., ServiceA) corresponds to a container group 1 and a container group 2 (i.e., a container group 1 and a container group 2 are target servers of the service object a), a service object B (i.e., ServiceB) corresponds to a container group 3 (i.e., a container group 3 is a target server of the service object B), and the container group 2 and the container group 3 operate on the same host 2. That is, the container groups running on the host 2 are container groups corresponding to two different service objects, namely, the service object a and the service object B. The container group 1 and the container group 2 corresponding to the same service object a run on two different hosts, the host 1 and the host 2.
And the resource use information is used for describing the resource use condition in the host machine. The resource use information is collected and reported from the host machine by a first process running in the host machine.
The first process is a process capable of collecting resource usage information of the host from the host.
In one embodiment, the first process may be a native process in the host, that is, the native process in the host may be modified to have a function of collecting resource usage information of the host. For example, the first process may be an agent daemon process, i.e., an agent process, in the host. It is understood that the first process may also be a non-native process added to the host.
In one embodiment, the resource usage information may be resource usage, or may be specific usage information of a resource used for characterizing resource usage. In one embodiment, the resources may include at least one of CPU, network bandwidth, disk, and memory. Thus, the resource usage information may include at least one of CPU usage information, network bandwidth usage information, disk usage information, and memory usage information.
Specifically, each host may run a first process, and the first process may collect resource usage information of the host from the host in which the first process runs, and report the collected resource usage information. When the load balancer needs to determine the liability balance weight of each container group corresponding to the same service object, the load balancer can obtain the resource use information of the host machine in which each container group of the same service object operates from the reported resource use information of each host machine.
It can be understood that the resource usage information may be directly reported by the host, or may be reported by the host to a third party, and forwarded to the load balancer by the third party. That is, the host may directly report the collected resource usage information of the host to the load balancer through the first process, or report the resource usage information of the host to the third-party device, and the third-party device forwards the resource usage information to the load balancer.
And step 204, determining load balancing weight of the container group running in the host machine according to the resource use information of each host machine.
Wherein the resource usage information is associated with a load balancing weight.
The resource utilization information can represent the resource utilization rate of the host machine. In one embodiment, the resource usage information may be resource usage itself. In another embodiment, the resource usage information may also be information for characterizing the size of the resource usage, i.e. information for reflecting the resource usage.
In one embodiment, the size of the resource usage characterized by the resource usage information is inversely related to the size of the load balancing weight.
When the resource usage information represents that the resource usage rate of the host is higher, it indicates that the residual resources that can be used by the host are less, and the load balancing weight of the container group running in the host is smaller. On the contrary, when the resource usage rate of the resource usage information representing the host is smaller, it indicates that the host can use more residual resources, and the load balancing weight of the container group running in the host is larger.
It is to be appreciated that what is determined in step 204 is the load balancing weight for the set of containers running in the host and corresponding to the service object.
And step 206, distributing the access request aiming at the service object to the container group corresponding to the service object according to the load balancing weight.
Specifically, the terminal may send an access request to the service object, and the load balancer may 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.
The access request of the client or the terminal is first transmitted to the service object. And the load balancer forwards the access request received to 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 will be appreciated that when a service object is for only one container group, then access requests received by the service object are forwarded to the uniquely corresponding container group. When the service object corresponds to a plurality of container groups, the access request received by the service object may 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.
This will now be illustrated by way of example in fig. 3. Suppose that, when a large number of requests access the service object B, the container group 3 corresponding to the service object B is accessed, and thus the load of the host 2 is increased, which results in the decrease of the processing capability of the container group 2 of the service object a on the host 2. In the conventional method, the load balancer cannot sense this point, or sends the access request received by the service object a to the container group 2 according to a statically configured scheduling algorithm. This results in a reduction in the overall service efficiency of the service object a. According to the scheme of the application, the load balancer can acquire the resource use information of the host machines 1 and 2 corresponding to the service object A, and judge that the load of the host machine 2 is heavy, so that the load balancer can perceive that the processing capacity of the container group 2 running on the host machine 2 is sliding downwards, and further dynamically distribute less load balancing weight for the container group 2 and more load balancing weight for the container group 1. Furthermore, the access requests for the service object a can be dynamically assigned to the container group 1 and the container group 2 according to the load balancing weight of each corresponding container group (container group 1 and container group 2) of the service object a, so that more access requests can be transferred to the container group 1, thereby improving the service efficiency of the entire service object a.
The load balancing distribution method comprises the steps of respectively acquiring reported resource use information of a host machine in which a container group operates aiming at a plurality of container groups corresponding to the same service object; the resource use information is collected and reported from the host machine by a first process running in the host machine; determining load balancing weights of container groups running in the hosts according to the resource use information of each host; the resource usage information is related to the load balancing weight; and distributing the access request aiming at the service object to the container group corresponding to the service object according to the load balancing weight. The resource use information of the host machine can accurately represent the real load condition of the host machine, and further the load balancing weight of the capacity group can be more accurately and dynamically determined according to the resource use information of the host machine, so that the load balancing distribution can be more accurately carried out based on the dynamically determined load balancing weight. In addition, practical tests show that when the load of the host machine is unbalanced, the method in the embodiments of the application greatly improves the responsiveness of the service object, and the resource overhead used by the method in the embodiments of the application is very low.
In one embodiment, for a plurality of container groups corresponding to the same service object, respectively acquiring resource usage information of a host on which the reported container group operates includes: and acquiring resource use information of the host machine operated by each container group forwarded by the controller aiming at a plurality of container groups corresponding to the same service object.
The resource use information forwarded by the controller is collected from the host machine and reported to the controller by a first process running in the host machine.
The controller is a model for controlling the resource to achieve the 'expected' transition state. The controller, which behaves as a state machine, controls the specific state and behavior of the group of containers.
Specifically, the host machine may collect resource usage information of the host machine through a first process running by the host machine, and report the resource usage information to the controller through the first process. The controller may forward the reported resource usage information to the load balancer.
For ease of understanding, reference is now made to the architecture diagram of FIG. 4. Referring to fig. 4, a container group 1 and a container group 2 are respectively run on a host 1 and a host 2. Agent daemon processes (namely, first processes) are respectively operated on the host machine 1 and the host machine 2 so as to collect respective resource utilization rates (namely, belonging to resource utilization information), and the collected resource utilization rates are reported to the controller, and the controller can inform the load balancer lb of the reported resource utilization rates. The load balancer runs a weight-setter (i.e., a second process) and a load balancing program (e.g., Linux IPVS, i.e., a load balancing software program carried by the Linux system). The load balancer can determine the load balancing weight of the container group running in each host machine according to the reported resource utilization rate of the host machine through the weight setting process, and revise the original load balancing weight of each container group recorded in the load balancing program into the determined load balancing weight through the weight setting process. Subsequently, after the service object receives the access request, the load balancer may distribute the access request for the service object to the service object according to the modified load balancing weight of each container group corresponding to the service object.
In the above embodiment, the host reports the resource usage information of the host to the controller through the first process, and then the controller forwards the resource usage information to the load balancer, so that the report of the resource usage information of the host can be realized under the original framework only by adding the first process, which is very convenient and fast, and avoids unnecessary cost caused by excessive changes.
In one embodiment, the step 204 of determining load balancing weights for the group of containers running in the hosts according to the resource usage information of each of the hosts comprises: determining load balancing weights of container groups running in the host machine according to the resource use information of the host machine through a second process running in a load balancer; and modifying the original load balancing weight of the container group recorded in a load balancing program running in a load balancer into the determined load balancing weight through the second process.
The second process is a process which runs in the load balancer and is used for setting the load balancing weight. Which may be referred to as a weight setting process. The load balancing program is a software program that runs in the load balancer and records load balancing weights of the respective container groups. It is to be understood that the load balancing program may implement the load balancing distribution process according to the recorded load balancing weights.
Specifically, the load balancer may determine, through the second process running on the load balancer, the load balancing weight of the container group running in the host according to the reported resource usage information of the host. The load balancer can modify the original load balancing weight of the container group running in the load balancing program of the load balancer into 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. Thus, the load balancing program records the dynamically modified load balancing weight. 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.
In the above embodiment, by setting the second process in the load balancer, the load balancing weight of the container group in the host machine can be dynamically determined and modified according to the resource usage information of the host machine, which is very convenient and fast, and avoids changing the original frame, thereby avoiding cost waste.
In one embodiment, the step 204 of determining load balancing weights for the group of containers running in the hosts according to the resource usage information of each of the hosts comprises: and for each host machine, determining load balancing weight of the container group running in the host machine according to the resource use information of the host machine and the total resource use information corresponding to the service object.
The total resource usage information is the sum of the resource usage information of the hosts on which the container groups corresponding to the service objects operate.
Specifically, when the load balancer needs to determine the load balancing weight of each container group of the same service object, it may determine each host on which each container group corresponding to the service object operates, and obtain the total resource usage information corresponding to the service object according to the sum of the determined resource usage information of each host. For each host machine in which each container group corresponding to the service object operates, the load balancer may determine the load balancing weight of the container group operating 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.
For ease of understanding, reference is now made to fig. 3 for illustration. Assuming that load balancing distribution needs to be performed on the access request received by the service object a, load balancing weights of the container group 1 and the container group 2 corresponding to the service object a need to be determined. The load balancer can obtain the resource usage information of the host 1 operated by the container group 1 and the resource usage information of the host 2 operated by the container group 2. The load balancer may determine the total resource usage information corresponding to service object a (i.e., the sum of the resource usage information corresponding to host 1 and host 2). The load balancer may determine the load balancing weight corresponding to the container group 1 on the host 1 according to the resource usage information of the host 1 and the total resource usage information corresponding to the service object a. Similarly, the load balancer may determine the load balancing weight corresponding to the container group 2 on the host 2 according to the resource usage information of the host 2 and the total resource usage information corresponding to the service object a.
In an embodiment, for each of the hosts, the load balancer may determine, through the second process, a load balancing weight of a container group running in the host according to the resource usage information of the host and total resource usage information corresponding to the service object. Further, the original load balancing weight of the container group recorded in a load balancing program running in the load balancer is modified into the determined load balancing weight through the second process.
In the above embodiment, the load balancing weight of the container group running in the host can be accurately and conveniently determined according to 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.
In one embodiment, determining load balancing weights for a group of containers running in a host according to resource usage information of the host and total resource usage information corresponding to a service object comprises: when the resource use information comprises CPU use information and network bandwidth use information, determining a first occupation ratio corresponding to a host according to the CPU use information of the host; determining a second occupation ratio corresponding to the host according to the network bandwidth use information of the host; and determining the load balancing weight of the container group running in the host machine according to the first occupation ratio and the second occupation ratio.
The first percentage is a ratio of the CPU usage information of the host to the total CPU usage information corresponding to the service object. That is, the first occupation ratio is the CPU resource occupation ratio. The total CPU usage information is the sum of the CPU usage information of each host on which each container group corresponding to the service object operates.
The second percentage is a ratio of the network bandwidth usage information of the host to the total network bandwidth usage information corresponding to the service object. The second percentage is the network bandwidth percentage. The total network bandwidth usage information is the sum of the network bandwidth usage information of each host on which each container group corresponding to the service object operates.
It will be appreciated that the CPU usage information is used to characterize the amount of resources used by the CPU. Therefore, the CPU usage information may be the amount of used (i.e., occupied) CPU resources or the amount of free (i.e., surplus, unused) CPU resources. And the network bandwidth use information is used for representing the condition that the network bandwidth is used. Thus, the network bandwidth usage information may be the amount of network bandwidth that is used or the amount of network bandwidth that is idle.
In one embodiment, the data structure (i.e., the structure node _ cfg) of the resource usage information of the host may be as follows:
Figure BDA0002569068630000141
the structure body shows that, for a container group (pod) corresponding to a service object (service), surplus cpu hertz numbers and network bandwidth numbers of hosts (i.e., nodes) in which the container groups operate are obtained, and resource use information of the hosts is obtained.
In one embodiment, determining load balancing weights for the set of containers running in the host according to the first and second share ratios comprises: and when the CPU utilization information is the idle CPU resource amount and the network bandwidth utilization information is the idle network bandwidth amount, taking the minimum value of the first occupation ratio and the second occupation ratio to obtain the load balancing weight of the container group running in the host machine.
It will be appreciated that the load balancer may directly use the minimum as the load balancing weight for a group of containers running in the host. The minimum value may be further subjected to a numerical conversion process (e.g., linear conversion), so as to obtain a load balancing weight of the container group running in the host.
In the above embodiment, since the use condition of either the CPU or the network bandwidth affects the load condition of the host, the load balancing weight is determined by selecting the one with a smaller idle amount from the CPU idle condition and the network bandwidth idle condition, so that the accuracy can be improved.
In one embodiment, when only one container group is running in the host, the minimum value may be used as the load balancing weight of the container group. When there are multiple container groups in the host, the load balancing weight of each container group running in the host can be further determined according to the minimum value.
In one embodiment, minimizing the first and second occupancy rates to obtain load balancing weights for the set of containers operating in the host comprises: when a plurality of container groups run in the host machine, the first occupation ratio and the second occupation ratio are the minimum value; dividing the minimum value according to the number of container groups running in the host machine; and taking the divided numerical value as the load balancing weight of the container group running in the host machine.
It is understood that "a plurality" in the embodiments of the present application means at least two.
In one embodiment, the load balancer may determine the number of container groups running in the host, equally divide the minimum value according to the number of container groups running in the host, and use the divided value as the load balancing weight of each container group running in the host.
For example, for the structure node _ cfg of the resource usage information of each host, a ratio of the number of free CPU hertz (i.e., CPU _ hz, the amount of free CPU resources) in the structure node _ cfg to the total amount of free CPU resources (i.e., the sum of the amounts of free CPU resources node _ hz of each host) of all hosts corresponding to the service object (service) is calculated, so as to obtain a first occupation ratio CPU _ ratio. And then calculating the proportion of the idle network bandwidth amount (namely net _ pps) in the idle total network bandwidth amount (namely, the sum of the idle network bandwidth amounts noreet _ pps of all the hosts) corresponding to the service object (service) to obtain a second occupation ratio net _ ratio. And finally, after min (cpu _ ratio, net _ ratio), namely the first proportion and the second proportion, is taken as a minimum value, and the taken minimum value is taken as the load balancing weight of the container group (pod) on the host machine. If N container groups (pod) are on the same host (node), min (cpu _ ratio, net _ ratio)/N may be used as the load balancing weight of each container group on the host. That is, the minimum value is equally divided, and the divided value is used as the load balancing weight of each container group on the host.
In the above embodiment, when a plurality of container groups are operated in the host, the minimum value is divided according to the number of the container groups operated in the host; the divided numerical values are used as load balancing weights of the container groups running in the host machine, each container group in the same host machine can be considered, and the accuracy of the load balancing weights of the container groups is improved.
In one embodiment, determining load balancing weights for the set of containers running in the host according to the first and second share ratios comprises: and when the CPU utilization information is the occupied CPU resource amount and the network bandwidth utilization information is the occupied network bandwidth amount, taking the maximum value of the first occupation ratio and the second occupation ratio, and determining the load balancing weight of the container group running in the host machine according to the taken maximum value. And the size of the load balancing weight of the container group is inversely related to the size of the maximum value. That is, the larger the maximum value taken, the larger the amount of occupied resources, the smaller the load balancing weight. The smaller the maximum value taken is, the smaller the occupied resource amount is, and the larger the load balancing weight is.
In other embodiments, the load balancer can also combine (e.g., linearly calculate) the first and second ratios to determine a new value as a load balancing weight for the container group running in the host.
In the above embodiment, the CPU usage information and the network bandwidth usage information can more accurately reflect the load condition of the host, so that the load balancing weight of the container group running in the host can be accurately determined according to the CPU usage percentage (i.e., the first percentage) and the network bandwidth usage percentage (i.e., the second percentage) of the host. Thereby improving the accuracy of subsequent load balancing distribution.
As shown in fig. 5, in an embodiment, a load balancing distribution method is provided, which is exemplified by applying the method to the host 150 in fig. 1. The method comprises the following steps:
step 502, the host machine collects the resource use information of the host machine according to the running first process.
Step 504, reporting resource usage information to a load balancer; and the resource use information is used for indicating the load balancer to determine the load balancing weight of the container group running on the host machine according to the resource use information.
Step 506, receiving, by the container group running on the host, an access request which is distributed by the load balancer according to the load balancing weight and is directed to the service object corresponding to the container group running on the host.
In one embodiment, the first process is a native process running in the home end of the host and used to collect resource usage information of the host. In other embodiments, the first process may also be a newly added non-native process.
In one embodiment, the resource usage information is used to instruct the load balancer to determine, through the second process, load balancing weights of the container group running on the host according to the resource usage information, and modify original load balancing weights of the container group running in a load balancing program of the load balancer into the determined load balancing weights. The second process is a process which is responsible for running in the balancer and is used for determining and modifying the load balancing weight.
In the above embodiment, the resource usage information of the host is collected and reported by running the first process in the host, and the resource usage information of the host can accurately represent the real load condition of the host, so that the load balancing weight of the volume group can be more accurately and dynamically determined according to the resource usage information of the host, and thus the received access request can be more accurately distributed in a load balancing manner.
As shown in fig. 6, in one embodiment, a resource balancing distribution system 600 is provided, the system 600 includes a host 602, a container group 604 running in the host 602, and a load balancer 606; wherein:
the host 602 is configured to collect resource usage information of the host according to a first process, and report the resource usage information to the load balancer 606.
The load balancer 606 is configured to determine, for multiple container groups 604 corresponding to the same service object, load balancing weights of container groups 604 running in the host 602 according to resource usage information of the host 602 in which each container group 604 runs; the resource usage information is associated with the load balancing weights.
The load balancer 606 is further configured to distribute, according to the load balancing weight, the access request for the service object to the container group 602 corresponding to the service object.
As shown in fig. 7, in one embodiment, the system further includes a controller 605.
The host 604 is further configured to collect resource usage information of the host according to the first process, and report the resource usage information to the controller 605.
The controller 605 is also configured to forward the resource usage information to the load balancer.
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;
the load balancer 606 is further configured to determine, by the second process, load balancing weights of container groups running in a host according to resource usage information of the host in which each of the container groups runs, for a plurality of container groups corresponding to the same service object; and modifying the original load balancing weight recorded in the load balancing program into the determined load balancing weight through the second process.
In one embodiment, the load balancer 606 is further configured to determine, for each of the hosts, a load balancing weight of a container group running in the host according to the resource usage information of the host and total resource usage information corresponding to the service object; the total resource usage information is the sum of the resource usage information of the hosts on which the container groups corresponding to the service objects operate.
In one embodiment, the load balancer 606 is further configured to determine, when the resource usage information includes CPU usage information and network bandwidth usage information, a first percentage corresponding to the host according to the CPU usage information of the host; the first occupation ratio is a ratio of the CPU usage information of the host 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 operate; determining a second occupation ratio corresponding to the host according to the network bandwidth use information of the host; the second occupation ratio is a ratio of the network bandwidth usage information of the host to the total network bandwidth usage information corresponding to the service object; the total network bandwidth usage information is a sum of network bandwidth usage information of hosts on which each container group corresponding to the service object operates; and determining the load balancing weight of the container group running in the host machine according to the first occupation ratio and the second occupation ratio.
In one embodiment, the load balancer 606 is further configured to take the minimum value of the first occupation ratio and the second occupation ratio to obtain a load balancing weight of the container group running in the host when the CPU usage information is an idle CPU resource amount and the network bandwidth usage information is an idle network bandwidth amount.
In one embodiment, the load balancer 606 is further configured to, when a plurality of container groups are running in the host, divide the minimum value of the first proportion and the second proportion by the number of container groups running in the host; and taking the divided numerical value as the load balancing weight of each container group running in the host machine.
Fig. 8 is a timing diagram of a load balancing distribution method in one embodiment. The method specifically comprises the following steps:
(1) and the host machine reports the idle CPU resource quantity and the idle network bandwidth quantity of the host machine to the controller through the agent daemon process.
(2) And the controller informs the load balancer of the reported idle CPU resource amount and the idle network bandwidth amount.
(3) For a plurality of container groups corresponding to the same service object, the load balancer can obtain the idle CPU resource amount and the idle network bandwidth amount of the host machine in which each container group operates according to the reporting condition.
(4) For each host machine, the load balancer can obtain a first occupation ratio corresponding to the host machine according to the ratio of the idle CPU resource amount of the host machine to the idle CPU total resource amount corresponding to the service object through a weight setting process.
(5) The load balancer can obtain a second occupation ratio corresponding to the host according to the ratio of the idle network bandwidth usage information of the host to the total amount of the idle network bandwidth corresponding to the service object through a weight setting process.
(6) When only one container group is operated in the host machine, the load balancer can take the minimum value of the first occupation ratio and the second occupation ratio to obtain the load balancing weight of the container group.
(7) When a plurality of container groups are operated in the host, the load balancer may divide the minimum value of the first proportion and the second proportion according to the number of the container groups operated in the host, to obtain the load balancing weight of each container group.
(8) The load balancer may assign an 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.
As shown in fig. 9, in one embodiment, a load balancing distribution apparatus is provided and disposed in a load balancer. The device includes: an acquisition module 902, a weight determination module 904, and a request assignment module 906; wherein:
an obtaining module 902, configured to obtain, for multiple container groups corresponding to a same service object, resource usage information of a host on which the reported container groups operate; the resource use information is collected and reported from the host machine by a first process running in the host machine.
A weight determining module 904, configured to determine load balancing weights of container groups running in the hosts according to the resource usage information of each host; the resource usage information is associated with the load balancing weights.
A request allocating module 906, configured to allocate, according to the load balancing weight, an access request for the service object to a container group corresponding to the service object.
In one embodiment, the obtaining module 902 is further configured to obtain, for a plurality of container groups corresponding to the same service object, resource usage information of a host that is forwarded by the controller and in which each of the container groups operates.
In one embodiment, the weight determining module 904 is further configured to determine, by a second process running on a load balancer, load balancing weights for a group of containers running on the host according to the resource usage information of the host; and modifying the original load balancing weight of the container group recorded in a load balancing program running in a load balancer into the determined load balancing weight through the second process.
In one embodiment, the weight determining module 904 is further configured to determine, for each of the hosts, a load balancing weight of a container group running in the host according to the resource usage information of the host and total resource usage information corresponding to the service object; the total resource usage information is the sum of the resource usage information of the hosts on which the container groups corresponding to the service objects operate.
In one embodiment, the weight determining module 904 is further configured to determine, when the resource usage information includes CPU usage information and network bandwidth usage information, a first occupation ratio corresponding to the host according to the CPU usage information of the host; the first occupation ratio is a ratio of the CPU usage information of the host 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 operate; determining a second occupation ratio corresponding to the host according to the network bandwidth use information of the host; the second occupation ratio is a ratio of the network bandwidth usage information of the host to the total network bandwidth usage information corresponding to the service object; the total network bandwidth usage information is a sum of network bandwidth usage information of hosts on which each container group corresponding to the service object operates; and determining the load balancing weight of the container group running in the host machine according to the first occupation ratio and the second occupation ratio.
In an embodiment, the weight determining module 904 is further configured to, when the CPU usage information is an idle CPU resource amount and the network bandwidth usage information is an idle network bandwidth amount, take a minimum value for the first occupation ratio and the second occupation ratio to obtain a load balancing weight of a container group running in the host.
In one embodiment, the weight determining module 904 is further configured to, when a plurality of container groups run in the host, divide the minimum value of the first proportion and the second proportion by the number of container groups running in the host; and taking the divided numerical value as the load balancing weight of each container group running in the host machine.
As shown in fig. 10, in an embodiment, a load balancing distribution apparatus is provided, for example, for being disposed in a host, and the load balancing distribution apparatus includes an acquisition module 1002, a reporting module 1004, and a request receiving module 1006; wherein:
the collection module 1002 is configured to collect resource usage information of the host according to the running first process.
A reporting module 1004, configured to report the resource usage information to a load balancer; the resource usage information is used for indicating the load balancer to determine the load balancing weight of the container group running on the host machine according to the resource usage information.
A request receiving module 1006, configured to receive, through a container group running on a host, an access request that is distributed by the load balancer according to the load balancing weight and is addressed to a service object corresponding to the container group running on the host.
For specific limitations of the load balancing and distributing apparatus, reference may be made to the above limitations of the load balancing and distributing method, which is not described herein again. The modules in the load balancing and distributing device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a load balancer or a host machine, and its internal structure diagram may be as shown in fig. 11. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile 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 an operating system and computer programs 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 for communicating with an external computer device through a network connection. The computer program is executed by a processor to implement a load balancing distribution method. It can be understood that the server implements the background processing steps in the load balancing and distributing method.
Those skilled in the art will appreciate that the architecture shown in fig. 11 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps in the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (15)

1. A method for load balancing distribution, performed by a load balancer, the method comprising:
respectively acquiring reported resource use information of a host machine in which the container group operates aiming at a plurality of container groups corresponding to the same service object; the resource use information is collected and reported from the host machine by a first process running in the host machine;
determining load balancing weights of container groups running in the hosts according to the resource use information of each host; the resource usage information is related to the load balancing weight;
and distributing the access request aiming at the service object to the container group corresponding to the service object according to the load balancing weight.
2. The method according to claim 1, wherein the obtaining reported resource usage information of the host on which the container group operates for a plurality of container groups corresponding to the same service object respectively comprises:
the method comprises the steps of acquiring resource use information of a host machine in which a container group operates and forwarded by a controller aiming at a plurality of container groups corresponding to the same service object.
3. The method of claim 1, wherein determining load balancing weights for a group of containers running in the hosts according to the resource usage information of each host comprises:
determining load balancing weights of container groups running in the host machine according to the resource use information of the host machine through a second process running in the load balancer;
and modifying the original load balancing weight of the container group recorded in a load balancing program running in a load balancer into the determined load balancing weight through the second process.
4. The method according to any of claims 1 to 3, wherein the determining load balancing weights for the group of containers running in the hosts according to the resource usage information of each host comprises:
for each host machine, determining load balancing weight of a container group running in the host machine according to the resource use information of the host machine and total resource use information corresponding to the service object;
the total resource usage information is the sum of the resource usage information of the hosts on which the container groups corresponding to the service objects operate.
5. The method of claim 4, wherein determining load balancing weights for the set of containers running in the host according to the resource usage information of the host and the total resource usage information corresponding to the service object comprises:
when the resource usage information includes CPU usage information and network bandwidth usage information,
determining a first occupation ratio corresponding to the host according to the CPU usage information of the host; the first occupation ratio is a ratio of the CPU usage information of the host 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 operate;
determining a second occupation ratio corresponding to the host according to the network bandwidth use information of the host; the second occupation ratio is a ratio of the network bandwidth usage information of the host to the total network bandwidth usage information corresponding to the service object; the total network bandwidth usage information is a sum of network bandwidth usage information of hosts on which each container group corresponding to the service object operates;
and determining the load balancing weight of the container group running in the host machine according to the first occupation ratio and the second occupation ratio.
6. The method of claim 5, wherein determining load balancing weights for the group of containers operating in the host according to the first and second fractions comprises:
and when the CPU usage information is the idle CPU resource amount and the network bandwidth usage information is the idle network bandwidth amount, taking the minimum value of the first occupation ratio and the second occupation ratio to obtain the load balancing weight of the container group running in the host machine.
7. The method of claim 6, wherein minimizing the first and second fractions to obtain a load balancing weight for the group of containers operating in the host comprises:
when a plurality of container groups run in the host machine, dividing the minimum value of the first proportion and the second proportion according to the number of the container groups running in the host machine;
and taking the divided numerical value as the load balancing weight of each container group running in the host machine.
8. A method for load balancing distribution, the method comprising:
the host machine acquires resource use information of the host machine according to a running first process;
reporting the resource use information to a load balancer; the resource use information is used for indicating the load balancer to determine the load balancing weight of the container group running on the host machine according to the resource use information;
and receiving an access request which is distributed by the load balancer according to the load balancing weight and is directed to a service object corresponding to the container group running on the host machine through the container group running on the host machine.
9. A resource balanced distribution system is characterized by comprising a host machine, a container group running in the host machine and a load balancer;
the host machine is used for acquiring resource use information of the host machine according to a first process and reporting the resource use information to the load balancer;
the load balancer is used for determining load balancing weight of a container group running in a host according to resource use information of the host in which the container group runs aiming at a plurality of container groups corresponding to the same service object; the resource usage information is related to the load balancing weight;
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.
10. The system of claim 9, further comprising a controller;
the host machine is also used for collecting the resource use information of the host machine according to the first process and reporting the resource use information to the controller;
the controller is further configured to forward the resource usage information to the load balancer.
11. The system of claim 10, wherein a second process and a load balancing program are running in the load balancer; the load balancing program records the original load balancing weight of the container group;
the load balancer is further configured to determine, by the second process, load balancing weights of container groups running in a host according to resource usage information of the host in which the container groups run, for a plurality of container groups corresponding to the same service object; and modifying the original load balancing weight recorded in the load balancing program into the determined load balancing weight through the second process.
12. A load balancing apparatus provided in a load balancer, the apparatus comprising:
an obtaining module, configured to obtain, for multiple container groups corresponding to a same service object, reported resource usage information of a host in which the container groups operate; the resource use information is collected and reported from the host machine by a first process running in the host machine;
a weight determining module, configured to determine load balancing weights of container groups running in the hosts according to the resource usage information of each host; the resource usage information is related to the load balancing weight;
and the request distribution module is used for distributing the access request aiming at the service object to the container group corresponding to the service object according to the load balancing weight.
13. A load balancing and distributing apparatus, provided in a host, the apparatus comprising:
the acquisition module is used for acquiring the resource use information of the host machine according to the running first process;
a reporting module, configured to report the resource usage information to a load balancer; the resource use information is used for indicating the load balancer to determine the load balancing weight of the container group running on the host machine according to the resource use information;
and the request receiving module is used for receiving an access request which is distributed by the load balancer according to the load balancing weight and aims at a service object corresponding to the container group running on the host machine through the container group running on the host machine.
14. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 8.
15. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 8.
CN202010631600.3A 2020-07-03 2020-07-03 Load balancing distribution method and device, computer equipment and storage medium Pending CN111666131A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010631600.3A CN111666131A (en) 2020-07-03 2020-07-03 Load balancing distribution method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010631600.3A CN111666131A (en) 2020-07-03 2020-07-03 Load balancing distribution method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111666131A true CN111666131A (en) 2020-09-15

Family

ID=72390959

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010631600.3A Pending CN111666131A (en) 2020-07-03 2020-07-03 Load balancing distribution method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111666131A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112202860A (en) * 2020-09-22 2021-01-08 广州品唯软件有限公司 Container flow adjusting method, device and system
CN113504996A (en) * 2021-07-28 2021-10-15 中国工商银行股份有限公司 Load balance detection method, device, equipment and storage medium
CN114116774A (en) * 2022-01-28 2022-03-01 北京安帝科技有限公司 Log data query method and device
CN114374696A (en) * 2021-12-15 2022-04-19 深圳前海微众银行股份有限公司 Container load balancing method, device, equipment and storage medium
CN114520809A (en) * 2022-03-04 2022-05-20 浪潮云信息技术股份公司 Method and device for realizing load balancing of back-end request
CN116204286A (en) * 2022-12-21 2023-06-02 山东未来网络研究院(紫金山实验室工业互联网创新应用基地) Kubernetes scheduling method supporting topology awareness

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112202860A (en) * 2020-09-22 2021-01-08 广州品唯软件有限公司 Container flow adjusting method, device and system
CN112202860B (en) * 2020-09-22 2023-07-14 广州品唯软件有限公司 Container flow adjustment method, device and system
CN113504996A (en) * 2021-07-28 2021-10-15 中国工商银行股份有限公司 Load balance detection method, device, equipment and storage medium
CN113504996B (en) * 2021-07-28 2024-03-08 中国工商银行股份有限公司 Load balancing detection method, device, equipment and storage medium
CN114374696A (en) * 2021-12-15 2022-04-19 深圳前海微众银行股份有限公司 Container load balancing method, device, equipment and storage medium
CN114116774A (en) * 2022-01-28 2022-03-01 北京安帝科技有限公司 Log data query method and device
CN114116774B (en) * 2022-01-28 2022-06-28 北京安帝科技有限公司 Log data query method and device
CN114520809A (en) * 2022-03-04 2022-05-20 浪潮云信息技术股份公司 Method and device for realizing load balancing of back-end request
CN116204286A (en) * 2022-12-21 2023-06-02 山东未来网络研究院(紫金山实验室工业互联网创新应用基地) Kubernetes scheduling method supporting topology awareness
CN116204286B (en) * 2022-12-21 2023-12-12 山东未来网络研究院(紫金山实验室工业互联网创新应用基地) Kubernetes scheduling method supporting topology awareness

Similar Documents

Publication Publication Date Title
CN111666131A (en) Load balancing distribution method and device, computer equipment and storage medium
US10884812B2 (en) Performance-based hardware emulation in an on-demand network code execution system
US11010188B1 (en) Simulated data object storage using on-demand computation of data objects
Piao et al. A network-aware virtual machine placement and migration approach in cloud computing
US9830449B1 (en) Execution locations for request-driven code
US11231955B1 (en) Dynamically reallocating memory in an on-demand code execution system
US11526434B1 (en) Network-level garbage collection in an on-demand code execution system
CN107040479B (en) Method and device for adjusting cloud computing resources
Téllez et al. A tabu search method for load balancing in fog computing
CN108900626B (en) Data storage method, device and system in cloud environment
CN108279974B (en) Cloud resource allocation method and device
US11496413B2 (en) Allocating cloud computing resources in a cloud computing environment based on user predictability
CN107291536B (en) Application task flow scheduling method in cloud computing environment
CN109710406B (en) Data distribution and model training method and device thereof, and computing cluster
US10824339B1 (en) Snapshot-based garbage collection in an on-demand code execution system
CN111092921A (en) Data acquisition method, device and storage medium
CN111131486A (en) Load adjustment method and device of execution node, server and storage medium
US11144359B1 (en) Managing sandbox reuse in an on-demand code execution system
Shalu et al. Artificial neural network-based virtual machine allocation in cloud computing
CN111338750A (en) Pressure adjusting method and device for execution node, server and storage medium
US10990519B2 (en) Multi-tenant cloud elastic garbage collector
CN112948113A (en) Cluster resource management scheduling method, device, equipment and readable storage medium
Sachdeva et al. A novel approach in cloud computing for load balancing using composite algorithms
CN109005071B (en) Decision deployment method and scheduling equipment
WO2018170732A1 (en) Method and device for service deployment under edge cloud architecture

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40028556

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination