Plan and prepare

Last Updated: Sep 04, 2017

Plan the region of the Server Load Balancer instance

Alibaba Cloud provides the Server Load Balancer service in various regions.

To provide more stable and reliable load balancing services, Server Load Balancer has deployed multiple zones in most regions for better disaster tolerance. Additionally, to improve high availability in different regions, you can deploy the Server Load Balancer instances in multiple regions and use DNS to resolve the domain name to the IP addresses of the Server Load Balancer instances.

When selecting the region, note the following considerations:

  • To reduce latency and increase the download speed, we recommend choosing a region that is physically closest to where your customers are located.

  • Server Load Balancer does not support the cross-region development. Ensure that the region is the same for the Server Load Balancer and the backend ECS instances.

Plan the instance type (Internet or intranet)

Choose the instance type according to your business. After you create a Server Load Balancer instance, a private or public IP is allocated. You can resolve a domain name to the IP to provide services.

  • The Internet Server Load Balancer instance only has a public IP, which is accessible from the Internet.

    If you choose the Internet type, you need to consider the billing method:

    • By traffic:Suitable for an application with obvious traffic changes.

    • By bandwidth:Suitable for an application with relatively stable bandwidth.

  • The intranet Server Load Balancer instance only has a private IP, which is accessible only from classic network or VPC, and cannot be accessed by the Internet.

Plan the listening protocol

Server Load Balancer supports layer-4 (TCP and UDP) and layer-7 (HTTP and HTTPS) listening.

  • Layer-4 listener distributes connection requests directly to the backend servers without modifying the HTTP headers. After the request arrives at the listener, the Server Load Balancer server uses the backend protocol port configured in the listener to create a TCP connection with the backend ECS.

  • Layer-7 listener is an implementation of reverse proxy. After the request arrives at the listener, the Server Load Balancer server uses the TCP connection to transfer the data packets instead of transferring the data packets directly to the backend ECS.

Prepare the backend servers

Before using Server Load Balancer, you have to create ECS instances and build corresponding applications. Then, add the ECS instances to a Server Load Balancer instance as the backend servers to process the distributed requests.

  • ECS region

    Ensure the region is the same for the ECS instance and Server Load Balancer instance. Also, we recommend deploying the ECS instances in different zones to improve availability.

  • ECS configurations

    Additional configuration is not required after deploying the applications. However, if you are going to create a layer-4 listener, and the ECS instances use the Linux operating system, ensure the values of the following parameters in the net.ipv4.conf file are 0:

    1. net.ipv4.conf.default.rp_filter = 0
    2. net.ipv4.conf.all.rp_filter = 0
    3. net.ipv4.conf.eth0.rp_filter = 0
  • ECS amount

    There is no restriction on the number of ECS instances added to a Server Load Balancer instance. To improve the stability and efficiency of the service, we recommend adding the ECS instances responsible for different tasks or provide different services to different Server Load Balancer instances.

Thank you! We've received your feedback.