Elastic Load Blancing
Should really be a heading under EC2, as is organised by AWS itself.
Can be configured with ECS
2. Deregistration delay
Elastic Load Balancing stops sending requests to targets that are deregistering. By default, Elastic Load Balancing waits 300 seconds before completing the deregistration process, which can help in-flight requests to the target to complete. To change the amount of time that Elastic Load Balancing waits, update the deregistration delay value.
Compare with Auto Scaling Group:
- This works in load balancing
- This controls the request being sent from ELB to an Auto Scaling Group.
3. ALB (Application Load Balancer)
3.1. Dynamic host port mapping
Used with ECS, with dynamic host port mapping, multiple tasks from the same service are allowed for each EC2 container instance. Basically we are using that single instance as an Auto Scaling Group.
3.2. Sticky session in ALB
ALB can turn on sticky sessions, but the traffic will be sent at the target group level.
See also: Sticky session in CLB
4. Network Load Balancer
Operates at Layer 4 of Open Systems Interconnection (OSI) Model.
4.1. Target type
- EC2 instance
- The targets are specified by instance ID.
- ip
- The targets are speicified by IP address
- Application Load Balancer
- The target is an ALB (Application Load Balancer)
5. Classic Load Balancer
CLB routes each request independently to the registered EC2 instance with the smallest load.
5.1. Sticky session in CLB
Sticky sessions allow you to bind a user's session to a specific EC2 instalce.
Useful when you are storing information locally to the instance and make sure users stick to the same EC2 instance. However the EC2 instance can be removed from an auto scale-in. Not suitable when you want to preserve in-flight request. For this purpose you should set Deregistration delay to a higher value (default is 300 seconds).
See also: Sticky session in ALB