Thursday, 2 February 2023

AWS EC2: Elastic Load Balancing


AWS Elastic Load Balancing:
  • has the task of distributing traffic throughout the cluster of servers to ensure higher responsiveness and availability of applications, websites, or databases
  • automatically distributes the incoming traffic across multiple targets, such as:
    • EC2 instances
    • containers
    • IP addresses  
             ...in one or more Availability Zones.
  • monitors the health of its registered targets, and routes traffic only to the healthy targets
  • targets can be added and removed from load balancer as the needs change, without disrupting the overall flow of requests to the application 
  • scales your load balancer as your incoming traffic changes over time
  • supports the following load balancers:  
    • Application Load Balancers
    • Network Load Balancers
    • Gateway Load Balancers
    • Classic Load Balancers 
 

 
 
 
Load balancer:
  • serves as the single point of contact for clients
  • distributes incoming application traffic across multiple targets which increases the availability of your application
  • has one or more listeners added to it

Listener:
  • checks for connection requests from clients, using the protocol and port that you configure
  • has rules defined for it
    • a default rule must be defined for each listener, additional rules can be defined optionally 
    • Rules determine how the load balancer routes requests to its registered targets
    • Each rule consists of:
      • priority
      • one or more actions
      • one or more conditions; when conditions for a rule are met, then its actions are performed
      • specified target groups
    • When load balancer receives a request, it evaluates the listener rules in priority order to determine which rule to apply, and then selects a target from the target group for the rule action.
       

Target groups:

  • Each target group routes requests to one or more registered targets, such as EC2 instances, using the protocol and port number that you specify.  
    • target can be registered with multiple target groups
    • Routing is performed independently for each target group, even when a target is registered with multiple target groups
  • health checks are configured per target group 
    • used to monitor the health of the registered targets
    • they are performed on all targets registered to a target group
    • they can be configured so that the load balancer can send requests only to the healthy targets
  • routing algorithm is configured at the target group level
    • default: round robin
    • least outstanding requests routing algorithm can alternatively be specified

References:

No comments: