ELB and ASG Flashcards

1
Q

Describe scalability and compare vertical vs horizontal scalability?

A

Scalability means the system can handle greater loads by adapting
- Vertical scalability: Increasing the size/power of the underlying infra
- Horizontal scalability: Increasing the number of instances within the system

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

What is an ELB?

A

An ELB is an Elastic Load Balancer which provides a singular access point which will distribute incoming traffic to multiple downstream instances

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

What are the purposes of health checks?

A

Allows an Elastic Load Balancer to mark instances as unhealthy, meaning it wont be forwarded traffic

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

What are the 4 types of managed load balancers?

A
  1. Classic load balancer (Depreciated)
  2. Application load balancer
  3. Network load balancer
  4. Gateway load balancer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What layer does the ALB work on? What are the best use cases for ALB?

A

Layer 7, so it supports HTTP/HTTPS and redirects and mainly works with the url. Best supports microservices and container based applications (Docker and ECS).

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

How can an application behind a application load balancer determine the IP address of the client?

A

It is stored in the X-Forwarded-For header aswell as having X-Forwarded-Port and X-Forwarded-Proto

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

What layer does NLB work on? What does this mean and what are it’s main characteristics?

A

Layer 4, so deals with TCP and UDP traffic to instances. Can handle millions of requests per second and are ultra-low latency

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

How many IP’s can an NLB have per AZ?

A

One static IP per AZ and supports assigning elastic ip

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

What protocols does the NLB support for health checks?

A

TCP, HTTP and HTTPS

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

When would you want to use a GLB?

A

When you require all traffic to come through a firewall, intrusion detection system, or deep packet inspection system

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

What layer does GLB work on?

A

Layer 3, using the GENEVE protocol on port 6081

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

What is the use case of a sticky session (session affinity)?

A

When you require a client to always be redirected to the same instance behind the load balancer

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

What 2 cookies does sticky sessions use?

A
  1. Application-based cookie (can be custom or application cookie)
  2. Duration-based cookie
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Describe how traffic is distributed when cross zone load balancing is enabled versus disabled.

A

Enabled - Each load balancer instance distributes evenly across all registered instances in AZ
Disabled - Requests are only distributed across the nodes that are attached to the load balancer

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

Which load balancers have cross zone load balancing enabled by default with no charges for inter AZ data, and which have it disabled with charges?

A

Application load balancer - Enabled by default with no charges
Network load balancer and Gateway load balancer - Disabled with charges

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

What does Server Name Indication (SNI) allow you to do?

A

Allows you to require the client to indicate the hostname of the target serer on the initial SSL handshake allowing the webserver to find the correct certificate (requires ALB or NLB)

17
Q

What is a Deregistration Delay?

A

A configurable delay prior to terminating an EC2 instance to allow in-flight requests

18
Q

What does an ASG allow you to do?

A

Scale out (add) or scale in (remove) EC2 instances to match the load to the application aswell as managing the termination and reprovisioning of unhealthy EC2 instances

19
Q

What is the purpose of a launch template for ASG’s?

A

Define things like the AMI/Instance type, EC2 User Data, EBS volumes, security groups etc

20
Q

What service enables auto scaling with ASG?

A

CloudWatch alarms can be configured to track metrics like Average CPU (or custom metrics) to calculate the number of instances that should be running

21
Q

What two types of scaling fall under dynamic scaling?

A
  1. Target tracking - Average CPU to stay around X
  2. Simple / step - When a CloudWatch alarm is triggered, add X units
22
Q

If you are aware of patterns in traffic coming to your application, what scaling method could be useful?

A

Scheduled scaling - Increase capacity to X at 5pm on Fridays

23
Q

What scaling method allows AWS to automatically scale your application based on forecasted traffic?

A

Predictive scaling

24
Q

Shortly after a scaling activity occurs, the traffic to the application drastically falls however no new scaling activity occurs. What is a possible cause?

A

The cooldown period (default of 300 seconds) is a period of time where no new scaling activity will occur after a scaling activity is completed.

25
Q

Suppose you need to relaunch all EC2 instances within an ASG due to an updated launch template, how can this be achieved?

A

Use the instance refresh feature which will roll out the update periodically