Load Balancing Flashcards

1
Q

What is load balancing?

A

Distributing the heavy traffic across servers running in the cluster using different algorithms

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

What is DNS Querying?

A

When the user types in the url of the website, this is called DNS Querying

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

4 key components of DNS Infrastructure

A
  1. DNS Recursive Nameserver/DNS ReSolver
  2. Root NameServer
  3. Top Level Domain Server
  4. Authoritative Nameserver
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

DNS Querying Flow

A
  1. Browser -> DNS Resolver ( Search for amazon.com)
  2. DNS Resolver -> Root Nameserver( Tell me the IP address of the Top Level Domain Server that hosts the .com domain)
  3. DNS Resolver -> Top Level Domain Name Server ( tell me the IP address of the Authoritative Server that has amazon.com hosted in it)
  4. DNS Resolver-> Authoritative Server( Tell me the IP address of amazon.com)
  5. DNS Resolver-> Browser
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is DNS Level Load Balancing?

A
  • DNS Load balancing is set up at the Authoritative server level.
  • DNS load balancingenables theauthoritative serverto return differentIP addressesof a certain domain to the clients. Every time it receives a query for anIP, it returns a list ofIP addressesof a domain to the client.
    With every request, theauthoritative serverchanges the order of theIP addressesin the list in around-robinfashion.
    When another client sends out a request for anIP addressto theauthoritative server, it re-orders the list and puts anotherIP addresson the top of the list following theround-robin algorithm( Round Robin DNS Load balancing)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Limitations of DNS Load Balancing

A
  • Majorly used by companies to distribute traffic across multiple data centers.
  • It doesn’t take into account the existing load on the cluster, the content they hold, their request processing time, and their in-service status.
  • Since the IP addresses are cached, there is always a possibility of requests being routed to out of order machine.
  • It does have some limitations but this is the cheapest way of setting up LB.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

3 modes of load balancing

A
  1. DNS Load Balancing
  2. Hardware Based Load Balancing
  3. Software Based Load Balancing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is hardware-based Load Balancing?

A
  • High-performance physical hardware with a specialized operating system that distributes web application traffic across a cluster of application servers
  • Distributes the load on the basis of existing open connection, compute utilization, and several other parameters.
  • They need regular maintenance and upgrade.
  • Expensive to setup
  • They are preferred for their top-notch performance.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is software-based load balancing?

A
  • It can be installed on commodity hardware and VMs
  • More cost-effective and easy to work with.
    They are pretty advanced in terms of metrics used to distribute the load(Source IP, Cookies, HTTP Headers, CPU & Memory Utilization , load on N/W)
    They even perform cont. health checks on servers to keep an updated list of in-service machines.
    E.g HAProxy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the different algorithms used in Load balancing?

A
  1. Round Robin
  2. Weighted Round Robin
  3. Random
  4. Least Connections
  5. Hash
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Round Robin Load Balancing Algorithm?

A

No parameters e.g CPU/Memory utilization are taken into consideration

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

What is weighted Round Robin Load Balancing?

A

Based on the server’s compute and traffic handling capacity. And then round-robin.
This very useful when the applications are deployed across different data centres with different capacities.

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

What is the Least Connections Load Balancing?

A

The traffic is routed to that machine that has the least open connections among all the machines in the cluster.
Just the Least connection doesn’t give a perfect picture of what’s going on each server.
The possibility that machines having the least amount of open connection might be processing requests demanding more CPU and compute power.
Machines with less request processing time, CPU utilization & simultaneously having the least open connections are the right candidates to process the future client requests.
This approach comes in handy when servers have long opened connections. e.g Persistent Connections in Gaming Application

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

What is random Load Balancing?

A

The load balancer may also find similar servers in terms of existing load, request processing time and so on and then it randomly routes the traffic to these machines.

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

What is Hash-Based Load Balancing?

A
  • The source IP of the request and request URL is hashed to route the traffic to backend servers.
  • This ensures Session Persistence
  • This results in a better User experience as the request always goes to the server which has the processed data in its memory. There is no need to fetch client session data from the session memory of the cluster and then process the request. This reduces latency.
  • Hashing a URL ensures that a request with a specific URL always hits a certain cache that already has data. This ensures that there is no cache miss
  • This also avoids the need for duplicating data in every cache. An efficient way of implementing Cache.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly