In this article, we will understand the Server Load Balancer (SLB) of Networking Services on Alibaba Cloud. Load Balancer Services are available with every public cloud service provider but Alibaba Cloud Server Load Balancer Services offer so many other features for your enterprise level load balancing requirements. Server Load Balancer is basically a traffic distribution service that redirects the incoming traffic to ECS instances of your Alibaba Cloud to balance the incoming load for internet and intranet service based on that Public IP or Private IP assigned by the system. So, we have internet facing and private intranet purposes in both load balancing services together.
In this, we need to configure the load balancing forwarding rules to distribute incoming traffic. Alibaba Cloud SLB has more application service capabilities and more enhanced application availability as well. Alibaba Cloud SLB is basically a converted, available, ECS instance back-end pool into a high performance and highly available application service pool by applying virtual service addresses. And, it distributes the incoming traffic requests to ECS instances in the back-end Instance Server pool on the basis of set forwarding rules.
Alibaba Cloud SLB checks the Health Probe status of available ECS Instances and if an unhealthy threshold is found, then it automatically isolates those instances to eliminate a single point of failure. In addition to that, Alibaba Cloud SLB incorporates integrated 5 GBPS DDoS Attack Resistance Service to protect your application services on ECS Instances.
To use SLB, we must create at least one listener and two back-end pool ECS instances. Listener actually checks the health of ECS and forwards the requests to the back-end ECS Instances. We may have multiple Listeners as well. Alibaba Cloud SLB provides the Layer - 4 Transport Layer (TCP and UDP Protocol) and Layer - 7 Application Layer (HTTP and HTTPS Protocol) Load Balancing Services to the user. Transport Layer SLB uses the open source software called LVS (Linux Virtual Server) with Keepalived to get load balancing service. And, the Application Layer (Layer-7) SLB uses Tengine (Nginx Based Web Server Project) to get load balancing service.
Alibaba Cloud SLB uses the Health Check feature which automatically blocks the abnormal ECS Instances and redirects those requests automatically when they become normal again in. During configuration, we need to set the threshold to check if an ECS Instance is normal or not. So, in this case, we need to set two thresholds - unhealthy and healthy - in Health Check of SLB. Alibaba Cloud SLB also supports Session Persistence feature in which we can set the Listener rules to forward the same client requests to the same ECS Instance until the session life cycle of that client with ECS Instance ends.
Alibaba Cloud SLB provides three routing methods to configure the distribution of load towards back-end pool ECS instances.
- Round Robin Routing Method
- Weighted Round Robin
- Weighted List Connections
In Round Robin Clients, the requests are distributed sequentially towards ECS instances back-end pool. In the Weighted Round Robin Routing Method, we can set the weight of each ECS Instance like 70-30, 60-40 etc. so that the higher weighted instances will get more requests out of total incoming requests. In the third one, Weighted List Connections Routing Method, we can set the number of connections to the instance along with the weights; so sometimes, if both have the same weight at any point of time, the SLB will redirect the live connections to the instances which have fewer connections.
One more important facility that SLB offers is URL-based routing so that SLB can redirect the traffic or requests to a back-end instance based on URLs. We can configure the Alibaba Cloud SLB across multiple zones of the region as well; so that if sometimes, one zone is performing abnormally, SLB will automatically redirect all the traffic from there to zone 2 which is normal. For security reasons, we can also add whitelist IP addresses to our SLB so that they can access our Server Load Balancer.
In Layer 7 Application Layer Server Load Balancer, we have centralized certificate management service for HTTPS Listeners, using which, we have no need to upload certificates to ECS instances of our back-end pool. So cryptographic and deciphering computation CPU overhead is not on ECS instances. Also, we have bandwidth peak features by which we can set the peak bandwidth per listener based on the type of application service provided by back-end pools.
One more added feature in Alibaba Cloud Server Load Balancer is Cross Region Disaster Tolerance, in which we can configure Server Load Balancer instances in different regions and we can add ECS instances in different zones of the regions to server load balancer along with DNS Service. So, the DNS will resolve the domain name to the IP Addresses of the Server Load Balancer in different regions. So, if one region becomes unavailable we can stop domain name resolution for the unavailable region. So, ultimately, our users' access to the instances will not be affected. So Alibaba Cloud Server Load Balancer is a Cross Region Disaster Tolerance Service.
However, we need to take care of the default limits while using Alibaba Cloud Server Load Balancer like we can have 60 instances (Default) but if we raise tickets, Alibaba Cloud team may enhance it for us. Listener limitation is 50; and at one time, we can add and delete a maximum of 20 instances to our Server Load Balancer.