Load Balancer Flashcards

1
Q

Means that an application / system can handle greater loads by adapting.

A

Scalability

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

What are the 2 types of Scalability

A

Vertical
Horizontal

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

Icreasing the size of the instance

A

Vertical Scalability

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

Vertical scalability is very common for ___________, such as a ____________.

A

non distributed systems
database

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

What are 2 types of services that can scale vertically?

A

RDS
ElastiCache

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

Is there’s usually a limit to how much you can vertically scale and WHY????

A

YES
Hardware limit

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

Means increasing the number of instances / systems for your application

A

Horizontal Scalability

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

____________ scaling implies distributed systems.

A

Horizontal

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

Very common for web applications /
modern applications

A

Horizontal Scalability

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

___________ usually goes hand in hand with horizontal scaling

A

High Availability

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

Means running your application / system in at least 2 data centers (== Availability Zones)

A

High Availability

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

What is the goal of high availability?

A

survive a data center loss

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

The high availability can be _________ (for RDS Multi AZ for example)

A

passive

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

The high availability can be _______ (for horizontal scaling)

A

active

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

Are servers that forward traffic to multiple servers (e.g., EC2 instances) downstream

A

Load Balances

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

READ ALL OF THESE
* 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

A

Load Balances

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

They enable the load balancer to know if instances it forwards traffic to are available to reply to requests

A

Health Checks

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

The health check is done on a ______ and a ________

A

port
route

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

If the response is not __________ (OK), then the instance is unhealthy

A

200

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

AWS has 4 kinds of managed Load Balancers

A

Classic Load Balancer
Application Load Balancer
Network Load Balancer
Gateway Load Balancer

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

(v1 - old generation) – 2009 – * HTTP, HTTPS,TCP,SSL(secureTCP)
* Supports TCP (Layer 4), HTTP & HTTPS (Layer 7)
* Health checks are TCP or HTTP based
* Fixed hostname XXX.region.elb.amazonaws.com

A

Classic Load Balancer

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

(v2 - new generation) – 2016 – * HTTP, HTTPS,WebSocket
* Is Layer 7 (HTTP)
* Load balancing to multiple HTTP applications across machines (target groups)
* Load balancing to multiple applications on the same machine (ex: containers)
* Suppor t for HTTP/2 and WebSocket
* Support redirects (from HTTP to HTTPS for example)

A

Application Load Balancer

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

(v2 - new generation) – 2017
* TCP,TLS(secureTCP),UD

A

Network Load Balancer

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

2020 –
* Operates at layer 3 (Network layer) – IP Protocol

A

Gateway Load Balancer

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

What are the 3 ways of Application Load Balancer routing tables to different target groups

A

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

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

are a great fit for micro services & container-based application (example: Docker & Amazon ECS)

A

Application Load Balancer (ALB)

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

Does ALB have a port mapping feature to redirect to a dynamic port in ECS?

A

YES

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

Application Load Balancer (v2) Target Groups (4)

A

EC2 instances (can be managed by an Auto Scaling Group) – HTTP
ECS tasks (managed by ECS itself) – HTTP
Lambda functions – HTTP request is translated into a JSON event
IP Addresses – must be private IPs

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

Can ALB’s route to multiple target groups

A

YES

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

For ALB’s, Health checks are at what level?

A

target group level

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

READ EVERYTHING
* Fixed hostname (XXX.region.elb.amazonaws.com)
* The application servers don’t see the IP of the client directly
* The true IP of the client is inserted in the header X-Forwarded-For
* We can also get Port (X-Forwarded-Port) and proto (X-Forwarded-Proto)

A

Application Load Balancer (v2)

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

(Layer 4) allow to:
* Forward TCP & UDP traffic to your instances
* Handle millions of request per seconds
* Less latency ~100 ms (vs 400 ms for ALB)

A

Network Load Balancer (v2)

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

Are used for extreme performance,TCP or UDP traffic

A

NLB

33
Q

NLB has ______ static IP per AZ, and supports assigning Elastic IP (helpful for whitelisting specific IP)

A

ONE

34
Q

Is NLB included in the AWS free Tier????

A

NO

35
Q

Network Load Balancer – Target Groups (4)

A
  • EC2 instances
  • IP Addresses – must be private IPs
  • Application Load Balancer
  • Health Checks support the TCP, HTTP and HTTPS Protocols
36
Q
  • Deploy, scale, and manage a fleet of 3rd party network virtual appliances in AWS
  • Example: Firewalls, Intrusion Detection and Prevention Systems, Deep Packet Inspection Systems, payload manipulation, …
A

Gateway Load Balancer

37
Q

Operates at Layer 3 (Network Layer) – IP Packets

A

Gateway Load Balancer

38
Q

GLB Combines 2 of the following functions

A

Transparent Network Gateway – single entry/exit for all traffic
Load Balancer – distributes traffic to your virtual appliances

39
Q

GLB uses the _________ protocol on port ______?

A

GENEVE
6081

40
Q

Gateway Load Balancer –Target Groups (2)

A
  • EC2 instances
  • IP Addresses – must be private IPs
41
Q

READ EVERYTHING
* It is possible to implement stickiness so that the same client is always redirected to the same instance behind a load balancer
* This works for Classic Load Balancer, Application Load Balancer, and Network Load Balancer
* For both CLB & ALB, the “cookie” used for stickiness has an expiration date you control
* Use case: make sure the user doesn’t lose his session data
* Enabling stickiness may bring imbalance to the load over the backend EC2 instances

A

Sticky Sessions (Session Affinity)

42
Q

2 types of Sticky Sessions – Cookie Names

A

Application-based Cookies
Duration-based Cookies

43
Q

2 types of Application-based Cookies

A

Custom cookie
Application cookie

44
Q
  • Generated by the target
  • Can include any custom attributes required by the application
  • Cookie name must be specified individually for each target group
  • Don’t use AWSALB, AWSALBAPP, or AWSALBTG (reserved for use by the ELB)
A

Custom cookie

45
Q
  • Generated by the load balancer
  • Cookie name is AWSALBAPP
A

Application cookie

46
Q
  • Cookie generated by the load balancer
  • Cookie name is AWSALB for ALB, AWSELB for CLB
A

Duration-based Cookies

47
Q
  • Enabled by default (can be disabled at the Target Group level)
  • No charges for inter AZ data
A

Cross-Zone Load Balancing for Application Load Balancer

48
Q
  • Disabled by default
  • You pay charges ($) for inter AZ data if enabled
A

Cross-Zone Load Balancing for Network Load Balancer & Gateway Load Balancer

49
Q
  • Disabled by default
  • No charges for inter AZ data if enabled
A

Cross-Zone Load Balancing for Classic Load Balancer

50
Q
  • Allows traffic between your clients and your load balancer to be encrypted in transit (in-flight encryption)
  • Used to encrypt connections
A

An SSL Certificate

51
Q

What does SSL stand for??

A

Secure Sockets Layer

52
Q

What is the newer version of SSL??

A

TLS

53
Q

What does TLS stand for??

A

Transport Layer Security

54
Q

You can manage SSL/TLS certificates using ________?

A

ACM (AWS Certificate Manager)

55
Q
  • You must specify a default certificate
  • You can add an optional list of certs to support multiple domains
  • Clients can use SNI (Server Name Indication) to specify the hostname they reach
  • Ability to specify a security policy to support older versions of SSL /TLS (legacy clients)
A

SSL Certificates - HTTPS listener

56
Q
  • Only works for ALB & NLB (newer generation), CloudFront
  • Does not work for CLB (older gen)
A

SSL – Server Name Indication (SNI)

57
Q
  • solves the problem of loading multiple SSL certificates onto one web server (to serve multiple websites)
  • It’s a “newer” protocol, and 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
A

SSL – Server Name Indication (SNI)

58
Q
  • Support only one SSL certificate
  • Must use multiple CLB for multiple hostname with multiple SSL certificates
A

Classic Load Balancer

59
Q
  • Supports multiple listeners with multiple SSL certificates
  • Uses Server Name Indication (SNI) to make it work
A

