Section 4: Elastic Load Balancing and Auto Scaling Flashcards

1
Q

Scaling Up (vertical scaling)

A
  • Adding resources to the instance.
  • Limitation is still have a single point of failure (SPOF).
  • Can reach limit.

Example: t2.micro, 1vCPU, 1 GB RAM to c5.xlarge, 4vCPU, 8GB RAM.

Lesson 56

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Scaling Out (horizontal scaling)

A
  • Add one or more instances.
  • Resiliency.
  • Unlimited.

Example: add more t2.micro to existing t2.micro.

Lesson 56

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Amazon EC2 Autoscaling (Dynamo and ECS also supported)

A
  • EC2 Auto Scaling launches and terminates instances dynamically.
  • Scaling is horizontal (scales out).
  • Provides elasticity and scalability.
  • Cannot scale across Regions.
  • Responds to EC2 Status Checks and CloudWatch metrics.
  • Can scale based on demand (performance) or on a schedule.
  • Scaling policies define how to respond to changes in demand.
  • Auto Scaling groups define collections of EC2 instances that are scaled and managed together.

Lesson 57

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Configuration Steps of an Auto Scaling Group

A
  1. A Launch Template specifies the EC2 instance configuration.
    1b. A Launch Configuration replaced by a Launch Template) has fewer features.
  2. Configure purchase option - On-Demand vs Spot.
  3. Configure VPC and Subnets.
  4. Attach Load Balancer.
  5. Configure health checks EC2 and ELB.
  6. Group size and scaling policies.

Lesson 57

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Launch Template information

A
  • AMI and instance type.
  • EBS volumes.
  • Security Groups.
  • Key Pair.
  • IAM Instance profile.
  • User data.
  • Shutdown behavior.
  • Termination protection.
  • Placement Group Name.
  • Capacity Reservation.
  • Tenancy.
  • Purchasing Option (e.g. Spot).

Lesson 57

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Launch Configuration information

A
  • AMI and instance type.
  • EBS volumes.
  • Security Groups.
  • Key Pair.
  • Purchasing Option (e.g. Spot).
  • IAM instance profile.
  • User data.

Lesson 57

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Amazon EC2 Auto-Scaling Health Checks

A

EC2 = EC2 status checks.
ELB = (Recommend enabling) Uses the ELB health checks in addition to EC2 health checks.

Lesson 57

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Amazon EC2 Auto Scaling Health Check Grace Period

A
  • How long time wait before checking the health status of the instance.
  • Auto Scaling does not act on health checks until grace period expires.

Lesson 57

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Amazon EC2 Auto Scaling Monitoring

A

Group Metrics (ASG):
- Data points about the Auto Scaling Group.
- 1-minute granularity.
- No charge.
- Must be enabled.

Basic Monitoring (Instances):
- 5-minute granularity.
- No charge.

Detailed Monitoring (Instances):
- 1-minute granularity.
- Charges apply.
- Enabled by default when creating launch configurations through the CLI.

Lesson 57

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Additional Scaling Settings

A
  • Cooldowns - Used with simple scaling policy to prevent Auto Scaling from launching or terminating before the effects of previous activities are visible. Default value is 300 seconds (5 minutes).
  • Termination Policy - Controls which instances to terminate first when a scale-in event occurs.
  • Termination Protection - Prevents Auto Scaling from terminating protected instances.
  • Standby State - Used to put an instance in the InService state into the StandBy state, update or troubleshoot the instance.
  • Lifecycle Hooks - Used to perform custom actions by pausing instances as the ASG launches or terminates them.
    Use case:
  • Run a script to download and install software after launching.
  • Pause an instance to process data before a scale-in (termination) (e.g. extract a log file).

Lifecycle diagram in PPT.

Lesson 57

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Load Balancing and High Availability

A
  • Distribute the connections to multiple instances (and can be in multiple AZs).
  • If an instance fails, the load balancer will re-route the connection.
  • Regularly use Auto Scaling and Load Balancing together.

