Preparation

Before creating a load balancer, you must plan its region, network type, protocol, and backend servers.

Region

When you select a region, pay attention to the following:
  • The region must be close to your users' location to reduce network latency and improve the download speed.
  • The region must be the same as that of backend servers. Currently, ELB cannot be deployed across regions.

AZ

Dedicated load balancers support cross-AZ deployment. If you select more than one AZ, a load balancer will be created in each AZ, and these load balancers work in active-active mode. In this way, incoming traffic is distributed to backend servers in each AZ. If an AZ becomes faulty, traffic is distributed to backend servers in other AZs to ensure service continuity. All selected AZs share the specifications of the load balancer.

Select the AZ where backend servers reside to reduce network latency and improve access speed.

Network Type

Dedicated load balancers support three network types: IPv4 public network, IPv4 private network, and IPv6 network.
  • Select one or more types of network for each dedicated load balancer to handle different service needs.
    • If you select the public IPv4 network, the load balancer will have an IPv4 EIP bound to process requests over the Internet.
    • If you select the private IPv4 network, a private IPv4 IP address will be assigned to the load balancer to process requests within a VPC.
    • If you select IPv6, the load balancer will have an IPv6 address, which allows the load balancer to process requests within a VPC. If you have purchased bandwidth, the load balancer can process requests both over the Internet and in the VPC.
Shared load balancers can work in both public and private networks.
  • Select the public or private network based on your requirements.
    • To distribute requests over the Internet, create a public network load balancer. A public network load balancer can process requests both over the Internet and in the VPC.

      Each public network load balancer has an EIP bound to receive requests from the Internet.

    • If you want to distribute requests within a VPC, create a private network load balancer.

      Each private network load balancer has only one private IP address and is accessible only from the VPC.

Specifications

Dedicated load balancers provide a broad range of specifications to meet different requirements. Specifications for network load balancing are suitable for TCP or UDP requests, while specifications for application load balancing are broadly used to handle HTTP or HTTPS requests. Select appropriate specifications based on your traffic volume and service requirements. The following are some principles for you to select the specifications:
  • For TCP or UDP load balancing, pay attention to the number of concurrent persistent connections, and consider Maximum Connections as a key indicator. Estimate the maximum number of concurrent connections that a load balancer can handle in the actual service scenario and select the corresponding specification.
  • For HTTP or HTTPS load balancers, focus more on queries per second (QPS), which determines the service throughput of an application system. Estimate the QPS that a load balancer can handle in the actual service scenario and select the corresponding specification.
  • Combine the monitoring data from Cloud Eye to analyze the peak traffic, trend and regularity of the traffic to select the specifications more accurately.

Public or Private Network Load Balancing

According to the network type, load balancers are classified into public network load balancers and private network load balancers.
  • To distribute requests over the Internet, you need to create a public network load balancer.

    Each public network load balancer uses an EIP bound to receive requests from the Internet.

    The bandwidth that will be used by the EIP is billed by traffic or fixed bandwidth:

    • Traffic: You specify a maximum bandwidth and pay for the total outbound traffic you use. This is ideal for applications with predictable peaks and troughs in traffic.
    • Bandwidth: You specify a maximum bandwidth and pay for the amount of time you use the bandwidth. This is ideal for applications that require stable bandwidth.
  • If you want to distribute requests within a VPC, create a private network load balancer.

Protocol

ELB provides load balancing at both Layer 4 and Layer 7. Choose an appropriate protocol when adding a listener.

  • When you choose TCP or UDP, the load balancer routes requests directly to backend servers. In this process, the destination IP address in the packets is changed to the IP address of the backend server, and the source IP address to the private IP address of the load balancer. A connection is established after a three-way handshake between the client and the backend server, and the load balancer only forwards the data.

  • Load balancing at Layer 7 is also called "content exchange". After the load balancer receives a request, it works as a proxy of backend servers to establish a connection (three-way handshake) with the client and then determines to which backend server the request is to be routed based on the fields in the HTTP/HTTPS request header and the load balancing algorithm you selected when you add the listener. In this process, the load balancer functions as a proxy that connects to both the client and backend server.

Backend Server

Before you use ELB, you need to create cloud servers, deploy required applications on them, and add the cloud servers to one or more backend server groups. When creating ECSs or BMSs, note the following:

  • Cloud servers must be in the same region as the load balancer.
  • Cloud servers that run the same OS are recommended so that you can manage them more easily.