Posted by : Sushanth Wednesday 5 January 2022

 

Load balancer

Load balancing is the process of distributing network traffic across multiple servers. This ensures no single server bears too much demand.

By spreading the work evenly,

1.       load balancing improves application responsiveness.

2.       Increases availability of applications and websites for users.

Modern applications cannot run without load balancers. Over time, software load balancers have added additional capabilities including application security.


To utilize full scalability and redundancy, we can try to balance the load at each layer of the system. We can add LBs at three places:

  • Between the user and the web server
  • Between web servers and an internal platform layer, like application servers or cache servers
  • Between internal platform layer and database.


What it does?

Load balancers manage the flow of information between the server and an endpoint device (PC, laptop, tablet or smartphone). The server could be on-premises, in a data center or the public cloud. The server can also be physical or virtualized.

The load balancer helps servers move data efficiently, optimizes the use of application delivery resources and prevents server overloads.

Load balancers conduct continuous health checks on servers to ensure they can handle requests. If necessary, the load balancer removes unhealthy servers from the pool until they are restored.

Some load balancers even trigger the creation of new virtualized application servers to cope with increased demand.

How does the load balancer choose the backend server?


Load balancers consider two factors before forwarding a request to a backend server. They will first ensure that the server they choose is actually responding appropriately to requests and then use a pre-configured algorithm to select one from the set of healthy servers. We will discuss these algorithms shortly.

Load Balancing Algorithms

There is a variety of load balancing methods, which use different algorithms best suited for a particular situation.

  • Least Connection Method — directs traffic to the server with the fewest active connections. Most useful when there are a large number of persistent connections in the traffic unevenly distributed between the servers.
    • Least Response Time Method — directs traffic to the server with the fewest active connections and the lowest average response time.
    • Round Robin Method — rotates servers by directing traffic to the first available server and then moves that server to the bottom of the queue. Most useful when servers are of equal specification and there are not many persistent connections.
    • IP Hash — the IP address of the client determines which server receives the request.

    Benefits of Load Balancing

    • Users experience faster, uninterrupted service.
    • Service providers experience less downtime and higher throughput.
    • Makes system administrators job easy by handing incoming requests while decreasing wait time for users.
    • Smart load balancers provide benefits like predictive analytics that determine traffic bottlenecks before they happen.

    References:

    https://avinetworks.com/what-is-load-balancing/

    https://www.educative.io/courses/grokking-the-system-design-interview/3jEwl04BL7Q



    Leave a Reply

    Subscribe to Posts | Subscribe to Comments

    - Copyright © Technical Articles - Skyblue - Powered by Blogger - Designed by Johanes Djogan -