Lesson 59

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

(ELB) Application Load Balancer (ALB) - Layer 7 (HTTP, HTTPS)

A
  • Operates at the request level.
  • Routes based on the content of the request (layer 7).
  • Supports path-based (URL) routing, host-based (Domain name) routing, query string parameter-based (URL) routing, and source IP address-based routing.
  • Supports instances, IP addresses, Lambda functions and containers as targets.

Load balancer protocol - HTTP, HTTPS.

Lesson 60

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

(ELB) Network Load Balancer (NLB) - Layer 4 (TCP, TLS, UDP, TCP_UDP)

A
  • Operates at the connection level.
  • Routes connections based on IP protocol data (layer 4).
  • Offers ultra-high performance, low latency, and TLS offloading at scale.
  • Can have a static IP / Elastic IP.
  • Supports UDP and static IP addresses as targets.

Lesson 60

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

(ELB) Classic Load Balancer (CLB) (deprecated) - Layer 4 and 7

A
  • Old generation, not recommended for new applications.
  • Performs routing at Layer 4 and Layer 7.
  • Use for existing applications running in EC2-Classic.

Lesson 60

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

(ELB) Gateway Load Balancer (GLB) - Layer 3

A
  • Used in front of virtual appliances such as firewalls, IDS/IPS, and deep packet inspection systems.
  • Operates at Layer 3 - listens for all packets on all ports.
  • Forwards traffic to the Target Group (TG) specified in the listener rules.
  • Exchanges traffic with appliances using the GENEVE protocol on port 6081.

Lesson 60

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Application Load Balancer (ALB) Featues

A
  • OSI Layer - 7.
  • Target Type - IP, instance, Lambda, ECS.
  • Protocol Listeners - HTTP, HTTPS, gRPC.
  • *PrivateLink support** - No.
  • Static IP address - No.
  • HTTP header based routing - Yes.
  • Source IP preservation - x-forwarded-for.
  • SSL termination - Load Balancer.

Lesson 60

17
Q

Network Load Balancer (NLB) Features

A
  • OSI Layer - 4
  • Target Type - IP, instance.
  • Protocol Listeners - TCP, UDP, TLS.
  • *PrivateLink support** - (TCP, TLS).
  • Static IP address - Yes (good for Whitelisting and Firewalls).
  • HTTP header based routing - No.
  • Source IP preservation - Native.
  • SSL termination - Load Balancer or target.

Lesson 60

18
Q

Application Load Balancer (ALB) Use Cases

A
  • Web applications with L7 routing (HTTP/HTTPS).
  • Microservices architectures (e.g. Docker containers).
  • Lambda targets.

Lesson 60

19
Q

Network Load Balancer (NLB) Use Cases

A
  • TCP and UDP based applications.
  • Ultra-low latency.
  • Static IP addresses.
  • VPC endpoints.

Lesson 60

20
Q

Gateway Load Balancer (GLB) Use Cases

A
  • Load balance virtual appliances such as:
    • Intrusion Detection System (IDS).
    • Intrusion Protection System (IPS).
    • Next generation firewalls (NGFW).
    • Web application firewalls (WAF).
    • Distributed denial of protection systems (DDoS).
  • Integrate with Auto Scaling groups for elasticity.
  • Apply network monitoring and logging for analytics.

Lesson 60

21
Q

Cross-Zone Load Balancing

A

When cross-zone load balancing is enabled:
- Each load balancer node distributes traffic across the registered targets in all enabled AZs.

When cross-zone load balancing is disabled:
- Each load balancer node distributes traffic only across the registered targets in its AZ.

With Application Load Balancers, cross-zone load balancing is always enabled.

With Network Load Balancers and Gateway Load Balancers, cross-zone load balancing is disabled by default.

Lesson 68

22
Q

Session State

A

Use case: session data such as authentication details stored in a DynamoDB table.

ElastiCache is also a popular solution for storing session-state data.

Lesson 69