ELB Flashcards

1
Q

What is the difference between availability and scaleability?

A

Scalability implies a system/application that can handle greater loads by adapting.
Availability aims to survive a data center loss, normally by running your application/system in at least 2 data centers (== AZs)

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

What is a load balancer?

A

A server that forwards traffic to multiple servers downstream.

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

Why use a load balancer?

A
  • Spread load across multiple downstream instances
  • Expose a single point of access (DNS) to your application
  • Seamlessly handle failures of downstream instances
  • Do regular health checks to your instances
  • Provide SSL termination (HTTPS) for your websites
  • Enforce stickiness with cookies
  • High availability across zones
  • Separate public traffic from private traffic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What layers does a CLB support?

A

Classic Load Balancer - supports TCP (layer 4), HTTP/S (layer 7)

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

What layer does an ALB (v2) operate on?

A

Layer 7 - HTTP

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

What does an ALB do?

A

Application Load Balancer - Load balancing to multiple HTTP applications across machines or across the same machine.
Support for HTTP/2 and WebSocket.
Support redirects (from HTTP to HTTPS for example).

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

What routing does ALB support?

A

Routing based on path in URL, hostname in URL or Query String/Headers

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

What is a good use-case for ALB and why?

A

Great fit for micro-services & container-based applications (Docker, ECS for example) - has a port mapping feature to redirect to a dynamic port in ECS.

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

What makes ALB better than CLB in terms of fit for micro-services?

A

A CLB operates on one application, so we would need multiple CLBs per application in a micro-services system.

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

What layer does an NLB operate on?

A

Network Load Balancer - Layer 4, TCP and UDP traffic to your instances

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

Describe the properties of NLB operations

A
  • Handles millions of requests per second.
  • Less latency than ALB - approx. 100ms vs 400ms for ALB#
  • One static IP per AZ - supports assigning Elastic IP (helpful for whitelisting specific IP)
  • Not included in AWS free tier
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the possible target groups for NLB?

A

EC2 instances, IP addresses (must be private IPs), ALB

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

What protocols do the NLB health checks support?

A

TCP, HTTP and HTTPS

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

What is the purpose of the GLB?

A

Gateway load balancer - deploy, scale and manage a fleet of 3rd party network virtual appliances in AWS (e.g. firewalls, intrusion detection and prevention systems, deep packet inspection systems, payload manipulation etc.)

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

What layer does GLB operate on?

A

Layer 3 - network layer

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

What functions does the GLB combine?

A
  • Transparent Network Gateway: single entry/exit for all traffic.
  • Load balancer: distributes traffic to your virtual appliances
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What type of balancer uses the GENEVE protocol?

A

GLB

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

A GLB uses a certain protocol - what is its name and the port it operates on?

A

GENEVE protocol, port 6081

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

What are the possible target groups of GLB?

A

EC2 instances, private IPs

20
Q

What is session affinity?

A

Also known as stickiness/sticky sessions - the same client is always redirected to the same instance behind a load balancer

21
Q

How does session stickiness work, and on what load balancers is it available?

A

Use a cookie to direct to instance, with an expiration date. Available on CLB and ALB

22
Q

What is a use case for session stickiness?

A

Make sure a user doesn’t lose his session data

23
Q

What is a downside of session stickiness?

A

May imbalance load over backend EC2 instances

24
Q

What is Cross-Zone Load Balancing?

A

Each load balancer instance distributes evenly across all registered instances in all AZ

25
Q

What are the aws config and cost differences for Cross-Zone Load Balancing between ALB, NLB and CLB?

A

ALB - enabled by default (can disable at the target group level), no charges for inter AZ data
NLB - disabled by default, you pay for inter AZ data if enabled (same with GWLB)
CLB - disabled by default, no charges for inter AZ data

26
Q

What does an SSL certificate do?

A

Allows traffic between your clients and load balancer to be encrypted in transit (in-flight encryption)

27
Q

What does SSL stand for?

A

Secure Sockets Layer

28
Q

What does TLS stand for?

A

Transport Layer Security

29
Q

How does HTTPS differ from HTTP?

A

HTTPS uses SSL to provide secure, encrypted traffic

30
Q

What is ACM and how does it work?

A

AWS Certificate Manager - manages SSL certificates. Can upload your own certificates which can then be assigned to an HTTPS listener.

31
Q

What does SNI stand for?

A

Server Name Indication

32
Q

What is the purpose of SNI?

A

Allows loading of multiple SSL certificates to one web server in order to serve multiple websites

33
Q

How does SNI work?

A
  • Requires the client to indicate the hostname of the target server in the initial SSL handshake
  • The server will then find the correct certificate or return the default one
34
Q

What load balancers support SNI?

A

ALB & NLB, or CloudFront

35
Q

How does CLB cope with multiple SSL certificates?

A

Must use multiple CLB with multiple hostnames for multiple SSL certificates

36
Q

What is Connection Draining?

A
  • Time to complete ‘in-flight requests’ while the instance is de-registering or unhealthy
  • Stops sending new requests to the EC2 instance which is de-registering
37
Q

What is Connection Draining also known as?

A

Deregistration delay (for ALB and NLB)

38
Q

Why would you set a long time for connection draining to take place?

A

Instance requests may be long running - e.g. file uploads.

39
Q

What is the purpose of an Auto Scaling Group?

A
  • Scale out (add EC2 instances) to match increased load
  • Scale in (remove) to match decreased load
  • Ensure we have min and max number of instances running
  • Automatically register new instances to a load balancer
  • Re-create an instance if the previous one is terminated (e.g. is unhealthy)
40
Q

What information is required for an ASG launch template?

A
  • AMI + Instance type
  • EC2 user data
  • EBS volumes
  • Security groups
  • SSH key pair
  • IAM roles for the EC2 instance
  • Network and Subnets information
  • Load balancer information
  • Instance capacity information
  • Scaling policies
41
Q

What is an example of Target Tracking Scaling?

A

Scaling according to a metric - e.g. I want average ASG CPU to stay at around 40%

42
Q

What is an example of Simple / Step Scaling?

A

When a CloudWatch alarm is triggered (e.g. CPU > 70%) then add 2 units

43
Q

What is an example of Scheduled Action Scaling?

A

Anticipate a scaling based on known usage patterns - e.g. increase the min capacity to 10 at 5pm on Fridays

44
Q

What is mean by Predictive Scaling?

A

Continuously forecast load based on historical data and schedule scaling ahead

45
Q

What are some good metrics to scale on?

A

CPU utilization, Request count per target, Average Network In / Out

46
Q

What is Scaling Cooldown?

A

After a scaling activity, there is a cooldown period during which the ASG will not launch or terminate additional instances

47
Q

What is a good method of reducing a scaling cooldown period?

A

Using a ready-to-use AMI to reduce configuration time in order to be serving requests faster.