CSC481 ยท 2080 ยท 5 marks
What is load balancing? How is load balancing done?
What is load balancing? How is load balancing done? [5]
Quick answer
Load balancing refers to the process of distributing a set of tasks over a set of resources with the aim of making their overall processing more efficient. It optimizes the response time and avoids unevenly overloading some compute nodes while other nodes are left idle. In the context of networking and cloud computing, it refers to distributing incoming network traffic across a group of backend servers.
Load Balancing
Definition
How Load Balancing is Done
Load balancing is typically performed using the following approaches and techniques:
1. Load Balancer (Hardware/Software)
A dedicated load balancer sits between the client and the backend server pool. It receives all incoming requests and forwards them to an appropriate server based on a chosen algorithm.
Client Requests
|
[Load Balancer]
/ | \
[S1] [S2] [S3] <-- Backend Servers
2. Common Load Balancing Algorithms
| Algorithm | Description |
|---|---|
| Round Robin | Requests are distributed to each server in turn, one after another |
| Least Connection | New request is sent to the server with the fewest active connections |
| IP Hash | Client IP address is used to determine which server receives the request |
| Weighted Round Robin | Servers with higher capacity are assigned more requests proportionally |
| Random | Requests are assigned to servers randomly |
3. Health Monitoring
The load balancer continuously monitors the health of backend servers. If a server goes down or becomes unresponsive, the load balancer stops sending traffic to it and redirects requests to healthy servers.
4. Session Persistence (Sticky Sessions)
In some cases, the load balancer ensures that a particular client is always directed to the same server during a session, maintaining session continuity.
5. DNS-Based Load Balancing
Multiple IP addresses are associated with a single domain name. DNS resolves the domain to different IPs for different clients, distributing the load geographically.
Benefits of Load Balancing
- Improves response time and performance
- Prevents any single server from becoming a bottleneck
- Provides high availability and fault tolerance
- Enables scalability by adding more servers to the pool
- Keeps idle nodes from wasting resources
Summary: Load balancing distributes workloads evenly across multiple servers using algorithms like Round Robin or Least Connection, managed by a load balancer, ensuring efficiency, reliability, and optimal resource utilization.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.