Scalability and High Availability Flashcards

1
Q

what are the two types of scalability?

A

There are 2 types: vertical- adding to the same resource from T2 micro to T2 large and horizontal- adding extra new resources- increasing number of instances move from 2 t2 micro to 4 instances of T2 micro

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

What is a load balancer?

A

A load balancer is a server that forwards traffic to multiple servers (EC2) downstream.

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

Why do we need load balancers?

A

Load balancers spread the load across multiple instances,
They provide a single point of access to our application,
They handle failures of downstream instances,
They perform regular health checks,
They separate public and private traffic,
They provide high availability and perform termination for ssl and https

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

What are the different types of load balancers?

A

There are 4 types of load balancers:
1)classic load balancer - available but deprecated,
2) Application Load balancer used for http,https and
WebSocket, layer 7,
3) Network load balancer for tcp, tls and UDP,
4) Gateway load balancer for IP protocol (layer 3)

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

What is ALB used for?

A

Application load balancers are layer 7 http and balance application load across multiple machines or multiple tasks on a single machine (containers). They can

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

How do ALB route traffic to target groups?

A

ALB uses routing tables that route traffic to target groups:
• Routing based on path in URL (example.com/users & example.com/posts)
• Routing based on hostname in URL (one.example.com & other.example.com)
• Routing based on Query String, Headers
(example.com/users?id=123&order=false

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

What are the ALB target groups?

A
Target groups include 
EC2 instances(http), 
ECS tasks(http),lambda functions(http) and 
IP addresses(private IP only)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How are health checks performed on target groups?

A

Health checks are performed at the target group level.

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

How many target groups can the ALB route to?

A

ALB can route to multiple target groups based on the routing table criteria.

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

Does the ALB target grp see the client ID?

A

No, the ALB itself has a fixed name e.g. xxx.region.elb.amazonwas.com and the target group only sees the ALB id and not the client id, the client id, is inserted into the header( x-forwarded-for) and similarly for the port (x-forwarded-port) and the protocol (x-forwarded-proto).

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

What is a network load balancer?

A

An NLB is a layer 4 load balancer that routes TCP and UDP traffic. it’s high performing, 100ms compared to ALB which is 400ms.

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

What is the IP for NLB?

A

NLB has one static IP per AZ and can be assigned an elastic IP. This is different from CLB and ALB as they don’t have a static Ip but instead a static hostname.

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

What are the NLB target groups?

A

NLB target groups include EC2 instances, fixed static IP addresses, and ALB.

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

What is Gateway Load Balancer(GLB)?

A

GLB is layer 3 and is used for deploying and managing 3rd party virtual appliances. This load balancer detects intrusion, acts as a firewall and deep packet inspection. It analyses the network traffic.

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

What is GENEVE protocol and what port does it map to?

A

This is GLB protocol and it maps to port 6081.

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

How does GLB work?

A

It has a single entry/exit for all traffic and it distributes traffic to all virtual appliances.

17
Q

What are the target groups for GLB?

A

Target groups include 3rd party EC2 instances and fixed private IP addresses.

18
Q

What are sticky sessions and how do they work?

A

Sticky sessions ensure that the traffic from the same client is always re- directed to the same instance. this prevents loss of session data. These sessions use a “cookie” that controls the expiration of that session.
Sticky sessions can be used with CLB and ALB.

19
Q

What are the 2 different types of cookies?

A
  • Application-based cookies - generated by the load balancer and the name must be specified by the target grp e.g AWSALBAPP.
  • Duration-based cookies, are generated by the Load balancer and have names AWSALB and AWSELB.
20
Q

What is cross-zone load balancing?

A

With cross zone load balancing the client sends 50% of the traffic to each load balancer irrespective of the number of instances in each zone. the load balancers then distribute the traffic evenly over the multiple zones.

21
Q

Which type of LB have cross zone capability?

A

All load balancers have this capability.
ALB has cross-zone enabled by default and can’t be switched off. there are no charges for inter-zone data.
NLB has cross-zone disabled by default but can be enabled. There are inter AZ data charges when enabled.
CLB is also disabled by default but can be enable and there are no charges for inter AZ data.

22
Q

what is SSL?

A

secure socket layer is a security certificate that allows traffic between the client and load balancer to be encrypted( in flight). TLS is the new version of the SSL. SSL has an expiration date.

23
Q

Explain SSL -SNI

A

SNI -Server Name Indication. is required in the initial handshake by the load balancer to rout the traffic to appropriate website. The SNI allows multiple web servers to reside on a single web host. SNI form part of the SSL certificate. This only works with NLB and ALB.

24
Q

What is connection draining?

A

Connection draining is the completion of in-flight requests to an unhealthy instance is drained, that is no new requests will be sent to this instance as it de registers. The term draining is only applied to CLB. For ALB and NLB it’s called de registering.

25
Q

What’s the duration of the connection draining?

A

it can be between 1 - 3600 secs, by default it is 300sec. Its can be set to short times for short requests for that connections can be drained faster.

26
Q

What does an ASG - Auto Scaling Group do?

A

ASG provisions EC2 instances automatically. It works by adding new instances to scale out whore capacity is required and deletes instances to scale in when the demand decreases. This is achieved by trigger alarms that are set on cloud watch metric monitoring, when utilization thresholds are breached then new instances are added

27
Q

What are the required parameters for ASG?

A

We need to specify, min, max and the desired capacity

28
Q

What are the ASG launch configurations?

A

AMI+Instance type, User Data, EBS, security groups, ,SSH Key Pair • Min Size / Max Size / Initial Capacity • Network + Subnets Information • Load Balancer Information • Scaling Policies

29
Q

what are the different ASG policies?

A

There are multiple ASG policies, these include -Dynamic polices and predictive scaling policies.

30
Q

Define the different Dynamic policies?

A

Target Tracking policies- allow as to maintain a set target, e.g 40% cpu.
The Simple/step Policies define what steps to take in case of an alarm or threshold increase/decrease. e.g add when demand increases and decrease when demand decreases. We also have the scheduled Policies that define a set time for some action to take place.

31
Q

Define Predictive scaling policies?

A

Predictive scaling analyses historic load and forecasts load and schedules scaling policies in response to the expected load.

32
Q

What is meant by scaling cooldown?

A

Scaling cooldown is a period of 300sec after a scaling activity where the ASG will not terminate or provision any new instances. this allows metrics to stabilize.

33
Q

What are the ASG scaling rules for balancing across AZs?

A

ASG tries to balance across AZs. When terminating an instance it will choose to terminate from the AZ with a higher count and terminate one with the oldest config.

34
Q

How do lifecycle hooks work?

A

Life Cycle hooks are associated with Auto Scaling Group and allow additional actions to be performed on an instance at creation and termination. e.g. pending:wait stage at provisioning and terminate:wait at termination.