×
Community Blog Solving Server Reliability Problems with Server Load Balancer

Solving Server Reliability Problems with Server Load Balancer

This blog will provide information on how and which load balancing algorithms can solve server reliability issues during peak hours.

By Prashant Mishra, Alibaba Cloud MVP and CEO, Founder Click2Cloud Inc.

A Server Load Balancer is a hardware or virtual software appliance that distributes the application workload across an array of servers, ensuring application availability, elastic scale-out of server resources and supports health management of backend servers and application systems.

Alibaba Cloud Server Load Balancer helps distributes traffic among multiple VM's to improve the service capabilities of your applications.

Server Load Balancer Makes Operations Smooth

The Alibaba might be deploying lots of servers in the backend for the UI path. Different servers are deployed in the enterprise infrastructure which is running the same code on the Alibaba UI. Now, how the requests get into each of the servers? For example, a user using the Alibaba website. How does Alibaba know to re-direct a user to an instance? And how the new requests need to go to the new instance? That is when SLB's are useful. SLB helps to clear the traffic on servers and requests every single user to reach to the destination. Alibaba SLB does the routing, for example, the user's request 1 goes to server 1. Request 2 goes to the different server and so on.

1
Flow of Requests to different servers

All these requests can be from different users or the same user. So, this is server load balancing.

SLB Components

SLB consists of the following components:

  • SLB Instances

SLB instance is a running load balancing service that distributes the incoming traffic to backend servers. To use the SLB service, one must create the SLB instance and then configure the instance with at least one listener and two backend servers.

  • SLB Listeners

SLB listener checks the client request and proceeds the request to backend servers according to the configured rules. SLB listeners also perform the health checks (checks whether the two backend servers work properly or not) on the backend server.

  • Backend Servers

Backend servers are the ECS instances added to the SLB instance to process the distributed requests. One can add the ECS instances to the default server group, a VServer group or an active server group for better management.

2
Overview of SLB Components

Algorithms

Three different commonly used algorithms that companies prefer for setting up an SLB, namely round robin, least connections, and IP hash.

1) Round Robin: Sequential request distribution.

The request of every client goes in a sequence manner where the requests are re-directed to the different services in the Round Robin fashion. So, let's say there are 4 servers in the network as shown in the below diagram. The first request goes to the first server and second goes to the second and so forth. The same fashion is followed for all requests in the feature cycle. So, this is a Round Robin fashion where every server gets a new request every time.

3
Flow of Round Robin

2) Least Connections: Request sent to the least used server in the network.

To do this, the SLB needs to know which processor's which server is having the least number of resources.

4
Flow of Least Connection

It might take a while for the SLB's to identify which are the servers, which are having the least connections for the least resources. So, it needs to compute, or it needs to get meta-data information from all the servers. So, this might be a little costlier compared to Round Robin fashion.

3) IP Hash: Request sent to the server based on Client IP.

IP hashing is useful when a client sent a request and the client's request needs to be dedicatedly going to a set of servers. Re-direction can be done based on the client's IP address and only those servers which are specific to that Client's IP will be redirected to that network. This can be another strategy where some specific servers need to be given preference over others.

5
Flow of IP Hashing

Sticky Sessions (Session Information Persistence)

To understand the sticky sessions in SLB, Alibaba is one of the best examples where a user using the Alibaba cart. The user added lots of information into the cart and this cart information is stored in the session which is stored in the client site browser. The browser usually caches all the session information and keeps it and every time a new request is made this session information is shared. The browser keeps the session ID which the server has generated the previous time when a user logged in. The same session id is given every time the request is sent. If the requests are redirected to different servers, then the session id is tending to be lost. Because the first session which was generated by the server 1 might not be visible for the server 2. So, the session information is lost, and users' cart will be disappeared.

This is the problem where a user has sessions which are persisted in their browsers. This is the general use case where a user will have to handle at their application end.

6
Load Balancer with and without Sticky Sessions

Handling the Session Information Persistence Problem

To overcome the problem of session persistence a user can use the common cache, for example, Redis Cache to store their information or need to allow the SLB to go to the same instance every time.

Usage of SLB

1. Distribute incoming traffic to the network by efficiently distributing requests across multiple servers.

If there are servers which are unavailable or offline then those servers will be removed from the server load balancing setup and the request will not be re-directed to those servers.

So internally the Alibaba SLB maintains the health check of all the available servers, and the requests are redirected only to the available servers.

2. Reliability and high availability are maintained by redirecting requests only to the servers which are available in the network.

3. Ease of use in adding and removing servers in the network as per demand.

For example, let's say Alibaba wants to scale up for a great festival sale or universal sale, which is happening for some special occasion. They know the number of requests which are going to come for the UI is going to be more, so they can scale up and scale down based on the demand. So, Alibaba SLB helps in easily configuring by adding more servers with just a simple configuration change.

Key Features

  1. Session Persistence.
  2. Extremely high performance.
  3. Efficient scheduling.
  4. Multiple SLB Management approaches and billing methods.
  5. Multi-layer disaster recovery.

Conclusion

When millions of users are accessing the same website during specific time intervals, they face the problems of slow server loading which eventually leads to data loss again and again. In those tricky situations, Alibaba Cloud SLB addresses this issue, distributes all the incoming traffics wisely by creating replicas of servers & overcomes the above said problems. The features of Alibaba Cloud SLB like same-city disaster recovery, traffic distribution, reliability, time management, data security, data flow, cost-effectiveness makes Alibaba SLB more popular to solve server reliability problems.

0 0 0
Share on

PM - C2C_Yuan

75 posts | 2 followers

You may also like

Comments

PM - C2C_Yuan

75 posts | 2 followers

Related Products