You are on page 1of 25

A

Presentation On

Load Balancing In Internet


Content
Introduction
What is Load Balancing?
Methods Of Load Balancing
Where does it use?
Load Balancing in Linux Virtual Server
Three ways of Balancing load
Introduction
 Load Balancing is a technique to distribute

workload evenly across two or more


computers, network links, CPUs, hard drives,
or other resources, in order to get optimal
resource utilization, maximize throughput,
minimize response time, and avoid overload.
Cont..

A client sends a request to the virtual server,


which in turn selects a physical server in the
server farm and directs this request to the
selected physical server.

Different virtual servers can be configured for


different sets of physical services, such as TCP
and UDP services in general.
What Is Load Balancing?
Load balancing is a technique to spread
work between many computers, processes,
disks or other resources in order to get
optimal resource utilization and decrease
computing time.

A load balancer can be used to increase the


capacity of a server farm beyond that of a
single server.
Methods Of Load Balancing
 Different Type Of Load balancing methods:
◦ Least connections
◦ Round robin
◦ Least response time
◦ Least bandwidth
◦ Least packets
◦ Domain name hashing
◦ Source IP address
◦ Destination IP address
◦ Source IP - destination
Why does it use?
It is commonly used to mediate internal
communications in computer clusters.
If the load is more on a server, then the
secondary server takes some load while
the other is still processing requests.
To provide a single Internet service from
multiple servers.
Web Server Load Balancing
A major issue of Web Server Load Balancing is
for large internet sites of a large number of
visitors they get.
Linux Virtual Server
Started in 1998, the Linux Virtual Server (LVS)
project combines multiple physical servers into
one virtual server, eliminating single points of
failure (SPOF).

Built with off-the-shelf components, LVS is


already in use in some of the highest-trafficked
sites on the Web.
Requirement of LVS
 The system must scale up to meet the requirements and must be cost-
effective.
 The service must always be on and available despite any failures.
 The whole system may be big in physical size, it should be easy to
manage.
 A cluster of Linux servers appear as a single (virtual) server on a single IP

address.
 Inside the virtual server, LVS directs incoming network connections to
the
different servers according to scheduling algorithms.
LVS architecture

The load balancer,


servers, and
shared storage are
usually connected
by a high-speed
network to
prevent intranet
work of the
system as cluster
grows.
IPVS
IPVS modifies the TCP/IP stack inside the Linux kernel to
support IP load balancing
technologies
Three ways to balance load
IPVS supports following three ways to
balance loads:

 Virtual Server via NAT (VS/NAT)


Virtual Server via Tunneling (VS/TUN)
Virtual Server via Direct Routing (VS/DR)
Virtual Server via NAT
(VS/NAT)
VS/NAT Workflow
1. A request packet destined
for the virtual IP address arrives
at the load balancer.
2. load balancer examines the
packet's destination address and
port number if match select a
real server from the cluster by
scheduling algorithm.
3. Request is processed.
4. the load balancer rewrites the
source address and port of the
packets to those of the virtual
service and after termination of
connection ,record is removed
from hash table.
5. A reply is sent back to the
user.
An example of Virtual Server via

Nat
VS-NAT advantages and

 Advantages:disadvantages
◦ Real servers can run any OS that supports TCP/IP
◦ Only an IP address is needed for the load balancer,
real servers can use private IP address
 Disadvantages
◦ The maximum number of server nodes is limited,
because both request and response packers are
rewritten by the load balancer. When the number of
server nodes increase up to 20, the load balancer will
probably become a new bottleneck
Virtual Server via IP Tunneling

(VS/TUN)
IP tunneling is a technique to encapsulate IP
datagrams with in IP datagrams, which allows
datagrams to be wrapped and redirected to
another IP address.

This technique can also be used to build a


virtual server: the load balancer tunnels the
request packets to the different servers, process
the requests, and return the results to the clients
directly. Thus, the service appears as a VS on a
single IP address.
VS/TUN architecture
VS-TUN advantages and

disadvantages
Advantages:
◦ Real servers send response packets to client directly,
which can follow different network routes
◦ Real servers can be in different networks, LAN/WAN
◦ Greatly increasing the scalability of Virtual Server
Disadvantages:
◦ Real server must support IP tunneling protocol
Virtual Server via Direct Routing

(VS/DR)
The load balancer and the real servers must have
one of their interfaces.
The virtual IP address is shared by real servers
and the load balancer.
In VS/DR, the load balancer directly routes a
packet to the selected server.
Receiving of forwarded packet by server it’s
address on interface and processes the request,
and finally returns the result directly to the user.
VS/DR architecture
VS-DR advantages and

disadvantages
 Advantages:
◦ Real servers send response packets to clients directly,
which can follow different network routes
◦ No tunneling overhead
 Disadvantages:
◦ Servers must have interface
◦ The load balancer and server must have one of their
interfaces in the same LAN segment
Conclusions

 Statichashing-only schemes cannot balance workload.


 Burst scheduling is relatively simple
 Burst scheduling distributes load evenly
 Reorder rates of < 0.1% can be attained
 Larger buffers aren’t necessarily better
References
 Wikipedia
 Online Tutorial
 http://www.linux-vs.org
 www.google.com
Thank You.

Queries?

You might also like