Elastic Load Balancers – SSL Certificates for Application Load Balancer (v2)

60
Q

Which 2 Load Balancers

  • Supports multiple listeners with multiple SSL certificates
  • Uses Server Name Indication (SNI) to make it work
A

Network Load Balancer
Application Load Balancer

61
Q
  • 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
  • Between 1 to 3600 seconds (default: 300 seconds)
  • Can be disabled (set value to 0)
  • Set to a low value if your requests are short
A

Deregistration Delay

62
Q
  • In real-life, the load on your websites and application can change
  • In the cloud, you can create and get rid of servers very quickly
A

What’s an Auto Scaling Group?

63
Q

READ EVERYTHING
* Scale out (add EC2 instances) to match an increased load
* Scale in (remove EC2 instances) to match a decreased load
* Ensure we have a minimum and a maximum number of EC2 instances running
* Automatically register new instances to a load balancer
* Re-create an EC2 instance in case a previous one is terminated (ex: if unhealthy)

A

Auto Scaling Group (ASG)

64
Q

Is ASG free???

A

YES .. (you only pay for the underlying EC2 instances)

65
Q

(3) Auto Scaling Group Attributes

A

A Launch Template
Min Size / Max Size / Initial Capacity
Scaling Policies

66
Q

Is it possible to scale an ASG based on CloudWatch alarms??

A

YES

67
Q

Auto Scaling Groups – Dynamic Scaling Policies (3)

A

Target Tracking Scaling
Simple / Step Scaling
Scheduled Actions

68
Q

Auto Scaling Groups – Dynamic Scaling Policies:
* Most simple and easy to set-up
* Example: I want the average ASG CPU to stay at around 40%

A

Target Tracking Scaling

69
Q

Auto Scaling Groups – Dynamic Scaling Policies:
* When a CloudWatch alarm is triggered (example CPU > 70%), then add 2 units
* When a CloudWatch alarm is triggered (example CPU < 30%), then remove 1

A

Simple / Step Scaling

70
Q

Auto Scaling Groups – Dynamic Scaling Policies:
* Anticipate a scaling based on known usage patterns
* Example: increase the min capacity to 10 at 5 pm on Fridays

A

Scheduled Actions

71
Q

Auto Scaling Groups - continuously forecast load and schedule scaling ahead

A

Predictive scaling

72
Q

4 Good metrics to scale on…

A
  • CPUUtilization: Average CPU utilization across your instances
  • RequestCountPerTarget: to make sure the number of requests per EC2 instances is stable
  • Average Network In / Out (if you’re application is network bound)
  • Any custom metric (that you push using CloudWatch)
73
Q

After a scaling activity happens, you are in the _______?

A

cooldown period

74
Q

What is the default cooldown period?

A

300 seconds

75
Q

During the cooldown period, the ASG will _________?

A

not launch or terminate additional instances (to allow for metrics to stabilize)

76
Q

Increase or decrease the current capacity of the group based on a target value for a specific metric. This is similar to the way that your thermostat maintains the temperature of your home – you select a temperature and the thermostat does the rest.

A

Target tracking scaling

77
Q

Increase or decrease the current capacity of the group based on a set of scaling adjustments, known as step adjustments, that vary based on the size of the alarm breach.

A

Step scaling

78
Q

Increase or decrease the current capacity of the group based on a single scaling adjustment.

A

Simple scaling

79
Q

READ EVERYTHING
1. If there are instances in multiple Availability Zones, choose the Availability Zone with the most instances and at least one instance that is not protected from scale in. If there is more than one Availability Zone with this number of instances, choose the Availability Zone with the instances that use the oldest launch configuration.

  1. Determine which unprotected instances in the selected Availability Zone use the oldest launch configuration. If there is one such instance, terminate it.
  2. If there are multiple instances to terminate based on the above criteria, determine which unprotected instances are closest to the next billing hour. (This helps you maximize the use of your EC2 instances and manage your Amazon EC2 usage costs.) If there is one such instance, terminate it.
  3. If there is more than one unprotected instance closest to the next billing hour, choose one of these instances at random.
A