High Availability & Scalability Flashcards

1
Q

_______ are crucial for load balancers and they enable the load balancer to know if instances it forwards traffic to are available to reply to requests and health check is done on a port and a route (/health is common) and if the response is not 200 (OK) the the instance is unhealthy

A

Health checks

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

What are the different types of load balancer on AWS?

A
  1. Classics load balancer
  2. application load balancer (HTTP, HTTPS, TCP, SSL (secure TCP)
  3. Network load balancer (TCP, TLS (secure TCP), UDP)
  4. Gateway load balancer (operates at layer 3)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Application load balance is a __________ (HTTP)

A

Layer 7

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

_____________ load balancing to multiple HTTPS applications across machines (target groups) and multiple applications on the same machine (ex containers) and it support for HTTP/2 and websocket and 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
5
Q

Application load balancer supports __________

A

Route routing ( routing based on path in URL, host name in URL, query string, headers)

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

ALB (Application load balancer) are a great fit for ___________ applications

A

Micro services & container based application (ex. Docket & Amazon ECS)

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

What are the different target groups for application load balancer?

A
  1. EC2 instance (can be managed by an auto scaling group)- HTTP
  2. ECS task (managed by ECS itself)- HTTP
  3. Lambda functions - HTTP request is translated into a JSON event
  4. IP addresses- must be private IPs

ALB can route multiple target groups & health checks are at the target group level

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

What are some features should know about application load balancer?

A
  • Fixed host and (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)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Network load balancer (layer 4) allows you to do what?

A
  1. Forward TCP & UDP traffic to your instances
  2. Handle millions of request per seconds
  3. Less latency - 100ms (vs 400 ms for ALB)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Network load balancer (NLB) has _____________ per AZ and supports assigning elastic IP(helpful for whitelisting specific IP)

A

one static IP per AZ

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

What are the target groups for network load balancer?

A
  1. EC2 instances
  2. IP Addresses (must be private IP)
  3. Application load balancer
  4. Health checks supports the TCP, HTTP, and HTTPS protocols
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

___________ is used to deploy, scale, and manage a fleet of 3rd party network virtual appliances in AWS

A

Gateway Load Balancer

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

What are some features of gateway load balancer?

A
  • Operates at layer 3 (Network layer) - IP packets
  • Combines the following functions:
    1. Transparent network gateway- single entry/exit for all traffic
  1. Load balancer- distributes traffic to your virtual appliances
  2. Uses the GENEVE protocol on port 6081
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the target groups for gateway load balancer?

A
  1. EC2 instances
  2. IP addresses (must be private IPs)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does a gateway load balancer work?

A
  1. Users (source) use route table
  2. That route table sends traffic to the gateway load balancer
  3. The gateway load balancer send that traffic to your target group
  4. Target groups sends the traffic back to gateway load balancer
  5. The gateway load balancer sends traffic to your application
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

It’s possible to implement ___________ so that the same client is always redirected to the same instance behind a load balancer

A

stickiness (sticky sessions)

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

__________ works for classic load balancer, application load balancer, and network load balancer

A

Sticky session (the cookie used for stickiness has an expiration date you control) (NLB can work without cookies)

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

What are the use case for sticky sessions?

A

To make sure the user doesn’t lose his session data

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

What are the two types of cookies you can have for sticky sessions?

A
  1. Application- based cookies
    - Custom cookie that is generated by the target & dont use AWSALB, AWSALBAPP, or AWSALBTG when naming your cookie (it’s reserved for use by the ELB)
  2. Duration - based cookie
    - Cookie generated by the load balancer
    - Cookie name is AWSALB for ALB, AWSELB for CLB
20
Q

With __________ each load balancer instance distribute evenly across all registered instances in all AZ

A

Cross - Zone load balancing

21
Q

Without _________ request are distributed in the instance of the node of the elastic load balancer

A

Without cross zone balancer

22
Q

With the ________ by default the cross zone load balancing is enabled (but can be disabled at the target group level) & no charges for inter AZ data

A

Application load balancer

23
Q

With ____________ cross zone balancing is disabled by default and if enabled will have to pay for inter AZ

A

Network load balancer and & gateway load balancer

24
Q

An _____________ allows traffic between your client and your load balancer to be encrypted in transit ( in flight encryption)

A

SSL certificate

25
Q

__________ refers to secure socket layer, used to encrypt connections

A

SSL

26
Q

__________ refers to transport layer security, which is a newer version& nowadays it’s mainly used but people still refer as SSL

A

TLS

27
Q

Clients use ______ to specify the host name they reach

A

SNI (server Name indication)

28
Q

_______ solves the problem of loading multiple SSL certificates onto one web server (to serve multiple websites) & it’s a “newer” protocol & requires the client to Indi image the host name of the target server in the initial SSL handshake

A

SNI (only works for ALB & NLB)

29
Q

________ support only one SSL certificate and must use multiple CLB for multiple hostname with multiple SSL certificates

A

Classic load balancer (v1)

30
Q

____________ supports multiple listeners with multiple SSL certificates & uses server name indication (SNI) to make it work

A

Application load balancer (v2)

31
Q

___________ supports multiple listeners with multiple SSL certificates & uses SNI to make it work

A

Network load balancer (v2)

32
Q

When using a CLB connection draining is called __________

A

Connection draining

33
Q

When using an ALB & NLB connection draining is called what?

A

Deregistration delay

34
Q

___________ gives time to complete “in flight request” while the instance is De-registering or unhealthy and once it’s done the ELB will stop sending new request to the EC2 jbstance which is De-registering (can setup parameters for 5 mind & can be fisabled by setting the vsl you e to 0)

A

Connection draining

35
Q

How does connection draining work?

A
  1. When an instance is in draining mode, the users that are connected with the ELB are waiting for existing connections to be completed
  2. If new users try to connect to the ELB then the ELB will only establish new connections with other EC2 instances
36
Q

With connection draining with you set it to a _______ value your request must be short

A

Low value

37
Q

Auto scaling groups (ASG) are __________

A

Free (only pay for the underlying EC2 instance)

38
Q

What are the auto scaling group attributes?

A
  1. Launch template
    - AMI + instance type
    - EC2 user data
    - EBS volumes
    - security groups
    - SSH key pair
    - IAM roles for your EC2 instances
    - Network + subnets information
    - Load balancer information
  2. Min size / Max size / initial capacity
  3. Scaling policies
39
Q

It’s possible to scamjng an ASG based on ____________ alarms

A

Cloudwatch alarms

40
Q

An alarm is a ________ (such as avg CPU or custom metric) so for example if the avg CPU as a whole for your ASG is too high then need to add EC2 instance which will trigger the alarm & scaling activity in your scaling group

A

metric

41
Q

Related to ASG and cloudestch alarms, based on the alarms what can you create?

A
  • Can create scale - out policies (increase the number of instances)
  • Can create scale - in policies (decrease the number of instances)
42
Q

What are the different types of scaling policies?

A
  1. Dynamic scaling
    - Which has target tracking scaling (define a metric and target value and the ASG will scale out or in to keep your target metric)
  2. Simple/ step scaling
    - when a cloudwatch alarm is triggered (when your metric is higher than your target) then adds 2 units
  • when a cloudwatch alarm is trigger ( when metric is below your target) then it removes one
  1. Schedules scaling
    - aniticioae a scaling based on knownusage patterns (ex increase the min capacity to 10 at 5pm on Fridays bc u know you will get new users)
  2. Predictive scaling
    - Continuously forecast load and schedule scaling ahead of time
43
Q

What are some good metrics to scale on?

A
  1. CPU Utilization (avg CPU)
  2. Request count per target: to make sure the number of request per EC2 instance is table
  3. Average network in/out (if you’re application is network bound)
  4. Any custom metric (that you push using cloudwatch)
44
Q

After a scaling activity happens your are in the ______________

A

Cool down period (default 300 seconds)

45
Q

What occurs in the ASG scaljnc cooldowns?

A

During the cooldown period, the ASG wil not launch lr terminate additional instance (to allow for metrics to stabilize)

  • So you would wanna use a ready to use AMI to reduce configuration time in order to be serving request faster and reduce the cooldown period