Deployed in clusters, Server Load Balancer (SLB) can synchronize sessions to protect the ECS instances from single points of failure (SPOFs). This improves redundancy and guarantees the service stability.

Alibaba Cloud provides the Layer-4 (TCP protocol and UDP protocol) and Layer-7 (HTTP protocol and HTTPS protocol) load balancing services.

  • Layer-4 SLB uses the open source software Linux Virtual Server (LVS) with Keepalived to achieve load balancing, and also makes some customization to it according to the cloud computing requirements.
  • Layer-7 SLB uses Tengine to achieve load balancing. Tengine, a Web server project based on Nginx, adds a wide range of advanced features dedicated for high-traffic websites.

As shown in the following figure, the Layer-4 SLB in each region is actually run in a cluster of multiple LVS machines. The cluster deployment model strengthens the availability, stability, and scalability of the load balancing services in abnormal circumstances.

Additionally, each LVS machine in the LVS cluster uses multicast packets to synchronize sessions to other LVS machines.  As shown in the following figure, session A established on LVS1 is synchronized to other LVS machines after three packets are transferred. In normal situations, the session request is sent to LVS1 as the solid line shows. If LVS1 is abnormal or being maintained, the session request will be sent to other machines working normally, as the dotted line shows. In this way, you can perform hot upgrades, machine failure maintenance, and cluster maintenance without affecting business applications.

If a connection is not established (three-way handshake is not completed), or a connection has been established but the session synchronization mechanism is not triggered, the hot upgrade does not guarantee that the connection is not interrupted and the client needs to re-initiate the connection.