Azure Classroom notes 04/Nov/2023

Distributing Traffic

Problem with load/stress on the application

  • Generally web servers when accessed create a load on cpu and memory for every request. As number of request increase one server will not be able to solve the problem/execute the request. On a broader note we have two options
    • Horizontal scaling: Increase number of servers running the application
    • Vertical Scaling: Increase the server resources such as CPU/Memory etc.
  • If the number of servers are many then we cant share all the ips to requster. To solve this we need to understand the concept of Proxy Servers

Proxy Server

Reverse Proxy Server

Load Balancers

  • Load Balancers serve incoming traffic to a application and distribute it across servers
  • Load Balancers major functionality is around
    • Distributing an application traffic so that the individual servers do not become overloaded
  • Types of Load Balancers (functionality)
    • Layer 4 load balancer
    • Layer 7 load balancer
  • Type of Load Balancers (creation)
    • Hardware load balancer
    • Software load balancer
    • Virtual load balancer

OSI Networking Model

  • Model overview

  • Each layer adds functionality

  • Now layer 4 loadbalancing can make load balancing decisions on the basis of
    • ip address
    • port
    • protocol (TCP/UDP)
  • Layer 7 has knowledge of http in addition to layer 4

Layer 4 scenario in Cloud

  • In cloud generally we have two types of load balancing
    • internal load balancing
    • internet facing/public load balancing
  • Terms:
    • inbound: where the users will hit the load balancer
    • outbound: where the load balancer needs to send the traffic
  • Azure Layer 4 Load Balancer
  • AWS Layer 4 Load Balancer
  • Mapping name to public address of Load Balancer is done in DNS zone

Load Balancing Algorithms

DMZ (De-militarized Zone)

Lab setup for Load Balancing

  • Create a ubuntu vm/ec2 instance with 80 port and 22 port opened
  • steps
sudo apt update
sudo apt install apache2 -y
sudo apt install stress -y
  • Create a file in /var/www/html/index.html with following content
<!DOCTYPE html>
<html>
<body style="background-color:powderblue;">
<h1>Welcome to Load Balancing</h1>
<p>This is for learning</p>
</body>
</html>
  • Now access http://<public ip>
  • shutdown this instance
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Customized Social Media Icons from Acurax Digital Marketing Agency

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%