Load Balancing Types/Network Modes
Load Balancing Types
Load Balancing Type | Supported Protocol |
---|---|
Request Proxy-based | HTTP, HTTPS, TCP |
Packet Forwarding-based | TCP, UDP |
Historically created instances are compatible types and can include VServer of both Request Proxy-based and Packet Forwarding-based load balancing.
The Differences Between TCP and HTTP in Request Proxy-based Load Balancing
TCP: Receives requests, selects backend nodes, establishes connections with backend nodes, and forwards content; can directly forward packets of other upper-layer protocols to backend service nodes.
HTTP: Receives requests, parses them, selects a service node cluster based on forwarding rules, chooses a backend service node using a load balancing algorithm, establishes a connection with the service node, receives responses, parses response headers, adds appropriate headers (such as Set-cookie), and returns response content to the client.
Differences between Request Proxy-based TCP and Packet Forwarding-based TCP
Request Proxy-based: it needs to maintain two TCP connections, one from the client to the CLB and the other from the CLB to the backend service node (requiring two TCP handshakes).
Packet forwarding-based: it only needs to parse and forward packets, reducing the overhead of connection establishment. The efficiency of packet forwarding is much higher than that of request proxy mode, but there are some limitations:
-
CLB will only modify the destination MAC address. It does not support backend service nodes listening to different ports, and inconsistent listening ports with service receiving ports will lead to data transmission errors.
-
The backend service node must configure the CLB service IP address.
If there is no need to listen to multiple ports on a single service node, you can choose the packet forwarding mode, which offers superior forwarding performance.
Network Modes
Public CLB
For external network CLB, the IP address providing external services is the external EIP, which is used to receive client requests from the Internet. If you need the CLB to forward external network requests, select “external network” when creating the CLB.
For EIP, you need to choose bandwidth, billing model and other attributes according to business requirements.
Private CLB
For private CLB, the IP address providing internal services is an private IP, used to receive client requests from within the private. To enable the CLB to forward private requests, select “Private” when creating the CLB. The private IP address will be allocated from the selected subnet.
Suggestions for Selection
- If the business does not need to perform load balancing based on application-layer information and only needs to monitor the service IP address and port, the packet forwarding type CLB can be selected.
- If high performance is required, the packet forwarding type CLB is also recommended.
- If load balancing needs to be performed based on application-layer information such as URLs or domain names, or if HTTP health probes or HTTPS SSL offloading are required, the request proxy type CLB should be selected.