Load balancing architecture method based on distributed switch and readable storage medium
By obtaining user configuration and physical machine information in the load balancing architecture, selecting and updating data forwarding paths, combining distributed and centralized load balancers, dynamically transforming fast or slow paths, centralized load balancing performance losses and distributed load balancing are solved. The problem of switch function limitations achieves efficient traffic forwarding.
Patent Information
- Application Number
- CN202410033981.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-10
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-01-10
AI Technical Summary
The existing centralized load balancing architecture has lost performance and availability stability dependent on load balancers. The stream table function of distributed switches is limited and cannot support state-based functions and global data utilization.
A load balancing architecture method based on distributed switches is proposed. By obtaining user configuration information, physical machine information and traffic attribute information, creating and selecting data forwarding paths, and using a passive health check mechanism to update the path, combining distributed and centralized loads The equalizer implements dynamic transformation of fast and slow paths.
It reduces the burden of centralized load balancing, accelerates traffic forwarding performance in special scenarios, combines the high performance of distributed switches and the integrity of centralized load balancing, and achieves improved traffic forwarding performance without sacrificing load balancing characteristics.
Smart Images

Figure CN117857440B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of load balancing architecture, and in particular to a load balancing architecture method based on a distributed switch and a readable storage medium. Background Art
[0002] Currently, in virtualized network scenarios, existing technical solutions mainly include two forms of load balancing architectures: a centralized load balancing architecture and a distributed load balancing architecture based on a distributed virtual switch.
[0003] Centralized load balancing architecture: as follows Fig.10 As shown in the figure, the load balancer is often deployed separately in a virtual machine to provide reverse proxy capabilities. As can be seen in the figure, when a client wants to access the application of the backend server, it will be forwarded through the load balancer. The load balancer has powerful functions to perform customized operations on each data packet and can support four-layer or seven-layer forwarding.
[0004] like Fig.11 As shown in the figure, the distributed load balancing architecture based on the distributed virtual switch: the load balancing forwarding capability is decentralized to the physical machine, and the destination server address is determined by specifying the host distributed virtual switch forwarding rules, and the forwarding is performed directly without the need to go through the load balancer. When the client and the server are in the same host, all traffic does not need to leave the host, which greatly improves performance.
[0005] For a typical centralized load balancing architecture, since all traffic will be forwarded through the load balancer, although the load balancer can be rich and powerful, it will cause performance loss. First, each data packet will increase the RTT (the time it takes for a network request to go from the starting point to the destination and then back to the starting point) latency by at least two hops. Secondly, the availability and stability of the load balancer directly affect the forwarding performance of the entire link. Therefore, the requirements for the load balancer are very high.
[0006] For the distributed load balancing architecture based on distributed switches, all forwarding is done based on the flow table of the distributed switch, and the functions that the flow table can perform are very limited. It supports the most basic scheduling algorithm and cannot support all state-based functions, such as session persistence. In addition, the disadvantage of distribution is that it cannot perceive global information, so functions that require the use of global data cannot be implemented, such as the scheduling strategy based on the minimum connection. Summary of the invention
[0007] The purpose of the present invention is to provide a load balancing architecture method based on a distributed switch, which solves the above technical problems pointed out in the prior art.
[0008] The present invention proposes a load balancing architecture method based on a distributed switch, comprising the following steps:
[0009] Obtain the current user's configuration information, path update instructions, current traffic attribute information, and physical machine information corresponding to the current traffic;
[0010] Creating a data forwarding path according to the configuration information; selecting a data forwarding path according to the physical machine information and the attribute information of the current traffic, and updating the data forwarding path using a passive health check mechanism;
[0011] The data forwarding path is updated according to the path update instruction.
[0012] Preferably, the configuration information includes the number of load balancing layers, session retention options, flow control options, conventional scheduling algorithm options, and client access control options and connection number control;
[0013] The physical machine information includes the client physical machine and the server physical machine;
[0014] The attribute information of the current traffic includes the source IP and the destination IP;
[0015] The number of load balancing layers is four or seven; the session persistence option is to enable session persistence or disable session persistence; the flow control option is to enable flow control or disable flow control; the conventional scheduling algorithm includes polling, weighted polling, and source address and destination address HASH; the client access control option is to support enabling the client access control option or not support enabling the client access control option.
[0016] Preferably, the source IP refers to the client physical machine IP; the destination IP refers to the server physical machine IP;
[0017] Preferably, the data forwarding path includes a fast path and a slow path;
[0018] The data forwarding path implements data forwarding based on a load balancer;
[0019] The load balancer includes a distributed load balancer and a centralized load balancer.
[0020] Preferably, the fast path implements data forwarding based on the distributed load balancer; and the slow path implements data forwarding based on the centralized load balancer.
[0021] Preferably, the selecting a data forwarding path according to the physical machine information and the attribute information of the current traffic includes the following steps:
[0022] Determine whether the client physical machine and the server physical machine are the same physical machine, and determine whether the current traffic meets the flow table matching rules;
[0023] If it is determined that the client physical machine and the server physical machine are the same physical machine and the current traffic meets the flow table matching rule, a fast path is selected;
[0024] If it is determined that the client physical machine and the server physical machine are the same physical machine and the current traffic does not satisfy the flow table matching rule, a slow path is selected;
[0025] If it is determined that the client physical machine and the server physical machine are not the same physical machine, and the current traffic meets the flow table matching rule, then a fast path is selected;
[0026] If it is determined that the client physical machine and the server physical machine are not the same physical machine and the current traffic does not satisfy the flow table matching rule, a slow path is selected.
[0027] Preferably, the flow table matching rule means that the traffic from the client requesting the server is matched by a pre-set distributed switch flow table;
[0028] Preferably, the creating a data forwarding path according to the configuration information comprises the following steps:
[0029] Determine whether the number of load balancing layers is four;
[0030] If yes, further determining whether the session persistence option is to enable session persistence;
[0031] If not, further determining whether the flow control option is to enable flow control;
[0032] If not, determine whether it is a conventional scheduling algorithm;
[0033] If not, create a fast path;
[0034] Preferably, the updating of the data forwarding path according to the path updating instruction comprises the following steps:
[0035] Get the current data forwarding path, and get the previous data forwarding path before the path update instruction;
[0036] Determining whether the data forwarding path and the previous data forwarding path are the same data forwarding path;
[0037] If yes, further determining whether the load balancer corresponding to the data forwarding path is a distributed load balancer;
[0038] If yes, then update the distributed switch flow table; if no, then update the centralized load balancer;
[0039] If it is determined that the data forwarding path and the first data forwarding path are not the same data forwarding path, further determining whether the load balancer corresponding to the first data forwarding path is a distributed load balancer;
[0040] If yes, a slow path is created and the fast path is deleted; if no, a fast path is created and the slow path is deleted.
[0041] The present invention also proposes a readable storage medium, which includes a stored program, wherein when the program is running, the device where the readable storage medium is located is controlled to execute the above-mentioned load balancing architecture method based on a distributed switch.
[0042] Compared with the prior art, the embodiments of the present invention have at least the following technical advantages:
[0043] From the analysis of the above-mentioned load balancing architecture method based on a distributed switch and the readable storage medium provided by the present invention, it can be known that in specific applications, a data forwarding path is created by obtaining the configuration information of the current user, and the data forwarding path is selected according to the obtained physical machine information and the attribute information of the current traffic. At the same time, a passive health check mechanism is used to update the data forwarding path; and the data forwarding path is updated according to the path update instruction; when creating and selecting the data forwarding path, the centralized load balancing and the distributed load balancing based on the distributed switch can be combined to reduce the burden of the centralized load balancing and accelerate the traffic forwarding performance in special scenarios; and, under the proposed load balancing architecture method, the fast path or the slow path is dynamically transformed according to the changes in the characteristics required by the load balancing; the typical centralized load balancing architecture and the distributed architecture based on the distributed switch are combined, so that the traffic forwarding performance in certain special scenarios can be accelerated without sacrificing any load balancing characteristics. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 A schematic diagram of the overall operation steps of a load balancing architecture method based on a distributed switch provided by the present invention;
[0046] Figure 2A schematic diagram of an architecture simulation of a load balancing architecture method based on a distributed switch provided by the present invention;
[0047] Figure 3 A schematic diagram of the operation steps of selecting a data forwarding path in a load balancing architecture method based on a distributed switch provided by the present invention;
[0048] Figure 4 A schematic diagram of a first fast path data link simulation in a load balancing architecture method based on a distributed switch provided by the present invention;
[0049] Figure 5 A schematic diagram of a first slow path data link simulation in a load balancing architecture method based on a distributed switch provided by the present invention;
[0050] Figure 6 A schematic diagram of a second fast path data link simulation in a load balancing architecture method based on a distributed switch provided by the present invention;
[0051] Figure 7 A schematic diagram of a second slow path data link simulation in a load balancing architecture method based on a distributed switch provided by the present invention;
[0052] Figure 8 A schematic diagram of the operation steps of creating a data forwarding path in a load balancing architecture method based on a distributed switch provided by the present invention;
[0053] Fig. 9 A schematic diagram of the operation steps of updating a data forwarding path in a load balancing architecture method based on a distributed switch provided by the present invention;
[0054] Fig.10 A data link simulation diagram of a centralized load balancing architecture provided by the prior art;
[0055] Fig.11 A data link simulation diagram of a distributed load balancing architecture provided by the prior art. DETAILED DESCRIPTION
[0056] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] The present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings.
[0058] like Figure 1As shown, the present invention proposes a load balancing architecture method based on a distributed switch, which combines a typical centralized load balancing architecture and a distributed architecture based on a distributed switch, so as to accelerate the traffic forwarding performance in certain special scenarios without sacrificing any load balancing characteristics. The method includes the following steps:
[0059] Step S10: obtaining the current user's configuration information, path update instructions, current traffic attribute information, and physical machine information corresponding to the current traffic;
[0060] The configuration information includes the number of load balancing layers, session retention options, flow control options, conventional scheduling algorithm options, and client access control options and connection number control;
[0061] The physical machine information includes the client physical machine and the server physical machine;
[0062] The attribute information of the current traffic includes the source IP and the destination IP;
[0063] The above source IP refers to the client physical machine IP; the above destination IP refers to the server physical machine IP;
[0064] It should be noted that the number of load balancing layers is generally four or seven; the session persistence option is generally to enable session persistence or disable session persistence; the flow control option is generally to enable flow control or disable flow control; the conventional scheduling algorithm generally includes polling, weighted polling, and source address and destination address HASH; the client access control option is generally to support the client access control option or not support the client access control option;
[0065] Step S20: creating a data forwarding path according to the configuration information; selecting a data forwarding path according to the physical machine information and the attribute information of the current traffic, and updating the data forwarding path using a passive health check mechanism;
[0066] The data forwarding path includes a fast path and a slow path;
[0067] The data forwarding path implements data forwarding based on a load balancer;
[0068] The load balancer includes a distributed load balancer and a centralized load balancer;
[0069] Wherein, the fast path realizes data forwarding based on the distributed load balancer; the slow path realizes data forwarding based on the centralized load balancer;
[0070] It should be noted that if Figure 2 As shown, the above fast path ( Figure 2The thick line in the middle refers to forwarding the traffic directly to the backend server (the server that actually processes the request, i.e. the server mentioned above) after matching the distributed switch flow table; the slow path ( Figure 2 The thin line in the middle means that when the traffic does not match the flow table rule, the data packet is not modified and the load balancer is requested to forward it;
[0071] The performance of the fast path forwarding mode is higher than that of the slow path because the number of traffic forwarding hops is reduced, thereby reducing the delay introduced by external load balancing; there is no need to pass through a centralized load balancer, thus reducing the performance loss caused by forwarding;
[0072] For the forwarding of the slow path, it can complete all the load balancing features; for the fast path, due to the limitations of the distributed switch's flow table, the load balancing capabilities that can be achieved through the fast path are very limited. The virtual service using this mode must meet the following requirements: only support four-layer load balancing, do not enable session persistence, do not enable flow control, the scheduling algorithm only supports polling, weighted polling, and source and destination address HASH (that is, the above-mentioned conventional scheduling algorithm), and support the client's access control and connection number control;
[0073] The above passive health check mechanism refers to Figure 2 In the "Health Check" module in , the above passive health check mechanism only checks and updates the fast path. Due to the scenario based on flow table forwarding (i.e. the above fast path), what needs to be detected is the health status between the backend servers directly connected to it; therefore, the health check of traditional load balancing cannot be applied in distributed scenarios; here we use the passive health check mechanism, that is, to count the packet loss of data packet forwarding under the current flow table rules to determine whether the backend server is available, and update the check results to the flow table rules, thereby realizing the control of data packet forwarding behavior.
[0074] Step S30: updating the data forwarding path according to the path update instruction.
[0075] It should be noted that the above-mentioned embodiment of the present application proposes a new load balancing architecture method, which combines centralized load balancing and distributed load balancing based on distributed switches, so as to reduce the burden of centralized load balancing and accelerate the traffic forwarding performance in special scenarios; and, under the proposed load balancing architecture method, the two data plane modes are dynamically transformed according to the changes in the characteristics required for load balancing (i.e., the fast path or the slow path is dynamically transformed); it combines the typical centralized load balancing architecture and the distributed architecture based on distributed switches, so that the traffic forwarding performance in certain special scenarios can be accelerated without sacrificing any load balancing characteristics.
[0076] Specifically, Figure 3 As shown, in step S20, selecting a data forwarding path according to the physical machine information and the attribute information of the current traffic includes the following steps:
[0077] Step S21: determining whether the client physical machine and the server physical machine are the same physical machine, and determining whether the current traffic meets the flow table matching rule;
[0078] The flow table matching rule means that the traffic of the client requesting the server is matched by the pre-set distributed switch flow table;
[0079] It should be noted that the above-mentioned embodiment of the present application determines whether the client (the client sending the request, that is, the source IP of the traffic) and the server (the serverless end receiving the request, that is, the destination IP of the traffic) are in the same physical machine, and at the same time determines whether the traffic can be matched by the pre-set distributed switch flow table. There are four possibilities, and the data forwarding path is selected under these four possible situations. The specific operations are shown in the following steps.
[0080] Step S22: If it is determined that the client physical machine and the server physical machine are the same physical machine, and the current traffic meets the flow table matching rule, a fast path is selected;
[0081] It should be noted that in the above embodiment of the present application, the traffic of the client requesting LB will be matched by the distributed switch flow table (i.e., the above pre-set distributed switch flow table) inside the host (i.e., satisfying the flow table matching rule), and directly forwarded to the backend server in the local machine, and the traffic does not need to leave the host (i.e., the above client physical machine and the server physical machine are the same physical machine), which is the one with the highest performance among all scenarios;
[0082] like Figure 4 As shown in the figure, client-1 and server-1 belong to the same physical machine-1, and the requested LB (LB is LoadBalancer, which distributes requests to available servers in a cluster to relieve the pressure of a single server) is created and provided through the distributed virtual switch flow table, and the address is vip-1; the VDS flow table (distributed virtual switch flow table) mainly performs two functions: matching the VIP address (vip-1); if vip-1 is matched, a backend server is selected for DNAT (address forwarding);
[0083] Above Figure 4The complete data link is (fast path): the source IP and destination IP of the client-1 request data packet are [cip1:vip1]. After reaching the VDS flow table, it matches vip-1, and according to the configured scheduling algorithm, such as polling or source address hash, server-1 is selected as the backend server; after flow table matching and operation, the address of the request data packet is converted to [cip1:rip1]; after the request data packet reaches server-1, the reply data packet is [rip1:cip1], and the reply data packet is directly forwarded to client-1 without flow table matching.
[0084] Step S23: If it is determined that the client physical machine and the server physical machine are the same physical machine and the current traffic does not satisfy the flow table matching rule, a slow path is selected;
[0085] It should be noted that if Figure 5 As shown, in the above embodiment of the present application, the traffic of the client requesting LB is not matched by the distributed switch flow table inside the host, that is, the functional characteristics of the LB cannot be directly implemented through the distributed switch, so it must be forwarded through an external independent load balancing. It is consistent with the forwarding path of a typical centralized load balancing.
[0086] Step S24: if it is determined that the client physical machine and the server physical machine are not the same physical machine, and the current traffic meets the flow table matching rule, then a fast path is selected;
[0087] It should be noted that in the above embodiment of the present application, since all the functional characteristics of the LB can be implemented by the flow table of the distributed switch (that is, the above traffic matching rules are satisfied), the traffic matching logic of the LB is configured in the distributed switch flow table of Host-1 and Host-2; VM-1's request to access the LB is matched through the flow table and the selection of the back-end server (VM-4 is selected), so the traffic is directly forwarded to VM-4 on Host-2, thereby reducing the delay introduced by the external load balancing forwarding; here, it should be noted that: for the distributed load balancing architecture, the LB implemented by the flow table will exist in the distributed switch on any physical machine;
[0088] like Figure 6As shown in the figure, client-1 and server-1 belong to the same physical machine-1, client-2 and server-2 belong to the same physical machine-2, and the LB requested by client-1 and client-2 is created and provided with services through the distributed virtual switch flow table, that is, vip-1; here, the VDS flow table mainly performs two functions: matching the VIP address (vip-1); if vip-1 is matched, a backend server is selected for DNAT;
[0089] Above Figure 6 The complete data link is: the source IP and destination IP of the client-1 request data packet are [cip1:vip1]. After reaching the VDS of physical machine-1, it is matched to vip-1 through the flow table, and server-2 is selected as the back-end server according to the configured scheduling algorithm, such as polling or source address hash; after the flow table matching and operation, the address of the request data packet is converted to [cip1:rip2] and forwarded to server-2 for processing; similarly, if client-2 accesses the LB, the same processing method is used, that is, the source IP and destination IP of the request data packet are [cip2:vip1]. After matching and processing the VDS flow table of physical machine-2, server-1 is selected as the back-end server. After DNAT conversion, the address of the request data packet is converted to [cip2:rip1].
[0090] Step S25: If it is determined that the client physical machine and the server physical machine are not the same physical machine, and the current traffic does not satisfy the flow table matching rule, a slow path is selected;
[0091] It should be noted that if Figure 7 As shown in the above embodiment of the present application, VM-2 must access the LB through external load balancing forwarding, and its corresponding backend server is VM-5. This mode is also a typical centralized load balancing traffic forwarding path;
[0092] The complete data link of the above embodiment of the present application is: the client initiates a request, and after the data packet passes through the VDS flow table of the current physical node, if no LB-related entry is matched, it will pass through the kernel forwarding logic out of the physical node and be forwarded through external load balancing;
[0093] In the above-mentioned embodiment of the present application, there are four load balancing solutions in the following scenarios; among them, the first and third cases belong to the fast path, and the data packet can be matched and forwarded through the distributed switch flow table inside the host, thereby achieving high-performance load balancing; the second and fourth cases belong to the slow path, and the data packet cannot be matched by the distributed switch flow table inside the host, so it needs to be forwarded through an external independent load balancing device;
[0094] In the first case, the traffic from the client requesting LB is in the same physical machine, which satisfies the flow table matching rules. In this case, the data packet will be directly matched by the distributed switch flow table and forwarded to the backend server in the local machine without leaving the host, which has the highest performance.
[0095] In the second case, the traffic from the client requesting LB is in the same physical machine, but does not meet the flow table rules. In this case, the LB function cannot be implemented through the distributed switch and must be forwarded through an external independent load balancing device, which is the same as the forwarding path of the traditional centralized load balancing.
[0096] For the third case, the traffic from the client requesting LB is not in the same physical machine, but meets the flow table matching rules. In this case, the LB function can be implemented by the distributed switch flow table. The request will match the logic in the distributed switch flow table of the host and select the backend server for forwarding, thereby reducing the delay introduced by the external load balancing device.
[0097] For the fourth case, the traffic from the client requesting LB is not in the same physical machine and does not meet the flow table matching rules; in this case, the LB function cannot be implemented through the distributed switch flow table and must be forwarded through an external independent load balancing device, which is the same as the traditional centralized load balancing traffic forwarding path.
[0098] Specifically, Figure 8 As shown, in step S20, creating a data forwarding path according to the configuration information includes the following steps:
[0099] Step S201: Determine whether the number of load balancing layers is four;
[0100] Step S202: If yes (if no, create a slow path), further determine whether the session persistence option is to enable session persistence;
[0101] Step S203: If not (if yes, a slow path is created), further determining whether the flow control option is to enable flow control;
[0102] Step S204: If not (if yes, create a slow path), determine whether it is a conventional scheduling algorithm;
[0103] Step S205: If no (if yes, create a slow path), then create a fast path;
[0104] It should be noted that the technical solution adopted in the above-mentioned embodiment of the present application is a creation and management operation of the life cycle of the virtual service. The data forwarding path is created through the current configuration information, so that the load balancing data forwarding strategy can be changed at any time according to the changes in data forwarding characteristics, thereby improving data forwarding efficiency and reducing server load.
[0105] Specifically, Fig. 9 As shown, in step S30, the data forwarding path is updated according to the path update instruction, including the following operation steps:
[0106] Step S31: obtaining the current data forwarding path, and obtaining the previous data forwarding path before the path update instruction;
[0107] Step S32: determining whether the data forwarding path and the previous data forwarding path are the same data forwarding path;
[0108] Step S33: If yes, further determining whether the load balancer corresponding to the data forwarding path is a distributed load balancer;
[0109] Step S34: If yes, then update the distributed switch flow table; if no, then update the centralized load balancer;
[0110] Step S35: If it is determined that the data forwarding path and the first data forwarding path are not the same data forwarding path, further determining whether the load balancer corresponding to the first data forwarding path is a distributed load balancer;
[0111] Step S36: If yes, create a slow path and delete the fast path; if no, create a fast path and delete the slow path.
[0112] It should be noted that in the above-mentioned embodiment of the present application, when the user triggers an update operation, it is first determined whether the current configuration can be implemented by a fast path or a slow path LB; the mode required by the current configuration is compared with the original mode; if they are consistent, an update operation is taken, that is, if it is distributed load balancing, the relevant flow table is updated; if it is centralized load balancing, the external load balancing instance is updated; if the mode required by the current configuration is inconsistent with the original mode; the specific operation is determined according to the mode before the update; if it is distributed load balancing before the update, the LB under the slow path is first created, and then the existing LB under the fast path is deleted; if it is centralized load balancing before the update, the LB under the fast path is first created, and then the existing LB under the slow path is deleted to achieve fast data forwarding operations.
[0113] In summary, a load balancing architecture method based on a distributed switch and a readable storage medium proposed in an example of the present invention create a data forwarding path by obtaining the configuration information of the current user, and select the data forwarding path according to the obtained physical machine information and the attribute information of the current traffic, and at the same time, adopt a passive health check mechanism to update the data forwarding path; and update the data forwarding path according to the path update instruction; when creating and selecting the data forwarding path, the centralized load balancing and the distributed load balancing based on the distributed switch can be combined to reduce the burden of the centralized load balancing and accelerate the traffic forwarding performance in special scenarios; and, in the proposed method based on the load balancing architecture, according to the characteristic changes required by the load balancing, according to the information of the client physical machine and the server physical machine and the attribute information of the current traffic, a fast path or a slow path is selected for data forwarding operations, thereby dynamically changing the fast path or the slow path; combining the typical centralized load balancing architecture and the distributed architecture based on the distributed switch, so that the traffic forwarding performance in certain special scenarios is accelerated without sacrificing any load balancing characteristics; and the load balancer of the data forwarding path can be updated and managed according to the real-time data forwarding path selection situation to improve the data forwarding efficiency.
[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. A person skilled in the art may modify the technical solutions described in the above embodiments, or replace part or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A load balancing architecture method based on a distributed switch, characterized in that: The steps are as follows: Obtain the current user's configuration information, path update instructions, current traffic attribute information, and physical machine information corresponding to the current traffic; Creating a data forwarding path according to the configuration information; and selecting a data forwarding path according to the physical machine information and the attribute information of the current traffic, and updating the data forwarding path by adopting a passive health check mechanism; updating the data forwarding path according to the path update instruction; The data forwarding path includes a fast path and a slow path; The data forwarding path implements data forwarding based on a load balancer; The load balancer includes a distributed load balancer and a centralized load balancer; The fast path implements data forwarding based on the distributed load balancer; the slow path implements data forwarding based on the centralized load balancer; The step of selecting a data forwarding path according to the physical machine information and the attribute information of the current traffic includes the following steps: Determine whether the client physical machine and the server physical machine are the same physical machine, and whether the current traffic meets the flow table matching rules; If it is determined that the client physical machine and the server physical machine are the same physical machine and the current traffic meets the flow table matching rule, a fast path is selected; If it is determined that the client physical machine and the server physical machine are the same physical machine and the current traffic does not satisfy the flow table matching rule, a slow path is selected; If it is determined that the client physical machine and the server physical machine are not the same physical machine, and the current traffic meets the flow table matching rule, then a fast path is selected; If it is determined that the client physical machine and the server physical machine are not the same physical machine, and the current traffic does not meet the flow table matching rule, a slow path is selected; The above passive health check mechanism only checks and updates the fast path, counts the packet loss of data packet forwarding under the current flow table rules to determine whether the backend server is available, and updates the inspection results to the flow table rules, thereby realizing the control of data packet forwarding behavior.
2. A method for load balancing architecture based on a distributed switch according to claim 1, characterized in that: The configuration information includes the number of load balancing layers, session retention options, flow control options, conventional scheduling algorithm options, and client access control options and connection number control; The physical machine information includes the client physical machine and the server physical machine; The attribute information of the current traffic includes the source IP and the destination IP; The number of load balancing layers is four or seven; the session persistence option is to enable session persistence or disable session persistence; the flow control option is to enable flow control or disable flow control; the conventional scheduling algorithm includes polling, weighted polling, and source address and destination address HASH; the client access control option is to support enabling the client access control option or not support enabling the client access control option.
3. A method for load balancing architecture based on a distributed switch according to claim 2, characterized in that: The source IP refers to the client physical machine IP; the destination IP refers to the server physical machine IP.
4. A method for load balancing architecture based on a distributed switch according to claim 1, characterized in that: The flow table matching rule refers to that the traffic from the client requesting the server is matched by a pre-set distributed switch flow table.
5. The method for load balancing architecture based on a distributed switch according to claim 2, characterized in that: The step of creating a data forwarding path according to the configuration information comprises the following steps: Determine whether the number of load balancing layers is four; If yes, further determine whether the session persistence option is to enable session persistence; If not, further determining whether the flow control option is to enable flow control; If not, determine whether it is a conventional scheduling algorithm; If not, a fast path is created.
6. A method for load balancing architecture based on a distributed switch according to claim 5, characterized in that: The updating of the data forwarding path according to the path updating instruction comprises the following steps: Get the current data forwarding path, and get the previous data forwarding path before the path update instruction; Determining whether the data forwarding path and the previous data forwarding path are the same data forwarding path; If yes, further determining whether the load balancer corresponding to the data forwarding path is a distributed load balancer; If yes, then update the distributed switch flow table; if no, then update the centralized load balancer; If it is determined that the data forwarding path and the first data forwarding path are not the same data forwarding path, further determining whether the load balancer corresponding to the first data forwarding path is a distributed load balancer; If yes, a slow path is created and the fast path is deleted; if no, a fast path is created and the slow path is deleted.
7. A readable storage medium, characterized in that: The readable storage medium includes a stored program, wherein when the program is executed, the device where the readable storage medium is located is controlled to execute the load balancing architecture method based on a distributed switch as described in claims 1-6 above.
Citation Information
Cited By
Switch load balancing method and system based on artificial intelligence
CN122513404A
