CN114928615B - Load balancing method, device, equipment and readable storage medium - Google Patents
Load balancing method, device, equipment and readable storage medium Download PDFInfo
- Publication number
- CN114928615B CN114928615B CN202210555137.8A CN202210555137A CN114928615B CN 114928615 B CN114928615 B CN 114928615B CN 202210555137 A CN202210555137 A CN 202210555137A CN 114928615 B CN114928615 B CN 114928615B
- Authority
- CN
- China
- Prior art keywords
- load balancing
- host
- load
- load balancer
- balancing system
- 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.)
- Expired - Fee Related
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1031—Controlling of the operation of servers by a load balancer, e.g. adding or removing servers that serve requests
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
技术领域Technical field
本申请涉及负载均衡技术领域,特别涉及一种负载均衡方法、装置、设备及可读存储介质。This application relates to the field of load balancing technology, and in particular to a load balancing method, device, equipment and readable storage medium.
背景技术Background technique
随着云技术的发展,服务器面对的访问数量快速增加,服务器需要具备处理大规模并发服务访问的能力。对于大负载的服务器而言,CPU、I/O处理能力很快成为瓶颈,而单台服务器的性能总是有限的,简单的提高硬件性能并不能真正解决问题。因此,必须采用多服务器和负载均衡(Load Balance,LB)技术才能满足大规模并发服务访问的需要。With the development of cloud technology, the number of accesses faced by servers is increasing rapidly, and servers need to be able to handle large-scale concurrent service accesses. For servers with heavy loads, CPU and I/O processing capabilities quickly become bottlenecks, and the performance of a single server is always limited. Simply improving hardware performance cannot really solve the problem. Therefore, multi-server and load balancing (Load Balance, LB) technology must be used to meet the needs of large-scale concurrent service access.
负载均衡是指:利用负载均衡器将大量的并发访问或数据流量分担到多台真实服务器上,由真实服务器进行处理,减少用户等待响应的时间。在云平台中,负载均衡器通常采用Linux虚拟服务器(Linux Virtual Server,LVS)架构,由前端的负载均衡器(LoadBalancer,LB)和后台真实服务器(Real Server,RS)群组成。LB接收到来自客户端的业务请求后,根据预设的调度转发策略及负载均衡调度算法将业务请求调度转发给RS,RS处理业务请求并返回应答结果。然而,LVS负载均衡技术存在性能开销大、LB容易受负载突增的影响的弊端。Load balancing refers to using a load balancer to distribute a large amount of concurrent access or data traffic to multiple real servers, which are processed by the real servers to reduce the time users wait for responses. In cloud platforms, load balancers usually adopt the Linux Virtual Server (LVS) architecture, which is composed of a front-end load balancer (LoadBalancer, LB) and a backend real server (Real Server, RS) group. After receiving the service request from the client, LB schedules and forwards the service request to RS according to the preset scheduling forwarding policy and load balancing scheduling algorithm. RS processes the service request and returns the response result. However, LVS load balancing technology has the disadvantages of high performance overhead and LB is easily affected by load sudden increases.
为克服LVS负载均衡技术的问题,业界引入快速数据路径(eXpress Data Path,XDP)的负载均衡架构。然而,基于XDP架构,当在集群中新增主机时,集群内正在进行的业务的连接会异常断开,且该异常与新增主机的数量成正比,导致正在进行的业务异常。In order to overcome the problems of LVS load balancing technology, the industry introduced the load balancing architecture of eXpress Data Path (XDP). However, based on the XDP architecture, when a new host is added to the cluster, the connection of the ongoing business in the cluster will be abnormally disconnected, and the abnormality is proportional to the number of new hosts, causing the ongoing business to be abnormal.
发明内容Contents of the invention
本申请提供一种负载均衡方法、装置、设备及可读存储介质,通过对负载均衡器进行改进,以解决基于XDP的架构新增主机时对已有业务的影响,实现提高业务可靠性的目的。This application provides a load balancing method, device, equipment and readable storage medium. By improving the load balancer, it solves the impact on existing businesses when new hosts are added to the XDP-based architecture and achieves the purpose of improving business reliability. .
第一方面,本申请实施例提供一种负载均衡方法,应用于负载均衡系统中的主机上的负载均衡器,所述方法包括:In a first aspect, embodiments of the present application provide a load balancing method, which is applied to a load balancer on a host in a load balancing system. The method includes:
确定负载均衡系统中存在新增主机,所述负载均衡器是所述负载均衡系统包含的多个主机中的任意一个主机上的负载均衡器,所述多个主机中的每个主机上均部署负载均衡器和真实服务器RS;Determine that there is a new host in the load balancing system, the load balancer is a load balancer on any one of the multiple hosts included in the load balancing system, and the load balancer is deployed on each of the multiple hosts. Load balancer and real server RS;
接收数据包;receive data packet;
从所述负载均衡系统包含的各主机的RS中确定出生效RS,所述生效RS是新增主机之前所述负载均衡器对已有业务的数据包进行负载均衡时涉及的RS,所述已有业务是新增主机之前所述负载均衡系统正在提供给用户的业务;The effective RS is determined from the RS of each host included in the load balancing system. The effective RS is the RS involved when the load balancer performs load balancing on the data packets of existing services before adding a host. There are services that the load balancing system is providing to users before the new host is added;
从所述生效RS中确定出目标RS;Determine a target RS from the effective RS;
向所述目标RS发送所述数据包。Send the data packet to the target RS.
第二方面,本申请实施例提供一种负载均衡方法,应用于负载均衡系统中的查询设备,所述方法包括:In the second aspect, embodiments of the present application provide a load balancing method, which is applied to query devices in the load balancing system. The method includes:
接收所述负载均衡系统中新增主机上的RS发送的通告请求,所述通告请求用于指示所述RS的虚拟IP地址VIP;Receive a notification request sent by the RS on the newly added host in the load balancing system, where the notification request is used to indicate the virtual IP address VIP of the RS;
记录所述VIP以及通告时间点,所述通告时间点是所述查询设备接收到所述通告请求的时间点,所述VIP和所述通告时间点用于确定所述新增主机上的RS是否转变为生效RS,所述负载均衡系统中的生效RS是所述负载均衡系统中的负载均衡器对已有业务的数据包进行负载均衡时涉及的RS,所述已有业务是新增主机之前所述负载均衡系统正在提供给用户的业务。Record the VIP and the notification time point. The notification time point is the time point when the query device receives the notification request. The VIP and the notification time point are used to determine whether the RS on the newly added host is Convert to effective RS. The effective RS in the load balancing system is the RS involved when the load balancer in the load balancing system load balances the data packets of existing services. The existing services are before the new host is added. The load balancing system is providing services to users.
第三方面,本申请实施例提供一种负载均衡装置,集成在负载均衡系统中的主机上的负载均衡器,所述装置包括:In a third aspect, embodiments of the present application provide a load balancing device, a load balancer integrated on a host in a load balancing system, and the device includes:
确定模块,用于确定负载均衡系统中存在新增主机,所述负载均衡器是所述负载均衡系统包含的多个主机中的任意一个主机上的负载均衡器,所述多个主机中的每个主机上均部署负载均衡器和真实服务器RS;Determining module, used to determine that there is a new host in the load balancing system, the load balancer is a load balancer on any one of the multiple hosts included in the load balancing system, each of the multiple hosts Deploy load balancer and real server RS on each host;
接收模块,用于接收数据包;Receiving module, used to receive data packets;
处理模块,用于从所述负载均衡系统包含的各主机的RS中确定出生效RS,所述生效RS是新增主机之前所述负载均衡器对已有业务的数据包进行负载均衡时涉及的RS,所述已有业务是新增主机之前所述负载均衡系统正在提供给用户的业务,从所述生效RS中确定出目标RS;A processing module configured to determine the effective RS from the RS of each host included in the load balancing system. The effective RS is involved when the load balancer performs load balancing on data packets of existing services before adding a host. RS, the existing service is the service that the load balancing system is providing to the user before the new host is added, and the target RS is determined from the effective RS;
发送模块,用于向所述目标RS发送所述数据包。A sending module, configured to send the data packet to the target RS.
第四方面,本申请实施例提供一种负载均衡装置,集成在负载均衡系统中的查询设备上,所述装置包括:In the fourth aspect, embodiments of the present application provide a load balancing device integrated on a query device in a load balancing system. The device includes:
收发模块,用于接收所述负载均衡系统中新增主机上的RS发送的通告请求,所述通告请求用于指示所述RS的虚拟IP地址VIP;A transceiver module, configured to receive a notification request sent by the RS on the newly added host in the load balancing system, where the notification request is used to indicate the virtual IP address VIP of the RS;
处理模块,用于记录所述VIP以及通告时间点,所述通告时间点是所述查询设备接收到所述通告请求的时间点,所述负载均衡系统中的生效RS是所述新增主机之前,所述负载均衡系统中的负载均衡器对已有业务的数据包进行负载均衡时涉及的RS,所述已有业务是新增主机之前所述负载均衡系统正在提供给用户的业务。A processing module configured to record the VIP and notification time point. The notification time point is the time point when the query device receives the notification request. The effective RS in the load balancing system is before the new host is added. , the RS involved when the load balancer in the load balancing system performs load balancing on the data packets of existing services. The existing services are the services that the load balancing system is providing to users before the new host is added.
第五方面,本申请实施例提供一种电子设备,包括:处理器、存储器及存储在所述存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时使得所述电子设备实现如上第一方面或第一方面各种可能的实现方式所述的方法。In a fifth aspect, embodiments of the present application provide an electronic device, including: a processor, a memory, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the The electronic device implements the method described in the above first aspect or various possible implementations of the first aspect.
第六方面,本申请实施例提供一种电子设备,包括:处理器、存储器及存储在所述存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时使得所述电子设备实现如上第二方面或第二方面各种可能的实现方式所述的方法。In a sixth aspect, embodiments of the present application provide an electronic device, including: a processor, a memory, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the The electronic device implements the method described in the above second aspect or various possible implementations of the second aspect.
第七方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机指令,所述计算机指令在被处理器执行时用于实现如上第一方面或第一方面各种可能的实现方式所述的方法。In a seventh aspect, embodiments of the present application provide a computer-readable storage medium. Computer instructions are stored in the computer-readable storage medium. When executed by a processor, the computer instructions are used to implement the above first aspect or the first aspect. various possible implementations.
第八方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机指令,所述计算机指令在被处理器执行时用于实现如上第二方面或第二方面各种可能的实现方式所述的方法。In an eighth aspect, embodiments of the present application provide a computer-readable storage medium. The computer-readable storage medium stores computer instructions. When executed by a processor, the computer instructions are used to implement the above second aspect or the second aspect. various possible implementations.
第九方面,本申请实施例提供一种负载均衡系统,包括交换机、多个主机和查询设备,所述交换机与所述多个主机中的各主机建立网络连接,所述查询设备与所述多个主机中的各主机建立网络连接,其中:In a ninth aspect, embodiments of the present application provide a load balancing system, including a switch, multiple hosts, and a query device. The switch establishes a network connection with each of the multiple hosts, and the query device communicates with the multiple hosts. Each of the hosts establishes a network connection, where:
所述交换机,用于执行负载均衡以从所述多个主机包含的负载均衡器中确定出目标负载均衡器并发送数据包;The switch is configured to perform load balancing to determine a target load balancer from the load balancers included in the plurality of hosts and send data packets;
所述多个主机中的每个主机上均部署负载均衡器和真实服务器RS,所述负载均衡器用于执行如上第一方面或第一方面的各种可能的实现方式所述的负载均衡方法。A load balancer and a real server RS are deployed on each of the plurality of hosts, and the load balancer is used to perform the load balancing method described in the above first aspect or various possible implementations of the first aspect.
所述查询设备用于执行如上第二方面或第二方面的各种可能的实现方式所述的负载均衡方法。The query device is configured to perform the load balancing method described in the above second aspect or various possible implementations of the second aspect.
本申请实施例提供的负载均衡方法,负载均衡系统中的各主机上的负载均衡器检测出负载均衡系统中新增主机时,一旦一个负载均衡器接收到数据包,倘若映射表中不存在该数据包的五元组,则从负载均衡系统包含的各主机的RS中确定出用于负载均衡的生效RS,从生效RS中选择出目标RS并将数据包发送给目标RS,从而完成第二次负载均衡。采用该种方案,每次新增主机后,负载均衡器从已生效的RS中确定出目标RS并发送数据包,确保新增主机上的负载均衡器的有充足的时间针对已有业务生成映射表,映射表中记录已有业务的五元组和RS的映射关系,避免负载均衡器将已有业务的数据包发送给不正确的RS。也就是说,每次新增主机后,该主机上的负载均衡器生效但是RS并不立即参与负载均衡,而是待新增主机上的负载均衡器的映射表中保存所有已有业务的五元组和RS的映射关系后,才将新增主机上的RS用于负载均衡,确保新增主机后已有业务的数据包发送给正确的RS,实现提高业务质量的目的的同时,无需改动交换机,减少影响面和操作复杂度。In the load balancing method provided by the embodiment of this application, when the load balancer on each host in the load balancing system detects a new host in the load balancing system, once a load balancer receives a data packet, if the load balancer does not exist in the mapping table For the five-tuple of the data packet, the effective RS for load balancing is determined from the RS of each host included in the load balancing system, the target RS is selected from the effective RS and the data packet is sent to the target RS, thereby completing the second step. Secondary load balancing. Using this solution, each time a new host is added, the load balancer determines the target RS from the effective RS and sends a data packet to ensure that the load balancer on the new host has sufficient time to generate mappings for existing services. Table, the mapping table records the mapping relationship between the quintuple of the existing business and the RS to prevent the load balancer from sending the data packets of the existing business to the incorrect RS. That is to say, every time a new host is added, the load balancer on the host takes effect but the RS does not immediately participate in load balancing. Instead, the mapping table of the load balancer on the newly added host saves all five existing services. After the mapping relationship between tuples and RSs is established, the RS on the newly added host will be used for load balancing to ensure that the data packets of existing services after the new host are added are sent to the correct RS, thereby improving service quality without any changes. switch to reduce the impact and operational complexity.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without exerting creative efforts.
图1是本申请实施例提供的负载均衡方法所适用的负载均衡系统的架构示意图;Figure 1 is a schematic architectural diagram of a load balancing system to which the load balancing method provided by the embodiment of the present application is applicable;
图2是本申请实施例提供的基于XDP的负载均衡架构在主机上的工作层级示意图;Figure 2 is a schematic diagram of the working level of the XDP-based load balancing architecture on the host provided by the embodiment of this application;
图3是本申请实施例提供的负载均衡方法的流程图;Figure 3 is a flow chart of the load balancing method provided by the embodiment of the present application;
图4是本申请实施例提供的负载均衡方法的另一个流程图;Figure 4 is another flow chart of the load balancing method provided by the embodiment of the present application;
图5是本申请实施例提供的负载均衡方法的应用场景示意图;Figure 5 is a schematic diagram of the application scenario of the load balancing method provided by the embodiment of the present application;
图6为本申请实施例提供的一种负载均衡装置的示意图;Figure 6 is a schematic diagram of a load balancing device provided by an embodiment of the present application;
图7为本申请实施例提供的另一种负载均衡装置的示意图;Figure 7 is a schematic diagram of another load balancing device provided by an embodiment of the present application;
图8为本申请实施例提供的一种电子设备的结构示意图Figure 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
随着集群技术的发展,负载均衡作为集群技术的核心也得到广泛关注研究。负载均衡保证后端服务器的负载相当的同时,还需要保证将属于同一个连接的数据包被发送到同一个后端服务器。属于同一个连接的数据包的五元组相同。With the development of cluster technology, load balancing, as the core of cluster technology, has also received widespread attention and research. While load balancing ensures that the load of the back-end servers is equal, it also needs to ensure that data packets belonging to the same connection are sent to the same back-end server. Packets belonging to the same connection have the same quintuple.
负载均衡旨在提供高可用性、高性能的集群技术,它提供了一种廉价有效透明的方法扩展集群的带宽、增加集群的吞吐量、加强集群对网络数据的处理能力,保证业务的高可用性。Load balancing aims to provide high-availability, high-performance cluster technology. It provides a cheap, effective and transparent method to expand the bandwidth of the cluster, increase the throughput of the cluster, strengthen the cluster's ability to process network data, and ensure high availability of services.
现有的四层负载均衡技术使用LVS架构,是一种基于TCP/IP的负载均衡技术,通过IP虚拟服务器(IP Virtual Server,IPVS)模块来实现,工作在内核。LVS架构存在如下弊端:The existing four-layer load balancing technology uses the LVS architecture, which is a load balancing technology based on TCP/IP. It is implemented through the IP Virtual Server (IPVS) module and works in the kernel. The LVS architecture has the following disadvantages:
第一、性能开销严重。First, the performance overhead is serious.
基于LVS架构,数据包的转发需要经过网卡、内核系统才能实现转发。从设计的角度来说,操作系统为了保证安全性和隔离性,数据包经过内核时都要经历:分配套接字缓存(Socket Buffer,SKB)、套接字加锁、TCP(或UDP)……协议栈、内核态和用户态切换。导致性能开销严重。同时,LVS架构需要保证集群内的各个负载均衡器之间同步,导致流量异常增加以及负载均衡器性能开销大。Based on the LVS architecture, data packet forwarding needs to go through the network card and kernel system to achieve forwarding. From a design perspective, in order to ensure security and isolation, the operating system must go through the following processes when data packets pass through the kernel: allocating socket buffer (SKB), socket locking, TCP (or UDP)... ...Protocol stack, kernel mode and user mode switching. Causes serious performance overhead. At the same time, the LVS architecture needs to ensure synchronization between load balancers in the cluster, resulting in an abnormal increase in traffic and high load balancer performance overhead.
第二、负载均衡器容易受负载突增的影响。Second, the load balancer is susceptible to sudden load increases.
基于LVS架构,由于性能开销大,数据流量较大时会增加设备故障的可能性。因此,为了降低机器故障率,通过将负载均衡器和后端真正提供服务的RS放在不同的主机上,负载均衡器的数量少于RS的数量,这使得负载均衡器容易受到负载突增的影响。数据包在负载均衡器处理之前要经过常规的linux网络堆栈,更是加剧了这个问题。Based on the LVS architecture, due to high performance overhead, large data traffic will increase the possibility of equipment failure. Therefore, in order to reduce the machine failure rate, by placing the load balancer and the RS that the backend actually provides services on different hosts, the number of load balancers is less than the number of RS, which makes the load balancer vulnerable to load bursts. Influence. This problem is exacerbated by the fact that packets go through the regular Linux network stack before being processed by the load balancer.
为克服LVS负载均衡技术的问题,业界引入基于XDP实现的负载均衡架构。这种架构中,数据包进入用户态之前直接对数据包进行过滤或处理,相对于基于LVS的负载均衡架构,基于XDP的负载均衡架构的性能更优。基于XDP的负载均衡架构具有如下优点:In order to overcome the problems of LVS load balancing technology, the industry introduced a load balancing architecture based on XDP. In this architecture, the data packets are filtered or processed directly before entering the user mode. Compared with the LVS-based load balancing architecture, the XDP-based load balancing architecture has better performance. The load balancing architecture based on XDP has the following advantages:
a、及时、高效的数据包处理。a. Timely and efficient data packet processing.
基于XDP的负载均衡架构下,负载均衡器在驱动程序模式下被启用后,在网卡收到数据包之后、内核截获数据包之前,负载均衡器处理数据包。处理过程中,对于每个入站的数据包,负载均衡器一律调用柏克莱封包过滤器(Berkeley Packet Filter,BPF)程序。如果网卡有多个队列,则负载均衡器为每一个队列并行调用BPF程序。而且,用于处理数据包的BPF程序是无锁的,使用每个CPU特有的BPF映射。基于这种并行机制,负载均衡的性能随着网卡的接收队列的数量呈线性扩展。Under the XDP-based load balancing architecture, after the load balancer is enabled in driver mode, the load balancer processes the data packet after the network card receives the data packet and before the kernel intercepts the data packet. During the processing, for each inbound data packet, the load balancer always calls the Berkeley Packet Filter (BPF) program. If the network card has multiple queues, the load balancer calls the BPF program in parallel for each queue. Furthermore, the BPF routines used to process packets are lock-free and use BPF mappings unique to each CPU. Based on this parallel mechanism, the performance of load balancing scales linearly with the number of receive queues of the network card.
b、无需保证集群内的各个负载均衡器之间同步。b. There is no need to ensure synchronization between load balancers in the cluster.
基于XDP的负载均衡架构采用一致性哈希(hash)算法代替传统的负载均衡算法,避免了基于LVS的负载均衡架构保证集群内的各个负载均衡器之间同步,因此能够避免流量异常和负载均衡器性能开销大的问题。The XDP-based load balancing architecture uses a consistent hash algorithm instead of the traditional load balancing algorithm, which avoids the need for LVS-based load balancing architecture to ensure synchronization between load balancers in the cluster, thus avoiding traffic anomalies and load balancing. The problem of high server performance overhead.
c、提供快速路径c. Provide a fast path
基于XDP的负载均衡架构为高速处理数据包提供一条快速路径,负载均衡器和RS部署在同一个主机上一起运行,且性能不会出现任何下降。同时,增强了面对负载猛增、主机故障和维护的适应能力。The XDP-based load balancing architecture provides a fast path for high-speed processing of data packets. The load balancer and RS are deployed on the same host and run together without any performance degradation. At the same time, it enhances its ability to adapt to load surges, host failures, and maintenance.
基于XDP的负载均衡架构和基于LVS的负载均衡架构的相同点在于:负载均衡器需要和机房的交换机起路由协议,如开放式最短路径优先(Open Shortest Path First,OSPF)协议,目的是为了向外界通告负载均衡器的虚拟IP地址(vertical IP,VIP)。之后,客户端才能将数据包发送到集群内相应的负载均衡器上。最后,负载均衡器根据负载均衡算法从多个RS中选择出一个RS,并将数据包发送给该RS。The similarity between the XDP-based load balancing architecture and the LVS-based load balancing architecture is that the load balancer needs to establish a routing protocol with the switch in the computer room, such as the Open Shortest Path First (OSPF) protocol, in order to provide The virtual IP address (vertical IP, VIP) of the load balancer is advertised to the outside world. After that, the client can send the data packet to the corresponding load balancer in the cluster. Finally, the load balancer selects an RS from multiple RSs based on the load balancing algorithm and sends the data packet to the RS.
通常情况下,集群对外提供服务时集群内的主机的数量增减无法避免且频率很高。实际使用发现:当在集群中新增主机时,原本发送给集群的RS甲的数据包被发送给RS乙,导致集群内的正在进行的业务发生异常。而且,异常的比例随着新增主机的数量的增加而增加。Normally, when the cluster provides services to the outside world, the number of hosts in the cluster increases and decreases unavoidably and frequently. Actual usage found that when a new host was added to the cluster, the data packet originally sent to RS A of the cluster was sent to RS B, causing an abnormality in the ongoing business within the cluster. Moreover, the proportion of anomalies increases with the number of new hosts.
为了对集群新增机器,业界考虑对交换机进行改进。但是实际中,一个交换机连接着许多的主机,每台主机上都有流量。如果改动交换机,则意味着:由于规划的变动或机器宕机等原因需要在集群中增加机器或替换机器时,若通过改动交换机实现,则需要将整个集群的流量全部备份,不然会对集群内正在进行的业务造成影响,耗费人力物力且导致业务质量差,引起客户投诉。其中,正在进行的业务称之为旧业务、已有业务等,用于传输正在进行的业务的数据包的连接称之为旧连接。In order to add new machines to the cluster, the industry considers improving the switches. But in reality, a switch is connected to many hosts, and each host has traffic. If you change the switch, it means: when you need to add machines or replace machines in the cluster due to planning changes or machine downtime, etc., if you change the switch, you need to back up all the traffic of the entire cluster, otherwise it will cause problems within the cluster. It affects ongoing business, consumes manpower and material resources, leads to poor business quality, and causes customer complaints. Among them, ongoing services are called old services, existing services, etc., and connections used to transmit data packets of ongoing services are called old connections.
显然,现有的基于XDP的负载均衡架构,无法在集群中新增机器,大大限制了集群的可拓展性和可用性。Obviously, the existing XDP-based load balancing architecture cannot add new machines to the cluster, which greatly limits the scalability and availability of the cluster.
基于此,本申请实施例提供一种负载均衡方法、装置、设备及可读存储介质,通过对负载均衡器进行改进,使得负载均衡器具有查询各RS的挂载时长的功能,以解决基于XDP的架构增加新的服务器时对已有业务的影响,实现提高业务可靠性的目的的同时,无需改动交换机。Based on this, embodiments of the present application provide a load balancing method, device, equipment and readable storage medium. By improving the load balancer, the load balancer has the function of querying the mounting duration of each RS to solve the problem of XDP-based The architecture reduces the impact on existing services when new servers are added, while achieving the purpose of improving service reliability without changing the switches.
图1是本申请实施例提供的负载均衡方法所适用的负载均衡系统的架构示意图。请参照图1,该负载均衡系统包括主机11、查询设备12、交换机13和终端设备14。查询设备12与各主机11之间建立网络连接。各主机11和交换机13之间建立网络连接,终端设备14和交换机13之间建立网络连接。Figure 1 is a schematic architectural diagram of a load balancing system to which the load balancing method provided by the embodiment of the present application is applicable. Please refer to Figure 1. The load balancing system includes a host 11, a query device 12, a switch 13 and a terminal device 14. A network connection is established between the query device 12 and each host 11 . A network connection is established between each host 11 and the switch 13 , and a network connection is established between the terminal device 14 and the switch 13 .
主机11也称之为机器、服务器等,每台主机11上部署基于XDP的负载均衡器111和RS112。负载均衡器111具有查询各RS112的VIP的功能,能够通过查询设备12获取各主机11上的RS112的VIP以及VIP的通告时间点。需要说明的是,由于每台主机11上部署负载均衡器111和RS12,因此,主机11的VIP、该主机11上的负载均衡器111、该主机11上的RS112的VIP相同。Host 11 is also called a machine, server, etc., and XDP-based load balancer 111 and RS112 are deployed on each host 11. The load balancer 111 has the function of querying the VIP of each RS112, and can obtain the VIP of the RS112 on each host 11 and the VIP notification time point through the query device 12. It should be noted that since the load balancer 111 and RS12 are deployed on each host 11, the VIP of the host 11, the load balancer 111 on the host 11, and the VIP of RS112 on the host 11 are the same.
查询设备12也称之为IP watcher组件,其可以是独立与主机11的机器,也可以是一台主机11,该主机11上部署负载均衡器111和RS112的同时,保存负载均衡系统中各主机11的VIP以及VIP的通告时间点。负载均衡系统中每次新增主机11时,新增主机11的RS112向查询设备12通告VIP,查询设备12记录RS112的VIP以及通告时间点。由此可见,查询设备12用于收集并记录负载均衡系统内每个RS112的VIP以及通告时间点。通告时间点即为新增主机11的时间点。The query device 12 is also called the IP watcher component. It can be a machine independent of the host 11, or it can be a host 11. The load balancer 111 and RS112 are deployed on the host 11 and at the same time, each host in the load balancing system is saved. 11 VIP and VIP notification time. Each time a new host 11 is added in the load balancing system, RS112 of the new host 11 notifies the VIP of the new host 11 to the query device 12, and the query device 12 records the VIP of RS112 and the notification time point. It can be seen that the query device 12 is used to collect and record the VIP and notification time points of each RS 112 in the load balancing system. The notification time point is the time point when host 11 is added.
交换机13用于连接终端设备14和主机11,用于第一次负载均衡。交换机13接收到来自终端设备14的数据包后,从多个主机11中选择一台主机11并发送数据包。选中的主机11的负载均衡器111接收到数据包后,执行本申请实施例提供的负载均衡方法进行第二次负载均衡,从多个RS112中选中目标RS,并将数据包发送给目标RS。The switch 13 is used to connect the terminal device 14 and the host 11 for the first load balancing. After receiving the data packet from the terminal device 14, the switch 13 selects one host 11 from the plurality of hosts 11 and sends the data packet. After the load balancer 111 of the selected host 11 receives the data packet, it executes the load balancing method provided by the embodiment of this application to perform the second load balancing, selects the target RS from multiple RSs 112, and sends the data packet to the target RS.
终端设备14可以是硬件也可以是软件。当终端设备14为硬件时,终端设备14例如为安装有安卓操作系统、微软操作系统、塞班操作系统、Linux操作系统或苹果iOS操作系统的手机、平板电脑、个人电脑、电子书阅读器、膝上型便携电脑、台式计算机等。当终端设备14为软件时,其可以安装在上述列举的硬件设备中,此时,终端设备14例如为多个软件模块或单个软件模块等,本申请实施例并不限制。The terminal device 14 may be hardware or software. When the terminal device 14 is hardware, the terminal device 14 is, for example, a mobile phone, a tablet computer, a personal computer, an e-book reader installed with an Android operating system, a Microsoft operating system, a Symbian operating system, a Linux operating system or an Apple iOS operating system. Laptops, desktop computers, etc. When the terminal device 14 is software, it can be installed in the hardware device listed above. In this case, the terminal device 14 can be, for example, multiple software modules or a single software module, which is not limited by the embodiments of the present application.
请参照图1,负载均衡器111使用快速重路由(Fast Reroute,FRR)、quagga等和交换机13进行对等互联,向交换机13通告负载均衡器111的VIP。然后,交换机13使用等价多路径(Equal-Cost Multipath Routing,ECMP)机制,从已经通告VIP的负载均衡器111中选中一台目标负载均衡器并发送数据包,从而完成第一次负载均衡。其中,负载均衡器111向交换机13通告VIP时,通常使用开放式最短路径优先(Open Shortest Path First,OSPF)路由协议等。Please refer to Figure 1. The load balancer 111 uses Fast Reroute (FRR), quagga, etc. to perform peer-to-peer interconnection with the switch 13, and notifies the switch 13 of the VIP of the load balancer 111. Then, the switch 13 uses the Equal-Cost Multipath Routing (ECMP) mechanism to select a target load balancer from the load balancer 111 that has advertised the VIP and sends the data packet, thus completing the first load balancing. When the load balancer 111 advertises the VIP to the switch 13, the Open Shortest Path First (OSPF) routing protocol is usually used.
根据上述可知:本申请实施例中存在两种VIP通告,一种是负载均衡器111使用OSPF路由协议向外界,即向交换机13等通告负载均衡器111的VIP。一种是RS112向查询设备12通告RS112的VIP。According to the above, it can be seen that there are two kinds of VIP notifications in the embodiment of the present application. One is that the load balancer 111 uses the OSPF routing protocol to notify the VIP of the load balancer 111 to the outside world, that is, to the switch 13 and so on. One is that RS112 notifies the query device 12 of the VIP of RS112.
第一次负载均衡后,数据包经过交换机13到达负载均衡器111后,负载均衡器111会从负载均衡系统包含的主机11上的RS112中选出目标RS,并将数据包发送给目标RS,从而完成第二次负载均衡。为了保证同一个业务的数据包发送到同一个目标RS,负载均衡器111接收到一个业务的第一个数据包后,会使用一致性哈希算法。一致性哈希算法根据数据包的五元组、负载均衡系统内各RS的VIP、RS的数量等,确定出目标RS。针对一个业务的第一个数据包确定出目标RS后,负载均衡器111在本地的映射表中记录第一个数据包的五元组和目标RS的映射关系。这样一来,后续负载均衡器111每次接收到同一个业务的数据包后,根据数据包的五元组查询映射表即可确定出目标RS。After the first load balancing, after the data packet reaches the load balancer 111 through the switch 13, the load balancer 111 will select the target RS from the RS112 on the host 11 included in the load balancing system, and send the data packet to the target RS. This completes the second load balancing. In order to ensure that data packets of the same service are sent to the same target RS, the load balancer 111 will use a consistent hash algorithm after receiving the first data packet of a service. The consistent hash algorithm determines the target RS based on the five-tuple of the data packet, the VIP of each RS in the load balancing system, the number of RS, etc. After determining the target RS for the first data packet of a service, the load balancer 111 records the mapping relationship between the five-tuple of the first data packet and the target RS in the local mapping table. In this way, each time subsequent load balancer 111 receives a data packet of the same service, the target RS can be determined by querying the mapping table according to the five-tuple of the data packet.
也就是说,本申请实施例中,负载均衡器111每次接收到数据包后,优先根据数据包的五元组查询映射表,若映射表中存在数据包的五元组,则直接将五元组对应的RS作为目标RS。若映射表中不存在该数据包的五元组,则确定生效RS,并从生效RS中确定出目标RS。That is to say, in the embodiment of this application, each time the load balancer 111 receives a data packet, it first queries the mapping table according to the five-tuple of the data packet. If there is a five-tuple of the data packet in the mapping table, it directly adds the five-tuple to the data packet. The RS corresponding to the tuple is used as the target RS. If the five-tuple of the data packet does not exist in the mapping table, the effective RS is determined, and the target RS is determined from the effective RS.
采用该种方案,负载均衡器每次执行第二次负载均衡时优先查映射表以确定目标RS,只有在无法通过查询映射表的方式确定出目标RS时,才从生效RS中确定出目标RS,避免反复执行一致性哈希带来的性能消耗。Using this solution, the load balancer first checks the mapping table to determine the target RS each time it performs the second load balancing. Only when the target RS cannot be determined by querying the mapping table, the target RS is determined from the effective RS. , to avoid the performance consumption caused by repeatedly executing consistent hashing.
可选的,上述实施例中,负载均衡器从生效RS中确定出目标RS之后,还在映射表中新增数据包的五元组和目标RS的映射关系。这样一来,每次确定出新的五元组和RS的映射关系,则在映射表中新增一条记录。由于同一个业务的数据包的五元组相同,因此,后续接收到同一个业务的数据包后,直接查询映射表即可确定出目标RS,无需执行一致性哈希运算,速度快、性能消耗低。Optionally, in the above embodiment, after the load balancer determines the target RS from the effective RS, it also adds a mapping relationship between the five-tuple of the data packet and the target RS in the mapping table. In this way, every time the mapping relationship between a new quintuple and RS is determined, a new record is added to the mapping table. Since the quintuple of data packets of the same service is the same, after subsequently receiving the data packet of the same service, the target RS can be determined by directly querying the mapping table without performing consistent hashing operations, which is fast and performance-consuming. Low.
采用该种方案,通过将五元组和目标RS的映射关系存储在映射表中,能够避免后续反复执行一致性哈希带来的性能消耗。Using this solution, by storing the mapping relationship between the quintuple and the target RS in the mapping table, the performance consumption caused by subsequent repeated execution of consistent hashing can be avoided.
可选的,上述实施例中,负载均衡器从生效RS中确定出目标RS时,根据生效RS的VIP、数据包的五元组、生效RS的数量等进行一致性哈希运算,从而确定出目标RS。Optionally, in the above embodiment, when the load balancer determines the target RS from the effective RS, it performs a consistent hash operation based on the VIP of the effective RS, the quintuple of the data packet, the number of effective RS, etc., thereby determining the target RS. TargetRS.
另外,由于同一个业务的所有数据包的五元组相同,因此,当负载均衡系统内的RS的数量不变时,无论哪个负载均衡器111接收到数据包,都可以将属于同一个业务的数据包发送给同一个目标RS。因此,不需要负载均衡系统内的各个负载均衡器111进行同步。In addition, since all data packets of the same service have the same five-tuple, when the number of RSs in the load balancing system remains unchanged, no matter which load balancer 111 receives the data packet, it can all The data packet is sent to the same destination RS. Therefore, synchronization of individual load balancers 111 within the load balancing system is not required.
当负载均衡系统内新增主机11时,相当于同时增加负载均衡器111和RS112。交换机13使用OSPF路由协议执行第一次负载均衡确定目标负载均衡器,很有可能将数据包发送给新增主机11上的负载均衡器111,负载均衡器111的映射表为空。When a new host 11 is added to the load balancing system, it is equivalent to adding load balancer 111 and RS112 at the same time. Switch 13 uses the OSPF routing protocol to perform the first load balancing to determine the target load balancer. It is very likely that the data packet will be sent to the load balancer 111 on the newly added host 11, and the mapping table of the load balancer 111 is empty.
新增主机11导致RS112的数量发生变化,进而导致一致性哈希算法的结果发生变化。因此,传统的基于XDP的负载均衡架构中,当负载均衡器111接收到一个数据包,且该数据包是已有业务的数据包时,负载均衡器111根据一致性哈希算法确定出的目标RS,很有可能不是正确的RS,例如,负载均衡器111将原本应该发送给RS甲的数据包被发送给RS乙。RS乙接收到数据包后,由于RS乙上并没有已有业务的五元组等信息,因此直接丢弃数据包或者反馈复位(reset,RST),导致已有业务异常。显然,交换机13的第一次负载均衡和负载均衡器111的第二次负载均衡,导致负载均衡系统中新增主机11时,已有业务异常的比例飙升。The addition of host 11 causes the number of RS112 to change, which in turn causes the result of the consistent hashing algorithm to change. Therefore, in the traditional XDP-based load balancing architecture, when the load balancer 111 receives a data packet, and the data packet is a data packet of an existing service, the load balancer 111 determines the target based on the consistent hash algorithm. The RS may not be the correct RS. For example, the load balancer 111 sends the data packet that should have been sent to RS A to RS B. After RS B receives the data packet, since RS B does not have information such as the quintuple of the existing service, it directly discards the data packet or feeds back a reset (RST), causing the existing service to be abnormal. Obviously, the first load balancing of switch 13 and the second load balancing of load balancer 111 caused the proportion of existing business exceptions to soar when host 11 was added to the load balancing system.
可以理解的是:已有业务是指新增主机11之前,负载均衡系统中存在至少一个主机11,该主机11上的负载均衡器111的映射表中存在这个业务的五元组和目标RS的对应关系。例如,一个视频业务,新增主机11之前,负载均衡系统中有3个主机11,相应的,负载均衡系统中有3个负载均衡器。若全部或部分负载均衡器的映射表中记录视频业务的五元组和目标RS的映射关系,则说明视频业务为已有业务。It can be understood that the existing business means that before the new host 11 is added, there is at least one host 11 in the load balancing system, and the quintuple of this business and the target RS exist in the mapping table of the load balancer 111 on the host 11. Correspondence. For example, for a video service, before adding host 11, there were three hosts 11 in the load balancing system. Correspondingly, there were three load balancers in the load balancing system. If the mapping relationship between the quintuple of the video service and the target RS is recorded in the mapping table of all or part of the load balancer, it means that the video service is an existing service.
本申请实施例中,每次新增主机11时,新增主机11上的RS112向查询设备12上报VIP,查询设备12记录新增主机11上的RS112的VIP和通告时间点。而且,每次新增主机11时,开启新增主机11上的负载均衡器111的功能,暂不开启新增主机11上的RS112的功能,而是经过预设时长后才开启新增主机11上的RS112的功能。新增主机11上的RS112的功能开启后,负载均衡器111执行一致性哈希运算时考虑该RS112。In the embodiment of this application, each time a new host 11 is added, RS112 on the newly added host 11 reports the VIP to the query device 12, and the query device 12 records the VIP and notification time point of the RS112 on the newly added host 11. Moreover, every time a new host 11 is added, the load balancer 111 function on the new host 11 is enabled, and the RS112 function on the newly added host 11 is not enabled for the time being. Instead, the new host 11 is enabled after a preset period of time. function on RS112. After the RS112 function on the new host 11 is enabled, the load balancer 111 will consider the RS112 when performing consistent hashing operations.
负载均衡器111接收到数据包后,从多个RS112中确定出挂载时长超过预设时长的RS112作为生效RS112。之后,从生效RS112中确定出目标RS并发送数据包。也就是说,每次新增主机11后,新增主机11上的RS112并不立即参与一致性哈希算法,经过预设时长后才参与一致性哈希算法。预设时长内,初始时,新增主机11上的负载均衡器111的映射表为空。之后,每次接收到数据包后,若映射表中不存在数据包的五元组,则根据生效RS112、数据包的五元组等执行一致性哈希,确定出目标RS并发送数据包。同时,新增主机11上的负载均衡器111在映射表中记录五元组与目标RS的映射关系。After receiving the data packet, the load balancer 111 determines the RS112 whose mounting time exceeds the preset time from multiple RS112s as the effective RS112. Afterwards, the target RS is determined from the effective RS112 and the data packet is sent. That is to say, every time a new host 11 is added, RS112 on the newly added host 11 does not immediately participate in the consistent hashing algorithm, but only participates in the consistent hashing algorithm after a preset period of time. Within the preset time period, initially, the mapping table of the load balancer 111 on the newly added host 11 is empty. After that, every time a data packet is received, if the five-tuple of the data packet does not exist in the mapping table, consistent hashing will be performed based on the effective RS112, the five-tuple of the data packet, etc. to determine the target RS and send the data packet. At the same time, the load balancer 111 on the newly added host 11 records the mapping relationship between the quintuple and the target RS in the mapping table.
这样一来,新增主机11经过预设时长后,新增主机11上的负载均衡器111的映射表中会记录所有已有业务的数据包的五元组和目标RS的映射关系。预设时长后,新增主机11上的RS112生效,这时,若使用一致性哈希算法确定已有业务的数据包的目标RS,则很有可能出错。但是,针对已有业务的数据包,负载均衡器111优先查询映射表,因此能够确定出正确的目标RS。针对新业务的数据包,负载均衡器111根据当前已生效的RS112、新业务的数据包的五元组等执行一致性哈希算法确定目标RS并在映射表中增加新的记录。In this way, after a preset period of time has elapsed for the new host 11, the mapping table of the load balancer 111 on the new host 11 will record the mapping relationship between the five-tuple packets of all existing services and the target RS. After the preset time, RS112 on the newly added host 11 takes effect. At this time, if the consistent hash algorithm is used to determine the target RS of the data packet of the existing service, an error is likely to occur. However, for data packets of existing services, the load balancer 111 first queries the mapping table, so it can determine the correct target RS. For the data packet of the new service, the load balancer 111 performs a consistent hash algorithm to determine the target RS based on the currently effective RS112, the five-tuple of the new service data packet, etc. and adds a new record to the mapping table.
对于负载均衡系统中原有主机11上的负载均衡器111而言,若负载均衡器111的映射表中本来就存在已有业务的数据包的五元组和目标RS的映射关系,则通过查询映射表就能够确定出正确的目标RS。若映射表中不存在已有业务的数据包的五元组和目标RS的映射关系,则同样能够根据生效RS112、数据包的五元组等执行一致性哈希确定出目标RS并发送数据包。For the load balancer 111 on the original host 11 in the load balancing system, if there is a mapping relationship between the five-tuple of the data packet of the existing service and the target RS in the mapping table of the load balancer 111, then through query mapping table can determine the correct target RS. If there is no mapping relationship between the five-tuple of the data packet of the existing service and the target RS in the mapping table, the target RS can also be determined and the data packet is sent by performing consistent hashing based on the effective RS112, the five-tuple of the data packet, etc. .
应当理解的是,图1中的主机11、查询设备12、交换机13和终端设备14的数量仅仅是示意性的。实际实现中,根据实际需求部署任意数量的主机11、查询设备12、交换机13和终端设备14。It should be understood that the numbers of the host 11, the query device 12, the switch 13 and the terminal device 14 in Figure 1 are only illustrative. In actual implementation, any number of hosts 11, query devices 12, switches 13 and terminal devices 14 can be deployed according to actual needs.
图2是本申请实施例提供的基于XDP的负载均衡架构在主机上的工作层级示意图。请参照图2,主机上的工作层级包括:网卡驱动、负载均衡器、内核(kernel)用户进程等。其中,负载均衡器为基于XDP的负载均衡器,用户进程是用户态下的相关进程。当主机上的RS是内容分发网络(Content Delivery Network,CDN)中的边缘节点时,用户态具有squid缓存以及shark(调度)组件等。Figure 2 is a schematic diagram of the working level of the XDP-based load balancing architecture on the host provided by the embodiment of this application. Please refer to Figure 2. The working layers on the host include: network card driver, load balancer, kernel user process, etc. Among them, the load balancer is an XDP-based load balancer, and the user process is a related process in the user mode. When the RS on the host is an edge node in the Content Delivery Network (CDN), the user state has Squid cache and shark (scheduling) components.
请参照图2,主机在驱动程序模式下被启用,数据包处理在网卡收到数据包之后、内核截获前进行,避免了用户态和内核态切换导致的开销,因此,相较于基于LVS的负载均衡架构,本申请实施例提供的基于XDP的负载均衡架构能够降低性能开销。Please refer to Figure 2. The host is enabled in driver mode. Data packet processing is performed after the network card receives the data packet and before the kernel intercepts it. This avoids the overhead caused by switching between user mode and kernel mode. Therefore, compared with LVS-based Load balancing architecture. The XDP-based load balancing architecture provided by the embodiments of this application can reduce performance overhead.
下面,基于图1所示负载均衡系统,对本申请实施例所述的负载均衡方法进行详细说明。示例性的,请参照图3,图3是本申请实施例提供的负载均衡方法的流程图。本实施例是从负载均衡器的角度进行说明。本实施例包括:Next, based on the load balancing system shown in Figure 1, the load balancing method described in the embodiment of the present application will be described in detail. For example, please refer to Figure 3, which is a flow chart of a load balancing method provided by an embodiment of the present application. This embodiment is explained from the perspective of a load balancer. This embodiment includes:
301、负载均衡器确定负载均衡系统中存在新增主机。301. The load balancer determines that there is a new host in the load balancing system.
其中,负载均衡器是所述负载均衡系统包含的多个主机中的任意一个主机上的负载均衡器,所述多个主机中的每个主机上均部署负载均衡器和真实服务器RS。由于每个主机上部署负载均衡器和RS,因此,每新增一台主机,则表示负载均衡器和RS分别增加一台。Wherein, the load balancer is a load balancer on any one of the multiple hosts included in the load balancing system, and the load balancer and the real server RS are deployed on each of the multiple hosts. Since the load balancer and RS are deployed on each host, every time a new host is added, it means that one load balancer and one RS are added respectively.
本申请实施例中,包括两次负载均衡,以下分别称之为第一次负载均衡和第二次负载均衡,第一次负载均衡指交换从多个主机的负载均衡器中选择目标负载均衡器,并将数据包发送给目标负载均衡器。第二次负载均衡指目标负载均衡器从多个主机的RS中选中目标RS并将数据包发送给目标RS。目标负载均衡器和目标RS可能位于同一个主机,也可能位于不同的主机。In the embodiment of this application, two load balancing are included, which are hereinafter referred to as the first load balancing and the second load balancing respectively. The first load balancing refers to switching to select a target load balancer from the load balancers of multiple hosts. , and sends the packet to the target load balancer. The second load balancing means that the target load balancer selects the target RS from the RS of multiple hosts and sends the data packet to the target RS. The target load balancer and target RS may be on the same host or on different hosts.
本申请实施例中,负载均衡器是新增主机之后,负载均衡系统中每个主机上的负载均衡器。也就是说,负载均衡系统中的每一个负载均衡器,包括负载均衡系统中原有主机上的负载均衡器,以及新增主机上的负载均衡器,每个负载均衡器检测出负载均衡系统中新增主机后,均执行本申请实施例所述的负载均衡方法。In the embodiment of this application, the load balancer is a load balancer on each host in the load balancing system after a new host is added. That is to say, each load balancer in the load balancing system, including the load balancer on the original host in the load balancing system, and the load balancer on the newly added host, each load balancer detects the new load balancer in the load balancing system. After adding a host, the load balancing method described in the embodiment of this application is executed.
负载均衡器确定负载均衡系统新增主机后,一旦该负载均衡器接收到来自交换机的数据包,则表示该负载均衡器为目标负载均衡器。After the load balancer determines that a new host has been added to the load balancing system, once the load balancer receives a data packet from the switch, it indicates that the load balancer is the target load balancer.
302、负载均衡器接收数据包。302. The load balancer receives the data packet.
示例性的,交换机执行第一次负载均衡,从多个主机的负载均衡器选中目标负载均衡器并发送数据包给目标负载均衡器。相应的,目标负载均衡器接收数据包。数据包可以是用户的终端设备发起的业务请求等,目标RS接收到数据包后,根据数据包响应业务请求。For example, the switch performs the first load balancing, selects the target load balancer from the load balancers of multiple hosts and sends the data packet to the target load balancer. Accordingly, the target load balancer receives the packet. The data packet may be a service request initiated by the user's terminal device. After receiving the data packet, the target RS responds to the service request according to the data packet.
从交换机的角度而言,和传统的基于XDP的负载均衡架构一样,使用OSPF路由协议执行第一次负载均衡确定目标负载均衡器,很有可能将数据包发送给新增主机上的负载均衡器,新增主机上的负载均衡器的映射表为空。当然,交换机也很有可能将数据包发送给原有主机上的负载均衡器。From the perspective of the switch, like the traditional XDP-based load balancing architecture, the OSPF routing protocol is used to perform the first load balancing to determine the target load balancer, and it is very likely that the data packet will be sent to the load balancer on the newly added host. , the mapping table of the load balancer on the newly added host is empty. Of course, the switch is also likely to send the packet to the load balancer on the original host.
303、负载均衡器从负载均衡系统包含的各主机的RS中确定出生效RS,所述生效RS是新增主机之前所述负载均衡器对已有业务的数据包进行负载均衡时涉及的RS,所述已有业务是新增主机之前所述负载均衡系统正在提供给用户的业务。303. The load balancer determines the effective RS from the RS of each host included in the load balancing system. The effective RS is the RS involved when the load balancer performs load balancing on data packets of existing services before adding a host. The existing services are services that the load balancing system is providing to users before the new host is added.
本申请实施例中,负载均衡器每次接收到数据包后,查询本地的映射表,若映射表中不存在该数据包的五元组,则执行一致性哈希运算以确定目标RS。传统的基于XDP的负载均衡架构中,当有新增主机时,负载均衡器根据数据包的五元组、负载均衡系统中所有RS的VIP、以及RS的数量执行一致性哈希,导致确定出的目标RS不正确。In the embodiment of this application, each time the load balancer receives a data packet, it queries the local mapping table. If the five-tuple of the data packet does not exist in the mapping table, it performs a consistent hash operation to determine the target RS. In the traditional XDP-based load balancing architecture, when a new host is added, the load balancer performs consistent hashing based on the quintuple of the data packet, the VIPs of all RSs in the load balancing system, and the number of RSs, resulting in the determination of The target RS is incorrect.
本申请实施例中,每次新增主机后,该主机上的RS并不立即生效,即并不立即参与负载均衡,而是待新增主机上的负载均衡器的映射表中保存所有已有业务的五元组和RS的映射关系后,才将新增主机上的RS用于负载均衡。In the embodiment of this application, every time a host is added, the RS on the host does not take effect immediately, that is, it does not immediately participate in load balancing. Instead, all existing RSs are saved in the mapping table of the load balancer on the newly added host. After determining the mapping relationship between the business quintuple and the RS, the RS on the newly added host will be used for load balancing.
因此,负载均衡器查映射表无法确定出目标RS而执行一致性哈希时,从所有RS中确定出生效RS。生效的RS有可能提供至少一种已有业务的RS,或者没有提供已有业务。但是,无论是否提供已有业务,生效RS都是新增主机之前,负载均衡器对已有业务的数据包执行一致性哈希时涉及的RS。Therefore, when the load balancer cannot determine the target RS by looking up the mapping table and performs consistent hashing, it determines the effective RS from all RSs. The effective RS may provide at least one RS with existing services, or may not provide any existing services. However, regardless of whether existing services are provided or not, the effective RS is the RS involved when the load balancer performs consistent hashing on the data packets of existing services before adding a host.
例如,负载均衡系统中有2个主机,分别为主机1和主机2,主机1上部署负载均衡器1a和RS1b,主机2上部署负载均衡器2a和RS2b。新增主机3,主机3上部署负载均衡器3a和RS3b。负载均衡器1a上存储一个映射表,该映射表中存储五元组A和RS2b的对应关系,负载均衡器2a和负载均衡器3a上的映射表的为空,即RS2b已对外提供业务,RS1b并未提供业务。For example, there are two hosts in the load balancing system, namely host 1 and host 2. Load balancer 1a and RS1b are deployed on host 1, and load balancer 2a and RS2b are deployed on host 2. Add host 3, and deploy load balancer 3a and RS3b on host 3. A mapping table is stored on load balancer 1a, which stores the corresponding relationship between quintuple A and RS2b. The mapping tables on load balancer 2a and load balancer 3a are empty, that is, RS2b has provided services to the outside world, and RS1b No business was provided.
也就是说,新增主机之前,有一种已有业务,该种业务的数据包的五元组分别为五元组A。新增主机之前,负载均衡器(负载均衡器1a或负载均衡器2a)第一次接收到五元组为五元组A的数据包后,根据五元组A、RS1b的VIP、RS2b、RS数量等执行一致性哈希,确定出目标RS为RS2b。显然,新增主机3之前,负载均衡器对已有业务的数据包执行一致性哈希时涉及的RS包括RS1b和RS2b。因此,生效RS包括RS1b和RS2b。That is to say, before the new host is added, there is an existing service, and the quintuple of the data packet of this service is quintuple A. Before adding a new host, after the load balancer (load balancer 1a or load balancer 2a) receives the data packet whose quintuple is quintuple A for the first time, it will use the VIP, RS2b, and RS of quintuple A and RS1b. Consistent hashing is performed on the quantity, etc., and the target RS is determined to be RS2b. Obviously, before adding host 3, the RS involved when the load balancer performs consistent hashing on the data packets of existing services includes RS1b and RS2b. Therefore, the effective RS includes RS1b and RS2b.
304、负载均衡器从所述生效RS中确定出目标RS。304. The load balancer determines the target RS from the effective RS.
示例性的,负载均衡器并非直接从负载均衡系统中所有的RS中选择目标RS,而是先从所有的RS中确定出生效RS,再从生效RS中选出目标RS。For example, the load balancer does not directly select the target RS from all RSs in the load balancing system, but first determines the effective RS from all the RSs, and then selects the target RS from the effective RSs.
例如,负载均衡系统中有2个主机,分别为主机1和主机2,主机1上部署负载均衡器1a和RS1b,主机2上部署负载均衡器2a和RS2b。新增主机3,主机3上部署负载均衡器3a和RS3b。负载均衡器1a上存储一个映射表,该映射表中存储五元组A和RS2b的对应关系,负载均衡器2a上的映射表存储五元组B和RS1b的对应关系,负载均衡器3a上的映射表的为空。也就是说,新增主机之前,有两种已有业务,该两种业务的数据包的五元组分别为五元组A和五元组B。For example, there are two hosts in the load balancing system, namely host 1 and host 2. Load balancer 1a and RS1b are deployed on host 1, and load balancer 2a and RS2b are deployed on host 2. Add host 3, and deploy load balancer 3a and RS3b on host 3. A mapping table is stored on load balancer 1a, which stores the corresponding relationship between quintuple A and RS2b. The mapping table on load balancer 2a stores the corresponding relationship between quintuple B and RS1b. The mapping table on load balancer 3a stores The mapping table is empty. That is to say, before the new host is added, there are two existing services, and the quintuples of the data packets of the two services are quintuple A and quintuple B respectively.
假设交换机执行第一次负载均衡选中负载均衡器1a,负载均衡器1a接收到数据包后,确定出数据包的五元组为五元组A。因此,负载均衡器1a根据五元组查询映射表确定出目标RS为RS2b。Assume that the switch performs load balancing for the first time and selects load balancer 1a. After receiving the data packet, load balancer 1a determines that the quintuple of the data packet is quintuple A. Therefore, the load balancer 1a determines that the target RS is RS2b according to the five-tuple query mapping table.
假设交换机执行第一次负载均衡选中负载均衡器2a,负载均衡器2a接收到数据包后,确定出数据包的五元组为五元组A。但是,由于映射表为空,因此,负载均衡器2a确定生效RS,生效RS包括RS1b和RS2b。之后,负载均衡器2a执行一致性哈希算法确定出目标RS为RS2b。Assume that the switch performs load balancing for the first time and selects load balancer 2a. After receiving the data packet, load balancer 2a determines that the quintuple of the data packet is quintuple A. However, since the mapping table is empty, load balancer 2a determines the effective RS, which includes RS1b and RS2b. Afterwards, load balancer 2a executes a consistent hash algorithm to determine the target RS as RS2b.
假设交换机执行第一次负载均衡选中负载均衡器3a,负载均衡器3a接收到数据包后,确定出数据包的五元组为五元组A。但是,由于映射表为空,因此,负载均衡器3a确定生效RS,生效RS包括RS1b和RS2b。之后,负载均衡器3a执行一致性哈希算法确定出目标RS为RS2b。Assume that the switch performs load balancing for the first time and selects load balancer 3a. After receiving the data packet, load balancer 3a determines that the quintuple of the data packet is quintuple A. However, since the mapping table is empty, load balancer 3a determines the effective RS, which includes RS1b and RS2b. Afterwards, load balancer 3a executes a consistent hash algorithm to determine the target RS to be RS2b.
再如,负载均衡系统中原本有100个主机,新增主机时,增加了一批主机,这批主机共10个,使得负载均衡系统中总共有110个主机,该100个主机上的RS的编号为100至110。增加一批主机时,110个主机中的每个主机上的负载均衡器检测出新增主机。当任意一个主机上的负载均衡器接收到数据包时,若无法通过查询映射表的方式确定出目标RS时,负载均衡器确定生效RS,假设编号为1-90RS是新增主机之前,负载均衡器对已有业务的数据包进行负载均衡时涉及的RS,则负载均衡器从根据数据包的五元组、这90个RS中各RS的VIP和RS的数量确定目标RS。For another example, there were originally 100 hosts in the load balancing system. When new hosts were added, a batch of hosts were added. This batch of hosts totaled 10, resulting in a total of 110 hosts in the load balancing system. The RS on the 100 hosts Numbered from 100 to 110. When a batch of hosts is added, the load balancer on each of the 110 hosts detects the new host. When the load balancer on any host receives a data packet, if the target RS cannot be determined by querying the mapping table, the load balancer determines the effective RS. Assume that the RS numbers 1-90 are before the new host is added. When the load balancer performs load balancing on data packets of existing services, the load balancer determines the target RS based on the quintuple of the data packet, the number of VIPs and RSs of each RS in the 90 RSs.
305、负载均衡器向所述目标RS发送所述数据包。305. The load balancer sends the data packet to the target RS.
本申请实施例中,发送数据包的负载均衡器,即目标负载均衡器和目标RS位于同一个主机或不同主机。In the embodiment of this application, the load balancer that sends the data packet, that is, the target load balancer and the target RS are located on the same host or different hosts.
本申请实施例提供的负载均衡方法,负载均衡系统中的各主机上的负载均衡器检测出负载均衡系统中新增主机时,一旦一个负载均衡器接收到数据包,倘若映射表中不存在该数据包的五元组,则从负载均衡系统包含的各主机的RS中确定出用于负载均衡的生效RS,从生效RS中选择出目标RS并将数据包发送给目标RS,从而完成第二次负载均衡。采用该种方案,每次新增主机后,负载均衡器从已生效的RS中确定出目标RS并发送数据包,确保新增主机上的负载均衡器的有充足的时间针对已有业务生成映射表,映射表中记录已有业务的五元组和RS的映射关系,避免负载均衡器将已有业务的数据包发送给不正确的RS。也就是说,每次新增主机后,该主机上的负载均衡器生效但是RS并不立即参与负载均衡,而是待新增主机上的负载均衡器的映射表中保存所有已有业务的五元组和RS的映射关系后,才将新增主机上的RS用于负载均衡,确保新增主机后已有业务的数据包发送给正确的RS,实现提高业务质量的目的的同时,无需改动交换机,减少影响面和操作复杂度。In the load balancing method provided by the embodiment of this application, when the load balancer on each host in the load balancing system detects a new host in the load balancing system, once a load balancer receives a data packet, if the load balancer does not exist in the mapping table For the five-tuple of the data packet, the effective RS for load balancing is determined from the RS of each host included in the load balancing system, the target RS is selected from the effective RS and the data packet is sent to the target RS, thereby completing the second step. Secondary load balancing. Using this solution, each time a new host is added, the load balancer determines the target RS from the effective RS and sends a data packet to ensure that the load balancer on the new host has sufficient time to generate mappings for existing services. Table, the mapping table records the mapping relationship between the quintuple of the existing business and the RS to prevent the load balancer from sending the data packets of the existing business to the incorrect RS. That is to say, every time a new host is added, the load balancer on the host takes effect but the RS does not immediately participate in load balancing. Instead, the mapping table of the load balancer on the newly added host saves all five existing services. After the mapping relationship between tuples and RSs is established, the RS on the newly added host will be used for load balancing to ensure that the data packets of existing services after the new host are added are sent to the correct RS, thereby improving service quality without any changes. switch to reduce the impact and operational complexity.
可选的,上述实施例中,负载均衡器从负载均衡系统包含的各主机的RS中确定出生效RS的过程中,确定各主机的RS的挂载时长,将挂载时长超过预设时长的RS作为生效RS。其中,挂载时长指通告时间点和接收时间点之间的时长,通告时间点是主机的RS向查询设备通告VIP的时间点,接收时间点是负载均衡器接收到数据包的时间点。通过对比挂载时长和预设时长,实现准确确定出生效RS的目的。Optionally, in the above embodiment, in the process of determining the effective RS from the RS of each host included in the load balancing system, the load balancer determines the mounting time of the RS of each host, and sets the mounting time of the RS that exceeds the preset time. RS as the effective RS. The mounting time refers to the time between the notification time point and the reception time point. The notification time point is the time point when the host's RS notifies the VIP to the query device, and the reception time point is the time point when the load balancer receives the data packet. By comparing the mounting time and the preset time, the purpose of accurately determining the effective RS is achieved.
一种方式中,每个负载均衡器记录本主机加入负载均衡系统的时间点,将该时间点作为通告时间点,负载均衡系统中的各负载均衡器之间可以相互通信。因此,负载均衡器能够确定出其他主机加入负载均衡系统的时间点,即通告时间点。主机的通告时间点即为主机上的RS的通告时间点。In one method, each load balancer records the time point when the host joins the load balancing system, and uses this time point as the notification time point. Each load balancer in the load balancing system can communicate with each other. Therefore, the load balancer can determine the time point when other hosts join the load balancing system, that is, the notification time point. The notification time point of the host is the notification time point of the RS on the host.
负载均衡器接收到数据包需要执行一致性哈希时,根据各个主机的RS的通告时间点和接收数据包的接收时间点,就能够确定出RS的挂载时长。将挂载时长超过预设时长的RS作为生效RS。预设时长例如为10分钟、8分钟、20分钟等。本申请实施例并不限制。预设时长至少能够满足:新增主机上的负载均衡器执行第二次负载均衡,以使得该负载均衡器的映射表中保存所有已有业务的五元组和RS的映射关系。When the load balancer receives a data packet and needs to perform consistent hashing, it can determine the mounting time of the RS based on the notification time point of each host's RS and the reception time point of the received data packet. The RS whose mounting time exceeds the preset time will be regarded as the effective RS. The preset time duration is, for example, 10 minutes, 8 minutes, 20 minutes, etc. The embodiments of this application are not limiting. The preset time period can at least satisfy the requirement that the load balancer on the newly added host performs the second load balancing, so that the mapping table of the load balancer stores the mapping relationship between the 5-tuples of all existing services and the RS.
另一种方式中,如图1所示,设置一个查询设备。负载均衡器检测出新增主机,接收到数据包需要执行一致性哈希时,向查询设备发送查询请求,以请求获取所述负载均衡系统包含的各主机的RS的通告时间点。查询设备接收到查询请求后,向负载均衡器发送查询响应,该查询响应携带所述负载均衡系统包含的各主机的RS的通告时间点。之后,负载均衡器根据所述接收时间点和所述各主机的RS的通告时间点,确定所述各主机的RS的挂载时长。In another way, as shown in Figure 1, a query device is set up. When the load balancer detects a new host and needs to perform consistent hashing on the received data packet, it sends a query request to the query device to request the notification time point of the RS of each host included in the load balancing system. After receiving the query request, the query device sends a query response to the load balancer, where the query response carries the notification time point of the RS of each host included in the load balancing system. Afterwards, the load balancer determines the mounting duration of the RS of each host based on the receiving time point and the notification time point of the RS of each host.
示例性的,在负载均衡器上增加query_VIP功能,用于通过查询设备获取负载均衡系统包含的各主机的RS的通告时间点。这样一来,负载均衡器每次执行一致性哈希时,无需与负载均衡系统中的其他负载均衡器交互以获取RS的通告时间点,而是仅通过一次和查询设备交互,即可确定出负载均衡系统包含的各主机的RS的通告时间点,进而确定出各主机的RS的挂载时长。For example, the query_VIP function is added to the load balancer to obtain the notification time point of the RS of each host included in the load balancing system by querying the device. In this way, each time the load balancer performs consistent hashing, it does not need to interact with other load balancers in the load balancing system to obtain the notification time point of the RS. Instead, it only needs to interact with the query device once to determine the time point. The load balancing system contains the notification time point of each host's RS, and then determines the mounting time of each host's RS.
采用该种方案,通过在负载均衡系统中设置查询设备,在负载均衡器上增加VIP查询功能,实现快速确定出各主机的RS的挂载时长的目的。Using this solution, by setting up a query device in the load balancing system and adding a VIP query function on the load balancer, the purpose of quickly determining the mounting time of each host's RS can be achieved.
可选的,上述实施例中,负载均衡器可灵活的确定出负载均衡系统中是否存在新增主机。Optionally, in the above embodiment, the load balancer can flexibly determine whether there is a new host in the load balancing system.
一种方式中,负载均衡器检测负载均衡系统中主机的数量是否发生变化。当负载均衡系统中主机的数量发生变化时,确定负载均衡系统中存在新增主机。当负载均衡系统中主机的数量未发生变化时,负载均衡器认为负载均衡系统中没有新增主机。In one approach, the load balancer detects whether the number of hosts in the load balancing system has changed. When the number of hosts in the load balancing system changes, it is determined that there are new hosts in the load balancing system. When the number of hosts in the load balancing system does not change, the load balancer considers that there are no new hosts in the load balancing system.
示例性的,每个负载均衡器实时检测负载均衡系统中RS的数量。一旦RS的数量发生变化,则表示主机的数量发生变化。因此,负载均衡器可以通过检测RS的数量快速确定出负载均衡系统中是否新增或减少主机。For example, each load balancer detects the number of RSs in the load balancing system in real time. Once the number of RS changes, it means that the number of hosts changes. Therefore, the load balancer can quickly determine whether to add or reduce hosts in the load balancing system by detecting the number of RSs.
另一种方式中,负载均衡器确定负载均衡系统中是否存在新增主机时,确定负载均衡系统包含的各主机的RS中,是否存在挂载时长未超过预设时长的RS。这是因为一个RS的挂载时长未超过预设时长时,该RS未生效时,无法参与一致性哈希运算。In another method, when the load balancer determines whether there is a new host in the load balancing system, it determines whether there is an RS in the RS of each host included in the load balancing system whose mounting time does not exceed the preset time. This is because when the mounting time of an RS does not exceed the preset time and the RS is not effective, it cannot participate in consistent hashing operations.
当负载均衡系统包含的各主机的RS中存在挂载时长未超过预设时长的RS时,确定所述负载均衡系统中存在新增主机,新增主机即为挂载时长未超过预设时长的RS。这时候,一旦负载均衡器接收到数据包需要执行一致性哈希时,则从负载均衡系统包含的所有RS中确定出生效RS,从生效RS中确定出目标RS。When the RS of each host included in the load balancing system contains an RS whose mounting time does not exceed the preset time, it is determined that there is a new host in the load balancing system, and the new host is the one whose mounting time does not exceed the preset time. RS. At this time, once the load balancer receives the data packet and needs to perform consistent hashing, it determines the effective RS from all RSs included in the load balancing system, and determines the target RS from the effective RS.
当负载均衡系统包含的各主机的RS中的挂载时长均超过预设时长,负载均衡器认为负载均衡系统中不存在新增主机。这时候,一旦负载均衡器接收到数据包需要执行一致性哈希时,则直接从负载均衡系统包含的所有RS中确定出目标RS。When the mounting time in the RS of each host included in the load balancing system exceeds the preset time, the load balancer considers that there are no new hosts in the load balancing system. At this time, once the load balancer receives the data packet and needs to perform consistent hashing, it directly determines the target RS from all RSs included in the load balancing system.
采用该种方案,考虑RS到未生效时无法用于一致性哈希运算,因此,将挂载时长未超过预设时长的RS的主机都视为新增主机,避免后续一致性哈希运算时出错,实现提高已有业务的业务质量的目的。With this solution, it is considered that RS cannot be used for consistent hashing operations when it is not effective. Therefore, hosts with RSs that have been mounted for less than the preset time are regarded as new hosts to avoid subsequent consistent hashing operations. Errors are made to achieve the purpose of improving the service quality of existing services.
图4是本申请实施例提供的负载均衡方法的另一个流程图。本实施例是从查询设备的角度说明。本实施例包括:Figure 4 is another flow chart of the load balancing method provided by the embodiment of the present application. This embodiment is explained from the perspective of the query device. This embodiment includes:
401、查询设备接收所述负载均衡系统中新增主机上的RS发送的通告请求,所述通告请求用于指示所述RS的虚拟IP地址VIP。401. The query device receives a notification request sent by the RS on the newly added host in the load balancing system, where the notification request is used to indicate the virtual IP address VIP of the RS.
402、记录所述VIP以及通告时间点,所述通告时间点是所述查询设备接收到所述通告请求的时间点,所述负载均衡系统中的生效RS是所述新增主机之前,所述负载均衡系统中的负载均衡器对已有业务的数据包进行负载均衡时涉及的RS,所述已有业务是新增主机之前所述负载均衡系统正在提供给用户的业务。402. Record the VIP and notification time point. The notification time point is the time point when the query device receives the notification request. The effective RS in the load balancing system is before the new host is added. The RS involved when the load balancer in the load balancing system performs load balancing on the data packets of existing services. The existing services are services that the load balancing system is providing to users before the new host is added.
示例性的,每次新增主机时,新增主机上的RS向查询设备发送通告请求,以通过VIP。查询设备接收到通告请求后,记录新增主机的VIP和通告时间点。可以理解的是,新增主机的时间点、新增主机上的RS的初始挂载的时间点即为所述通告时间点,即查询设备接收到通告请求的时间点。For example, each time a new host is added, the RS on the new host sends a notification request to the query device to pass the VIP. After the query device receives the notification request, it records the VIP and notification time of the new host. It can be understood that the time point when a new host is added and the time point when the RS on the new host is initially mounted is the notification time point, that is, the time point when the query device receives the notification request.
采用该种方案,通过设置一个查询设备记录各新增主机的VIP和通告时间点,便于负载均衡器从查询设备快速获取到各个RS的挂载时长,进而快速从负载均衡系统所有的RS中确定出生效RS。Using this solution, by setting up a query device to record the VIP and notification time points of each newly added host, it is convenient for the load balancer to quickly obtain the mounting time of each RS from the query device, and then quickly determine it from all RSs in the load balancing system. Effective upon birth RS.
下面,用一个例子对上述的负载均衡方法进行详细说明。示例性的,请参照图5,图5是本申请实施例提供的负载均衡方法的应用场景示意图。Below, an example is used to explain the above load balancing method in detail. For example, please refer to Figure 5 , which is a schematic diagram of an application scenario of the load balancing method provided by the embodiment of the present application.
请参照图5,新增主机之前,负载均衡系统中有3个主机,分别为主机1、主机2和主机3,主机1上部署负载均衡器1a和RS1b,主机2上部署负载均衡器2a和RS2b,主机3上部署负载均衡器3a和RS3b。18:00整时,新增主机4,主机4上部署负载均衡器4a和RS4b。负载均衡器1a上存储一个映射表,该映射表中存储五元组A和RS2b的对应关系,负载均衡器2a上的映射表存储五元组B和RS1b的对应关系,负载均衡器3a和负载均衡器4a上的映射表的为空。Please refer to Figure 5. Before the new host is added, there are three hosts in the load balancing system, namely host 1, host 2 and host 3. Load balancer 1a and RS1b are deployed on host 1, and load balancer 2a and RS1b are deployed on host 2. RS2b, load balancer 3a and RS3b are deployed on host 3. At 18:00 sharp, host 4 is added, and load balancer 4a and RS4b are deployed on host 4. A mapping table is stored on load balancer 1a, which stores the corresponding relationship between quintuple A and RS2b. The mapping table on load balancer 2a stores the corresponding relationship between quintuple B and RS1b. Load balancer 3a and load The mapping table on equalizer 4a is empty.
查询设备12上预先设置预设时长为10分钟,即自18:00起,负载均衡器4a的功能开启,但是RS4b的功能未开启,不参与一致性哈希运算。The preset time period is preset on the query device 12 to 10 minutes, that is, starting from 18:00, the function of the load balancer 4a is enabled, but the function of RS4b is not enabled and does not participate in consistent hashing operations.
18:00-18:10这段时间内,交换机13接收到终端设备14的数据包,执行第一次负载均衡。其中,数据包的五元组为五元组A,即数据包是已有业务的数据包。倘若未新增主机4,则交换机13将数据包发送给负载均衡器1a。但是,由于负载均衡器4a开启,交换机13执行第一次负载均衡,很有可能会将原本应该发送给负载均衡器1a的数据包发送给负载均衡器2a、负载均衡器3a或负载均衡器4a。During the period from 18:00 to 18:10, switch 13 receives the data packet from terminal device 14 and performs the first load balancing. Among them, the quintuple of the data packet is quintuple A, that is, the data packet is a data packet of an existing service. If host 4 is not added, switch 13 sends the data packet to load balancer 1a. However, since load balancer 4a is turned on and switch 13 performs the first load balancing, it is very likely that the data packet that should be sent to load balancer 1a will be sent to load balancer 2a, load balancer 3a or load balancer 4a. .
无论是发送给哪个负载均衡器,这个负载均衡器均确定出有效RS包括RS1b、RS2b和RS3b。因此,通过执行一致性哈希运算,确定出目标RS为RS2b,之后,将数据包发送给RS2b。No matter which load balancer it is sent to, the load balancer determines that the valid RS includes RS1b, RS2b and RS3b. Therefore, by performing a consistent hash operation, the target RS is determined to be RS2b, and then the data packet is sent to RS2b.
同理,当数据包的五元组为五元组B、第一次负载均衡应该发送给负载均衡器器2a时,交换机很有可能将该数据包发送给负载均衡器1a、负载均衡器3a或负载均衡器4a,处理方式同上,此处不再赘述。Similarly, when the quintuple of the data packet is quintuple B and the first load balancing should be sent to load balancer 2a, the switch is likely to send the data packet to load balancer 1a and load balancer 3a. Or load balancer 4a, the processing method is the same as above, and will not be described again here.
18:00-18:10这段时间内,负载均衡器4a能够建立存储所有已有业务的五元组与RS映射关系的映射表。During the period from 18:00 to 18:10, load balancer 4a can establish a mapping table that stores the mapping relationship between the five-tuple and RS of all existing services.
18:10之后,交换机接收到已有业务的数据包后,对于交换机而言,并没有新增负载均衡器(因为新增的负载均衡器在18:00时已开启),因此,交换机不会将数据包分错。数据包到达负载均衡器后,由于存在新增的RS(新增RS在18:10之后开启),导致一致性哈希运算的结果变化。但是,由于18:10之后,每个负载均衡器,包括18:00时新增的负载均衡器,均已存储所有已有业务的五元组与RS映射关系的映射表,因此,优先查询映射表。若映射表中存在数据包的五元组,则说明是已有业务的数据包,直接将五元组对应的RS作为目标RS。若映射表中不存在数据包的五元组,则说明该数据包是新业务的数据包,负载均衡器(负载均衡器1a、负载均衡器2a、负载均衡器3a或负载均衡器4a)确定出有效RS包括RS1b、RS2b、RS3b和RS4b,根据新业务的数据包的五元组和有效RS的VIP、数量等执行一致性哈希运算,从而确定出目标RS,该目标RS可能是RS1b、RS2b、RS3b或RS4b。之后,负载均衡器在本地映射表中添加新业务的数据包的五元组和目标RS的映射关系。After 18:10, after the switch receives the data packet of the existing service, there is no new load balancer for the switch (because the new load balancer was turned on at 18:00), therefore, the switch will not Splitting the packets wrongly. After the data packet arrives at the load balancer, the result of the consistent hash operation changes due to the presence of a new RS (the new RS is enabled after 18:10). However, since after 18:10, each load balancer, including the new load balancer at 18:00, has stored the mapping table of the 5-tuple and RS mapping relationships of all existing services, therefore, the mapping is queried first surface. If there is a five-tuple of the data packet in the mapping table, it means that the data packet is an existing service, and the RS corresponding to the five-tuple is directly used as the target RS. If the five-tuple of the data packet does not exist in the mapping table, it means that the data packet is a data packet of a new service, and the load balancer (load balancer 1a, load balancer 2a, load balancer 3a or load balancer 4a) determines The valid RS output includes RS1b, RS2b, RS3b and RS4b. A consistent hash operation is performed based on the five-tuple of the new service data packet and the VIP and quantity of the valid RS to determine the target RS. The target RS may be RS1b, RS2b, RS3b or RS4b. Afterwards, the load balancer adds the mapping relationship between the five-tuple of the new service's data packet and the target RS in the local mapping table.
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。The following are device embodiments of the present application, which can be used to execute method embodiments of the present application. For details not disclosed in the device embodiments of this application, please refer to the method embodiments of this application.
图6为本申请实施例提供的一种负载均衡装置的示意图。该负载均衡装置600包括:确定模块61、接收模块62、处理模块63和发送模块64。Figure 6 is a schematic diagram of a load balancing device provided by an embodiment of the present application. The load balancing device 600 includes: a determining module 61 , a receiving module 62 , a processing module 63 and a sending module 64 .
确定模块61,用于确定负载均衡系统中存在新增主机,所述负载均衡器是所述负载均衡系统包含的多个主机中的任意一个主机上的负载均衡器,所述多个主机中的每个主机上均部署负载均衡器和真实服务器RS;Determination module 61 is used to determine that there is a new host in the load balancing system. The load balancer is a load balancer on any one of the multiple hosts included in the load balancing system. Deploy load balancer and real server RS on each host;
接收模块62,用于接收数据包;Receiving module 62, used to receive data packets;
处理模块63,用于从所述负载均衡系统包含的各主机的RS中确定出生效RS,所述生效RS是新增主机之前所述负载均衡器对已有业务的数据包进行负载均衡时涉及的RS,所述已有业务是新增主机之前所述负载均衡系统正在提供给用户的业务,从所述生效RS中确定出目标RS;The processing module 63 is used to determine the effective RS from the RS of each host included in the load balancing system. The effective RS is involved when the load balancer performs load balancing on the data packets of existing services before adding a host. RS, the existing service is the service that the load balancing system is providing to the user before the new host is added, and the target RS is determined from the effective RS;
发送模块64,用于向所述目标RS发送所述数据包。The sending module 64 is used to send the data packet to the target RS.
一种可行的实现方式中,所述处理模块63从所述负载均衡系统包含的各主机的RS中确定出生效RS时,用于确定所述各主机的RS的挂载时长,将挂载时长超过预设时长的RS作为生效RS,所述挂载时长指通告时间点和接收时间点之间的时长,所述通告时间点是所述主机的RS向查询设备通告虚拟IP地址VIP的时间点,所述接收时间点是所述负载均衡器接收到所述数据包的时间点。In a feasible implementation manner, when the processing module 63 determines the effective RS from the RS of each host included in the load balancing system, it is used to determine the mounting duration of the RS of each host, and the mounting duration is The RS that exceeds the preset duration is regarded as the effective RS. The mounting duration refers to the duration between the notification time point and the reception time point. The notification time point is the time point when the host's RS notifies the virtual IP address VIP to the query device. , the receiving time point is the time point when the load balancer receives the data packet.
一种可行的实现方式中,所述发送模块64,还用于向查询设备发送查询请求,以请求获取所述负载均衡系统包含的各主机的RS的通告时间点;In a feasible implementation, the sending module 64 is also used to send a query request to the query device to request to obtain the notification time point of the RS of each host included in the load balancing system;
所述接收模块62,还用于接收来自所述查询设备的查询响应,所述查询响应携带所述负载均衡系统包含的各主机的RS的通告时间点;The receiving module 62 is also configured to receive a query response from the query device, where the query response carries the notification time point of the RS of each host included in the load balancing system;
所述处理模块63,用于根据所述接收时间点和所述各主机的RS的通告时间点,确定所述各主机的RS的挂载时长。The processing module 63 is configured to determine the mounting duration of the RS of each host based on the receiving time point and the notification time point of the RS of each host.
一种可行的实现方式中,所述确定模块61,用于确定所述负载均衡系统包含的各主机的RS中,是否存在挂载时长未超过预设时长的RS;当负载均衡系统包含的各主机的RS中存在挂载时长未超过预设时长的RS时,确定所述负载均衡系统中存在新增主机。In a feasible implementation, the determination module 61 is used to determine whether there is an RS among the RSs of each host included in the load balancing system whose mounting duration does not exceed the preset duration; when each RS included in the load balancing system When there is an RS in the host's RS whose mounting duration does not exceed the preset duration, it is determined that there is a new host in the load balancing system.
一种可行的实现方式中,所述确定模块61,用于检测所述负载均衡系统中RS的数量是否发生变化;当所述负载均衡系统中RS的数量发生变化时,确定所述负载均衡系统中存在新增主机。In a feasible implementation, the determination module 61 is used to detect whether the number of RSs in the load balancing system changes; when the number of RSs in the load balancing system changes, determine whether the load balancing system There are new hosts in .
一种可行的实现方式中,所述处理模块63从所述负载均衡系统包含的各主机的RS中确定出生效RS时,用于根据所述数据包的五元组查询映射表,所述映射表中存储五元组与RS的对应关系;当所述映射表中不存在所述数据包的五元组时,从所述负载均衡系统包含的各主机的RS中确定出生效RS。In a feasible implementation manner, when the processing module 63 determines the effective RS from the RS of each host included in the load balancing system, it is used to query the mapping table according to the five-tuple of the data packet. The corresponding relationship between the five-tuple and the RS is stored in the table; when the five-tuple of the data packet does not exist in the mapping table, the effective RS is determined from the RS of each host included in the load balancing system.
一种可行的实现方式中,所述处理模块63从所述生效RS中确定出目标RS之后,还用于在所述映射表中新增所述数据包的五元组和所述目标RS的映射关系。In a feasible implementation manner, after the processing module 63 determines the target RS from the effective RS, it is also used to add a five-tuple of the data packet and the target RS to the mapping table. Mapping relations.
一种可行的实现方式中,所述处理模块63从所述生效RS中确定出目标RS时,用于根据所述数据包的五元组、各所述生效RS的VIP、所述生效RS的数量执行一致性哈希以确定出所述目标RS。In a feasible implementation manner, when the processing module 63 determines the target RS from the effective RS, it is used to determine the target RS based on the five-tuple of the data packet, the VIP of each effective RS, and the value of the effective RS. A consistent hash is performed on the number to determine the target RS.
本申请实施例提供的负载均衡装置,可以执行上述实施例中负载均衡器的动作,其实现原理和技术效果类似,在此不再赘述。The load balancing device provided by the embodiment of the present application can perform the actions of the load balancer in the above embodiment. Its implementation principles and technical effects are similar and will not be described again here.
图7为本申请实施例提供的另一种负载均衡装置的示意图。该负载均衡装置700包括:收发模块71和处理模块72。Figure 7 is a schematic diagram of another load balancing device provided by an embodiment of the present application. The load balancing device 700 includes: a transceiver module 71 and a processing module 72 .
收发模块71,用于接收所述负载均衡系统中新增主机上的RS发送的通告请求,所述通告请求用于指示所述RS的虚拟IP地址VIP;The transceiver module 71 is configured to receive a notification request sent by the RS on the newly added host in the load balancing system, where the notification request is used to indicate the virtual IP address VIP of the RS;
处理模块72,用于记录所述VIP以及通告时间点,所述通告时间点是所述查询设备接收到所述通告请求的时间点,所述VIP和所述通告时间点用于确定所述新增主机上的RS是否转变为生效RS,所述负载均衡系统中的生效RS是所述负载均衡系统中的负载均衡器对已有业务的数据包进行负载均衡时涉及的RS,所述已有业务是新增主机之前所述负载均衡系统正在提供给用户的业务。The processing module 72 is configured to record the VIP and the notification time point. The notification time point is the time point when the query device receives the notification request. The VIP and the notification time point are used to determine the new notification time point. Whether the RS on the increased host is converted into an effective RS. The effective RS in the load balancing system is the RS involved when the load balancer in the load balancing system performs load balancing on the data packets of existing services. The existing RS The service is the service that the load balancing system is providing to the user before adding the host.
一种可行的实现方式中,所述收发模块71,还用于接收来自负载均衡器的查询请求,所述负载均衡器是所述负载均衡系统包含的各主机的负载均衡器中接收到数据包的负载均衡器;向所述负载均衡器发送查询响应,所述查询响应携带所述负载均衡系统包含的各主机的RS的通告时间点。In a feasible implementation, the transceiver module 71 is also used to receive a query request from a load balancer. The load balancer receives the data packet from the load balancer of each host included in the load balancing system. A load balancer; sends a query response to the load balancer, where the query response carries the notification time point of the RS of each host included in the load balancing system.
本申请实施例提供的负载均衡装置,可以执行上述实施例中查询设备的动作,其实现原理和技术效果类似,在此不再赘述。The load balancing device provided by the embodiment of the present application can perform the action of querying the device in the above embodiment. Its implementation principles and technical effects are similar and will not be described again here.
图8为本申请实施例提供的一种电子设备的结构示意图。如图8所示,该电子设备800例如为上述的查询设备或主机,该电子设备800包括:FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As shown in Figure 8, the electronic device 800 is, for example, the above-mentioned query device or host. The electronic device 800 includes:
处理器81和存储器82;Processor 81 and memory 82;
所述存储器82存储计算机指令;The memory 82 stores computer instructions;
所述处理器81执行所述存储器82存储的计算机指令,使得所述处理器81执行如上主机中的负载均衡器实施的负载均衡方法;或者,使得所述处理器81执行如上查询设备实施的负载均衡方法。The processor 81 executes the computer instructions stored in the memory 82, so that the processor 81 executes the load balancing method implemented by the load balancer in the host; or, causes the processor 81 to execute the load balancing method implemented by the query device as above. Equilibrium approach.
处理器81的具体实现过程可参见上述方法实施例,其实现原理和技术效果类似,本实施例此处不再赘述。The specific implementation process of the processor 81 can be found in the above method embodiments. The implementation principles and technical effects are similar and will not be described again in this embodiment.
可选地,该电子设备800还包括通信部件83。其中,处理器81、存储器82以及通信部件83可以通过总线84连接。Optionally, the electronic device 800 further includes a communication component 83 . Among them, the processor 81, the memory 82 and the communication component 83 can be connected through the bus 84.
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机指令,所述计算机指令被处理器执行时用于实现如上主机中的负载均衡器实施的负载均衡方法;或者,实现如上查询设备实施的负载均衡方法。Embodiments of the present application also provide a computer-readable storage medium. Computer instructions are stored in the computer-readable storage medium. When the computer instructions are executed by a processor, they are used to implement the load balancing implemented by the load balancer in the host as above. method; or, implement the load balancing method implemented by the query device as above.
本申请实施例还提供一种计算机程序产品,该计算机程序产品包含计算机程序,计算机程序被处理器执行时实现如上主机中的负载均衡器实施的负载均衡方法;或者,实现如上查询设备实施的负载均衡方法。Embodiments of the present application also provide a computer program product. The computer program product includes a computer program. When the computer program is executed by a processor, it implements the load balancing method implemented by the load balancer in the host as above; or implements the load balancing method implemented by the query device as above. Equilibrium approach.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求书指出。Other embodiments of the present application will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary technical means in the technical field that are not disclosed in this application. . It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求书来限制。It is to be understood that the present application is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210555137.8A CN114928615B (en) | 2022-05-19 | 2022-05-19 | Load balancing method, device, equipment and readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210555137.8A CN114928615B (en) | 2022-05-19 | 2022-05-19 | Load balancing method, device, equipment and readable storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114928615A CN114928615A (en) | 2022-08-19 |
| CN114928615B true CN114928615B (en) | 2023-10-24 |
Family
ID=82811225
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210555137.8A Expired - Fee Related CN114928615B (en) | 2022-05-19 | 2022-05-19 | Load balancing method, device, equipment and readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114928615B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10425473B1 (en) * | 2017-07-03 | 2019-09-24 | Pure Storage, Inc. | Stateful connection reset in a storage cluster with a stateless load balancer |
Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN201518488U (en) * | 2008-04-15 | 2010-06-30 | 丛林网络公司 | Server load equalizer and system thereof |
| CN104184819A (en) * | 2014-08-29 | 2014-12-03 | 城云科技(杭州)有限公司 | Multi-hierarchy load balancing cloud resource monitoring method |
| US9055076B1 (en) * | 2011-06-23 | 2015-06-09 | Amazon Technologies, Inc. | System and method for distributed load balancing with load balancer clients for hosts |
| CN106095532A (en) * | 2016-06-12 | 2016-11-09 | 北京大学 | A kind of virtual machine load balancing sacurity dispatching method in cloud environment |
| US9807016B1 (en) * | 2015-09-29 | 2017-10-31 | Juniper Networks, Inc. | Reducing service disruption using multiple virtual IP addresses for a service load balancer |
| CN108768878A (en) * | 2018-06-06 | 2018-11-06 | 北京奇艺世纪科技有限公司 | A kind of SiteServer LBS, method, apparatus and load-balancing device |
| CN109842651A (en) * | 2017-11-27 | 2019-06-04 | 中国移动通信集团上海有限公司 | A kind of continual load-balancing method of business and system |
| CN110708393A (en) * | 2019-10-21 | 2020-01-17 | 北京百度网讯科技有限公司 | Method, device and system for transmitting data |
| CN111327647A (en) * | 2018-12-13 | 2020-06-23 | 北京金山云网络技术有限公司 | A method, device and electronic device for a container to provide external services |
| CN114500545A (en) * | 2022-01-24 | 2022-05-13 | 杭州博盾习言科技有限公司 | Network load balancing method and device suitable for container and electronic equipment |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040260745A1 (en) * | 2003-06-18 | 2004-12-23 | Gage Christopher A. S. | Load balancer performance using affinity modification |
| US8326956B2 (en) * | 2006-03-31 | 2012-12-04 | Cisco Technology, Inc. | System and method for handling persistence information in a network |
| US8755283B2 (en) * | 2010-12-17 | 2014-06-17 | Microsoft Corporation | Synchronizing state among load balancer components |
| CN108769271A (en) * | 2018-08-20 | 2018-11-06 | 北京百度网讯科技有限公司 | Method, apparatus, storage medium and the terminal device of load balancing |
| US11611613B2 (en) * | 2020-07-24 | 2023-03-21 | Vmware, Inc. | Policy-based forwarding to a load balancer of a load balancing cluster |
-
2022
- 2022-05-19 CN CN202210555137.8A patent/CN114928615B/en not_active Expired - Fee Related
Patent Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN201518488U (en) * | 2008-04-15 | 2010-06-30 | 丛林网络公司 | Server load equalizer and system thereof |
| US9055076B1 (en) * | 2011-06-23 | 2015-06-09 | Amazon Technologies, Inc. | System and method for distributed load balancing with load balancer clients for hosts |
| CN104184819A (en) * | 2014-08-29 | 2014-12-03 | 城云科技(杭州)有限公司 | Multi-hierarchy load balancing cloud resource monitoring method |
| US9807016B1 (en) * | 2015-09-29 | 2017-10-31 | Juniper Networks, Inc. | Reducing service disruption using multiple virtual IP addresses for a service load balancer |
| CN106095532A (en) * | 2016-06-12 | 2016-11-09 | 北京大学 | A kind of virtual machine load balancing sacurity dispatching method in cloud environment |
| CN109842651A (en) * | 2017-11-27 | 2019-06-04 | 中国移动通信集团上海有限公司 | A kind of continual load-balancing method of business and system |
| CN108768878A (en) * | 2018-06-06 | 2018-11-06 | 北京奇艺世纪科技有限公司 | A kind of SiteServer LBS, method, apparatus and load-balancing device |
| CN111327647A (en) * | 2018-12-13 | 2020-06-23 | 北京金山云网络技术有限公司 | A method, device and electronic device for a container to provide external services |
| CN110708393A (en) * | 2019-10-21 | 2020-01-17 | 北京百度网讯科技有限公司 | Method, device and system for transmitting data |
| CN114500545A (en) * | 2022-01-24 | 2022-05-13 | 杭州博盾习言科技有限公司 | Network load balancing method and device suitable for container and electronic equipment |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114928615A (en) | 2022-08-19 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12368790B2 (en) | Multi-path transport design | |
| US9736278B1 (en) | Method and apparatus for connecting a gateway router to a set of scalable virtual IP network appliances in overlay networks | |
| Araújo et al. | Balancing on the edge: Transport affinity without network state | |
| US9037712B2 (en) | Systems and methods for self-loading balancing access gateways | |
| US9560126B2 (en) | Stateless load balancing of connections | |
| JP7313480B2 (en) | Congestion Avoidance in Slice-Based Networks | |
| US8706864B1 (en) | Behavior monitoring and compliance for multi-tenant resources | |
| US20140330977A1 (en) | Stateless recognition of keep-alive packets | |
| Kogias et al. | Bypassing the load balancer without regrets | |
| US11418582B1 (en) | Priority-based transport connection control | |
| US11997024B2 (en) | Mapping NVMe-over-fabric packets using virtual output queues | |
| US20180109456A1 (en) | System, method, and device for network load balance processing | |
| US20160261505A1 (en) | Localized service chaining in nfv clouds | |
| CN103634228A (en) | Network message transmission method and equipment | |
| US11848989B2 (en) | Separate routing of NVMe-over-fabric packets and non-NVMe packets | |
| Zhang et al. | Tripod: Towards a scalable, efficient and resilient cloud gateway | |
| Aghdai et al. | In-network congestion-aware load balancing at transport layer | |
| CN113726636B (en) | Data forwarding method and system of software forwarding device and electronic device | |
| CN114928615B (en) | Load balancing method, device, equipment and readable storage medium | |
| CN115134304A (en) | Self-adaptive load balancing method for avoiding data packet disorder in cloud computing data center | |
| US11811685B1 (en) | Selective packet processing including a run-to-completion packet processing data plane | |
| CN112073503A (en) | High-performance load balancing method based on flow control mechanism | |
| CN113595760B (en) | System fault processing method and device | |
| US20150012663A1 (en) | Increasing a data transfer rate | |
| US20240348544A1 (en) | Communication Method and Apparatus, and Communication System |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CF01 | Termination of patent right due to non-payment of annual fee | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20231024 |