Preparations for Creating a Load Balancer

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

Region

When you select a region, note the following:
  • The region must be close to your users to reduce network latency and improve the download speed.
  • Shared load balancers cannot distribute traffic across regions. When creating a shared load balancer, select the same region as the backend servers.
  • Dedicated load balancers support adding backend servers across VPCs using the IP as a backend function. For details, see Configuring Hybrid Load Balancing.

AZ

Dedicated load balancers can be deployed across AZs. If you select multiple AZs, a load balancer is created in each selected AZ.

Load balancers in these AZs work in active-active or multi-active mode and follow the proximity principle to route traffic. For example, traffic to backend servers in AZ 1 is distributed by the load balancer in AZ 1 or a load balancer in an AZ close to AZ 1.

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

If disaster recovery is required, create load balancers based on the scenario:

  • If requests are from the Internet, the load balancer in each AZ you select routes the requests based on source IP addresses. If you deploy a load balancer in two AZs, the requests the load balancers can handle will be doubled.
  • For requests from a private network:
    • If clients are in an AZ you have selected when you create the load balancer, requests are distributed by the load balancer in this AZ. If the load balancer is unhealthy, requests are distributed by the load balancer in another AZ you have selected.

      If the load balancer is healthy but the connections that the load balancer need to handle exceed the amount defined in the specifications, service may be interrupted. To address this issue, you need upgrade specifications.

    • If clients are in an AZ that is not selected when you create the load balancer, requests are distributed by the load balancer in each AZ you select based on source IP addresses.

Network Type

The network type can be any of the following:
  • If you select the public IPv4 network, the load balancer will have an IPv4 EIP bound to route requests over the Internet.
  • If you select the private IPv4 network, a private IPv4 IP address will be assigned to the load balancer to route requests within a VPC.
Shared load balancers can work in both public and private networks.
  • To route requests over the Internet, you need to bind an EIP to the load balancer. The load balancer also has a private IP address and can route requests in a VPC.
  • To route requests in a VPC, bind only a private IP address to the load balancer.

Specifications

Dedicated load balancers provide a broad range of specifications to meet your requirements in different scenarios. 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 metric. 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.
  • Use the monitoring data from Cloud Eye to analyze the peak traffic, trend and regularity of the traffic to select the specifications more accurately.

Protocol

ELB provides load balancing at both Layer 4 and Layer 7.

Backend Servers

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 you create ECSs or BMSs, note the following: