ELB instances are deployed in clusters to synchronize sessions and protect backend servers from SPOFs, improving redundancy and ensuring service stability. Layer-4 ELB uses the open-source Linux Virtual Server (LVS) and Keepalived software to balance loads, whereas Layer-7 ELB uses Tengine. Tengine, a web server project launched by Taobao, is based on NGINX and adds advanced features dedicated for high-traffic websites.
To provide more stable and reliable load balancing services, you can deploy ELB instances across multiple zones in most regions to achieve cross-data-center disaster recovery. Specifically, you can deploy a ELB instance in two zones within the same region whereby one zone acts as the primary zone and the other acts as the secondary zone. If the primary zone suffers an outage, a failover is triggered to redirect requests to the servers in the secondary zone within approximately 30 seconds. After the primary zone is restored, traffic will be automatically switched back to the servers in the primary zone.
In the context of one ELB instance, traffic distribution for your applications can still be compromised by network attacks or invalid ELB configurations, because the failover between the primary zone and the secondary zone is not triggered. As a result, the load-balancing performance is impacted. To avoid this situation, you can create multiple ELB instances to form a global load-balancing solution and achieve cross-region backup and disaster recovery. Also, you can use the instances with DNS to schedule requests so as to ensure service continuity.
With health check enabled, ELB verifies the availability of backend ECC instances (or backend servers), and thus improves the availability of frontend services by minimizing downtime that is caused by health issues of ECC instances.
After you enable the health check feature, when an ECC instance is detected unhealthy, ELB distributes new requests to other healthy ECC instances. ELB will only send requests to this backend ECC instance when it is restored and considered healthy.