← AWS SAA

Note for Elastic Load Balancing

awselb

ELB


CLB

ALB
Work on OSI layer 7 HTTP
Route routing
Hostname routing
Query string routing

Target Groups
EC2 instances(can also use with ASGs)
ECS
Lambda functions
Gets a fix hostname
App server can’t see the ip of the client,
Ip inserted through X-forwarded ip and X-forwarded port
Load balancer talk to the EC2 instance privately


NLB
Layer 4 (works with UDP, TCP)
High performance
Ultra low latency
Has one static IP per AZ, support Assigning Elastic IP
Used for extreme performance

Target Groups
EC2 instances
Private Ips (hard coded)
Load balancer (LB will get static ips)


GWLB
To analyze the traffic by sending third party security group which is inside target group
and send the traffic to the GWLB and the GWLB send that traffic to the application server
Operates on Layer 3 IP packets
Combines 2 functions - transparent network gateway(single entry/exit), loadbalancer
GENEVE protocol on port 6081 (GWLB)


Sticky Sessions
Application based cookie
Custom cookie 

Application Cookie

Duration based cookies


Cross Load balancing
Distribute traffics evenly even in the different zones
Application Load Balancer

NLB & GWLB

Classic Load Balancer

Sever Name Indication (SNI)
Can use multiple SSL certificates for various domains
each SSL will be correctly used for the target domain
Only works for ALB, NLB(Newer LB) and cloudfront
Not working for CLB (older gen)
CLB-only one SSL can be used, must use multiple SSL for multiple hostname with multiple SSL certificates
ALB, NLB - can be used with multiple listeners and SSL. Use with (SNI)


Connection Draining
Connection Draining for CLB
Deregistration Delay for ALB,NLB
Time to complete inflight request when the instance is unhealthy or deregistering
Stop sending new request to that
Can be disabled by setting value 0
Can set between 1-3600s
Set low values if the request process time is short


ASG
Minimum capacity - the minimum capacity of instances
Desired Capacity - the capacity of instances that you want
Maximum Capacity - the maximum capacity that you want

Launch Template

Scaling Policies
Can be scaled using Cloudwatch metrics

Dynamic Scaling
Target Tracking

Step Scaling(for example)

Schedule scaling

Good metrics to scale on
CPU utilization
Request count per target
Average Network in and out
Any custom metrics push to cloud watch
300s cooldown effect
during cooldown period ASG will no launch or terminate new instances