EC2 instances and containers can be registered against an ELB
ELB nodes use IP addresses within your subnets, ensure at least a /27 subnet
and make sure there are at least 8 IP addresses available in that order for the ELB to scale.
An ELB forwards traffic to eth0 (primary IP address).
An ELB listener is the process that checks for the connection requests:
Listeners for CLB provide options for TCP and HTTP/HTTPS.
Listeners for ALB only provide options for HTTPS and HTTP
Listeners for NLB only provide only TCP as an option
You can attach one or more classic ELBs to your existing Auto Scaling Groups.
You can attach one or more Target Groups to your ASG to include instances behind an ALB.
The ELBs must be in same region.
Launch configuration is the template used to create new EC2 instances and includes parameters such as instance family,
instance type,AMI,keypair and security groups.
Scaling Option
What is it?
When to use?
Maintain
Ensures the required number of instances are running
Use when you always need a known number of instances running at all times
Manual
Manually change the desired capacity via console or CLI
Use when your needs change rarely enough that you are Ok! to make manual changes.
Schedule
Adjust Min/Max instances on specific dates/times or recurring time periods
Use when you know you are busy and quiet times are. Useful for ensuring enough instances are available before busy times
Dynamic
Scale in response to a system load or other triggers using metrics
Useful for changing capacity based on system usage eg if cpu hits 80%
The scaling adds or removes capacity as required to keep the metric at or close to the specified target value
A use case,when you want to keep the aggregate CPU usage of your ASG at 70%
Simple Scaling Policy
Waits until health check and cool down period expires before revaluating
This is more conservative way to add/remove instances.Useful when load is eratic.AWS recommend step scaling instead of simple in most cases
Step Scaling Policy
Increase or decrease the current capacity of your Auto Scaling group based on a set of scaling adjustments known as step adjustments
Useful when you want to vary adjustments based on the size of the alarm breach
Can also scale based on AWS SQS.
Uses a custom metric that's sent to Amazon Cloud Watch that measures the number of messages in the queue per EC2 instance in the auto scaling group.
Then use a target tracking policy that configures your ASG to scale based on the custom metric and a set target value. Cloud watch alarms invoke the scaling policy.
Use a custom backlog per instance metric to track not just the number of messages in the queue but the number available for retrieval.