Alibaba Cloud – Server Load Balancer (SLB)

What is Alibaba Cloud Server Load Balancer (SLB)?

Alibaba Cloud Server Load Balancer (SLB) is a traffic distribution control service that distributes incoming traffic among multiple applications across multiple instances. These instances could be multiple ECS Instances, Autoscaling Groups, Microservices, and Containers, etc.

Alibaba Server Load Balancer

Server Load Balancer has built-in high availability, therefore customers don’t need to plan for the SLB high availability.

Alibaba Cloud Server Load Balancer Advantages

There are several advantages when using Server Load Balancer (SLB) for your applications,

  • SLB provides high availability by utilizing multiple Availability Zones
  • SLB can be elastically expanded according to service loading without affecting incoming traffic loads
  • It’s cost-effective compared to traditional hardware Load Balancer
  • Provides DDoS (Distributed Denial of Service Attacks) Protection
Alibaba Cloud Server Load Balancer Components

Alibaba Cloud SLB consists of three main components,

  • Server Load Balancer Instances
  • Listeners
  • Backend Servers
Server Load Balancer Instances

A Server Load Balancer instance is a running load balancing service that receives and distributes the incoming traffic to the backend servers. Backend Servers could be Alibaba multiple ECS Instances, Auto Scaling Groups, etc.

Listeners
SLB Listeners

The listener checks the client requests and forwards these requests to backend servers. You can configure multiple listeners to the same backend server using different protocols and ports. Each SLB needs at least one listener to accept incoming traffic.

  • Routing (Forwarding) Rules
  • Session Stickiness
  • Health Check Configuration
  • Peak Bandwidth

The above settings are set on listeners.

Routing (Forwarding) Rules

Listeners support three forwarding algorithms. Round Robin, Weight Round Robin, and Weight Least Connections

Routing (Forwarding) Rules Algorithms
  • Round Robin: Requests are distributed across the group of backend ECS Instances sequentially
  • Weight Round Robin: Using this rule you can manually configure weight for each backend instance (Servers). Servers having higher weights receive more requests than lower weights servers
  • Weighted Least Connections: In addition to the weight set to each backend ECS instance, the number of connections to the instance also considered

Session stickiness, a.k.a., session persistence, is a process in which a load balancer creates an affinity between a client and a specific network server for the duration of a session, (i.e., the time a specific IP spends on a website). Using sticky sessions can help improve user experience and optimize network resource usage. With sticky sessions, a load balancer assigns an identifying attribute to a user, typically by issuing a cookie or by tracking their IP details. Then, according to the tracking ID, a load balancer can start routing all of the requests of this user to a specific server for the duration of the session.

Health Check Configuration is a feature that SLB uses to identify health instances in order to forward incoming traffics.

While Health Checks ensure that request traffic is shifted away from a failed instance, you can configure HTTP, HTTPS and TCP health checks. Furthermore, you can customize the frequency, failure thresholds and list of successful response codes as well.

Peak Bandwidth you can configure per listener bases bandwidth allocation as well. If you don’t configure peak bandwidth all the listeners share the available bandwidth.

Backend Servers

Backend servers are the ECS instances added to the SLB instances to process the distributed client requests. You can group the ECS Instances hosting different applications or functioning different functions (roles) into different server groups.

There are three Server Groups that you could add ECS Instances to the SLB Instance.

  • Default Server Group: This is where you can add individual servers as backend servers (Instances)
  • VServer Groups: VServer Group is the concept that you can map the same listener to the different backend ports according to the URL configured.
  • Active/Standby Server Groups: This is where you can configure Active and Standby instances, when the Active instance stops working SLB starts to forward traffic to the Standby instance. This is customers’ selection of Active and Standby Servers manually, and not a Server Load Balancer feature of selecting instances
Alibaba Cloud Server Load Balancer Architecture

Alibaba Cloud SLB can provide OSI Layer 4 and Layer 7 load balancing according to the protocol used by different applications.

  • Server Load Balancer System consists of three parts. Those are Layer 4 SLB, Layer 7 SLB, and Control System
  • Layer 4 SLB uses the customized open-source LVS (Linux Virtual Server)
  • Layer 7 SLB uses open source software called Tengine
  • Control System is the one which is used to configure and monitor the SLB System
Alibaba Cloud Server Load Balancer Architecture
SLB Architecture Traffic Flow
Server Load Balancer – Layer 4 (Transport Layer)
  • Supports TCP and UDP with SSL
  • Operates at the OSU Model Transport Layer, which deals with the delivery of traffic with no regard to the content of the request
  • No header modification
  • Can inspect the first few packets in the TCP stream and make limited routing decisions
Server Load Balancer – Layer 7 (Application Layer)
  • Supports HTTP and HTTPS
  • Connection terminated at the load balancer level and pooled to the servers
  • Headers may be modified and the X-Forwarded-For header contains the client IP address
Alibaba Cloud Server Load Balancer Considerations
  • Alibaba Server Load Balancer supports Public and Private network scenarios. When you use SLB as Public Load Balancer you will be charged for Instance renting and Public Traffic fees. Private Network SLB is free but when use selects a large instance type you will be a charged for instance renting
  • Alibaba Cloud SLB doesn’t limit the ECS Instance Operating System as long as the applications deployed in the ECS instances are the same and data is consistent
  • Currently* the Server Load Balancer doesn’t support cross-region deployment. Therefore uses must ensure SLB and the Instances are deployed in the same region
  • Currently*, Alibaba Cloud SLB only supports for Pay As You Go (PAYG) billing method and is billed by hourly

* Screenshots captured from Alibaba Cloud Console on Oct 19, 2019.