SlideShare a Scribd company logo
Load Balancing
Algorithms
Aditya Kamat
Load Balancing?
Load Balancing Algorithms - Which one to choose?
Load Balancing Algorithms - Which one to choose?
Load Balancing Algorithms - Which one to choose?
Load Balancing
Algorithms => {}
1. Random
Load Balancing Algorithms - Which one to choose?
Random algorithm:
• Can you “truly randomly” distribute load?
• It is simple to implement and scales well when you have a
distributed load balancer setup.
• Latency is not being accounted for.
• Servers which are underperforming can have more requests
being sent to them.
2. Round Robin
1 1
1
2 2
2
3 3
3
Round Robin
algorithm
• Guarantees same number of requests
to all servers.
• We again face the same latency
problem.
• Does not scale well for distributed
Load balancers as the logic of where to
start from needs to be statically
hardcoded.
• What if the backend servers have
different configs?
3. Weighted Round Robin
Weights
1
2
3
1
1
2 23
3
456
7
4
56
7
Weighted
Round Robin
algorithm
• Servers can take load based on their
H/W configs.
• Can introduce another service which
check for latency and update the
weights dynamically.
• The weights are present on the load
balancer and not the servers, so if it is
distributed, all need to be in sync.
• Also called “Join shortest queue”
algorithm.
4. Least connections
Served Requests
1
1
2 23
3
456 7
4
5
6
7
1
3
Least
Connections
algorithm
• Routes requests considering the
current load on each servers.
• In a distributed setup, the LBs should
be in sync about the active
connections on each server.
• We can have race condition of all LBs
sending to the same server if all
requests come to the LBs at once.
5. Least connections with
randomness
Each LB, when receives a request
chooses a set of random servers.
Then, the least connection algorithm
is applied to those servers and the
backend server is chosen for the
request.
Least
connections
with
randomness
• We are trying to solve the problem of race
condition in Least connections algorithm by using
this approach.
• This works only in a distributed LB setup.
• Adds one more layer of complexity to choose
random set of servers.
• The number of random servers that need to be
chosen needs to be hardcoded in each LB. This
number cannot be too close to the actual number
of servers ? And cannot be too less as well?
• All the techniques that we have looked at so
far assume that the application is stateless
and any of the servers can serve requests.
• Maintaining persistent connections is a
much more difficult task and shall be
discussed in the future videos.
• Join idle queue algorithm – Link
• Source IP hash algorithm, based on consistent hashing –
Link1, Link2
• This is used for maintaining persistent connections.
• Global Server Load Balancing – Link
Further reading:
References
• Comparison between basic LB algorithms: Link
• Tyler McMullen - Load Balancing is Impossible: Link
• “Balls into Bins” — A Simple and Tight Analysis - Link
• The Power of Two Choices in Randomized Load Balancing - Link

More Related Content

What's hot (20)

PDF
Unit 1 - mobile computing introduction
Vintesh Patel
 
PPTX
Computer networks and it's applications
varun arora
 
PPTX
cloud computing: Vm migration
Dr.Neeraj Kumar Pandey
 
PPTX
Piggybacking
Akshita Pillai
 
PPT
Load balancing
Ahmed Sherief El-Dakhakhny
 
PDF
Multimedia networking
Dr. Hamdan Al-Sabri
 
DOCX
Bus stucture
indra12345678
 
PPTX
Client server model
Gd Goenka University
 
PPTX
IPV6 ADDRESS
Jothi Lakshmi
 
PPTX
Alternative metrics
Parthipan Parthi
 
PPSX
Physical layer ppt
Najam Khattak
 
PPTX
Physical layer of OSI model
farwa sahar
 
PPTX
Delivery and Forwarding of IP Packets
International Institute of Information Technology (I²IT)
 
PPTX
Sexbots
Sarah Aguilar
 
PPTX
Application Virtualization
securityxploded
 
PPTX
Mobile Computing (Part-2)
Ankur Kumar
 
PDF
Introduction to intel galileo board gen2
Harshit Srivastava
 
PPSX
Issues in Data Link Layer
selvakumar_b1985
 
DOCX
Virtualize of IO Devices .docx
kumari36
 
Unit 1 - mobile computing introduction
Vintesh Patel
 
Computer networks and it's applications
varun arora
 
cloud computing: Vm migration
Dr.Neeraj Kumar Pandey
 
Piggybacking
Akshita Pillai
 
Multimedia networking
Dr. Hamdan Al-Sabri
 
Bus stucture
indra12345678
 
Client server model
Gd Goenka University
 
IPV6 ADDRESS
Jothi Lakshmi
 
Alternative metrics
Parthipan Parthi
 
Physical layer ppt
Najam Khattak
 
Physical layer of OSI model
farwa sahar
 
Delivery and Forwarding of IP Packets
International Institute of Information Technology (I²IT)
 
Sexbots
Sarah Aguilar
 
Application Virtualization
securityxploded
 
Mobile Computing (Part-2)
Ankur Kumar
 
Introduction to intel galileo board gen2
Harshit Srivastava
 
Issues in Data Link Layer
selvakumar_b1985
 
Virtualize of IO Devices .docx
kumari36
 

Similar to Load Balancing Algorithms - Which one to choose? (20)

PDF
IRJET- An Improved Weighted Least Connection Scheduling Algorithm for Loa...
IRJET Journal
 
PDF
The Concept of Load Balancing Server in Secured and Intelligent Network
IJAEMSJORNAL
 
PDF
IRJET - Efficient Load Balancing in a Distributed Environment
IRJET Journal
 
PPTX
Load Balancing In Distributed Computing
Richa Singh
 
PDF
40414094210-phpapp01 (1).pdf
RebaMaheen
 
PPTX
My Dissertation 2016
Vrushali Lanjewar
 
PDF
ACE - Comcore
Aakash Agarwal
 
PDF
A Modified Genetic Algorithm based Load Distribution Approach towards Web Hot...
idescitation
 
PPTX
Web Server Load Balancing
Mamdouh Tarabishi
 
PDF
Load Balancer Device and Configurations.
Web Werks Data Centers
 
PDF
AWSQ: an approximated web server queuing algorithm for heterogeneous web serv...
IJECEIAES
 
PPTX
Load Balancing in Cloud Computing.pptx
PradipPoudel4
 
PPTX
Conquering Load Balancing: Experiences from ScyllaDB Drivers
ScyllaDB
 
PPTX
Network Load Balancing.pptx
VydhehSumod
 
PDF
Load Balancing traffic in OpenStack neutron
sufianfauzani
 
PPTX
Big ip f5 ltm load balancing methods
Utpal Sinha
 
PPTX
LoadBalancing .pptx
alianwarr
 
PPTX
LoadBalancing .pptx
RebaMaheen
 
PPTX
Load Balance with NSX-T.pptx
Dhruv Sharma
 
PPTX
Load Balancing And Yahoo!
TwinVasion
 
IRJET- An Improved Weighted Least Connection Scheduling Algorithm for Loa...
IRJET Journal
 
The Concept of Load Balancing Server in Secured and Intelligent Network
IJAEMSJORNAL
 
IRJET - Efficient Load Balancing in a Distributed Environment
IRJET Journal
 
Load Balancing In Distributed Computing
Richa Singh
 
40414094210-phpapp01 (1).pdf
RebaMaheen
 
My Dissertation 2016
Vrushali Lanjewar
 
ACE - Comcore
Aakash Agarwal
 
A Modified Genetic Algorithm based Load Distribution Approach towards Web Hot...
idescitation
 
Web Server Load Balancing
Mamdouh Tarabishi
 
Load Balancer Device and Configurations.
Web Werks Data Centers
 
AWSQ: an approximated web server queuing algorithm for heterogeneous web serv...
IJECEIAES
 
Load Balancing in Cloud Computing.pptx
PradipPoudel4
 
Conquering Load Balancing: Experiences from ScyllaDB Drivers
ScyllaDB
 
Network Load Balancing.pptx
VydhehSumod
 
Load Balancing traffic in OpenStack neutron
sufianfauzani
 
Big ip f5 ltm load balancing methods
Utpal Sinha
 
LoadBalancing .pptx
alianwarr
 
LoadBalancing .pptx
RebaMaheen
 
Load Balance with NSX-T.pptx
Dhruv Sharma
 
Load Balancing And Yahoo!
TwinVasion
 
Ad

More from Aditya Kamat (9)

PDF
Spectre and meltdown
Aditya Kamat
 
PPTX
Cryptography 101
Aditya Kamat
 
PPTX
Web Hacking Series Part 5
Aditya Kamat
 
PPTX
Web Hacking Series Part 4
Aditya Kamat
 
PPTX
Web hacking series part 3
Aditya Kamat
 
PPTX
Web Hacking series part 2
Aditya Kamat
 
PPTX
Web Hacking Series Part 1
Aditya Kamat
 
PPTX
Web Hacking Intro
Aditya Kamat
 
PPTX
Exploiting a vulnerability to gain a shell
Aditya Kamat
 
Spectre and meltdown
Aditya Kamat
 
Cryptography 101
Aditya Kamat
 
Web Hacking Series Part 5
Aditya Kamat
 
Web Hacking Series Part 4
Aditya Kamat
 
Web hacking series part 3
Aditya Kamat
 
Web Hacking series part 2
Aditya Kamat
 
Web Hacking Series Part 1
Aditya Kamat
 
Web Hacking Intro
Aditya Kamat
 
Exploiting a vulnerability to gain a shell
Aditya Kamat
 
Ad

Recently uploaded (20)

PPTX
Break Statement in Programming with 6 Real Examples
manojpoojary2004
 
PPTX
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
PDF
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
PPTX
Presentation on Foundation Design for Civil Engineers.pptx
KamalKhan563106
 
PPTX
site survey architecture student B.arch.
sri02032006
 
PPTX
Introduction to Neural Networks and Perceptron Learning Algorithm.pptx
Kayalvizhi A
 
PDF
ARC--BUILDING-UTILITIES-2-PART-2 (1).pdf
IzzyBaniquedBusto
 
PDF
MOBILE AND WEB BASED REMOTE BUSINESS MONITORING SYSTEM
ijait
 
PDF
A presentation on the Urban Heat Island Effect
studyfor7hrs
 
PPTX
NEUROMOROPHIC nu iajwojeieheueueueu.pptx
knkoodalingam39
 
PDF
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
PPT
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
PPTX
Innowell Capability B0425 - Commercial Buildings.pptx
regobertroza
 
PPTX
drones for disaster prevention response.pptx
NawrasShatnawi1
 
PDF
BioSensors glucose monitoring, cholestrol
nabeehasahar1
 
PPTX
REINFORCEMENT AS CONSTRUCTION MATERIALS.pptx
mohaiminulhaquesami
 
PDF
Zilliz Cloud Demo for performance and scale
Zilliz
 
PPTX
Benefits_^0_Challigi😙🏡💐8fenges[1].pptx
akghostmaker
 
PDF
monopile foundation seminar topic for civil engineering students
Ahina5
 
PPTX
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
Break Statement in Programming with 6 Real Examples
manojpoojary2004
 
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
Presentation on Foundation Design for Civil Engineers.pptx
KamalKhan563106
 
site survey architecture student B.arch.
sri02032006
 
Introduction to Neural Networks and Perceptron Learning Algorithm.pptx
Kayalvizhi A
 
ARC--BUILDING-UTILITIES-2-PART-2 (1).pdf
IzzyBaniquedBusto
 
MOBILE AND WEB BASED REMOTE BUSINESS MONITORING SYSTEM
ijait
 
A presentation on the Urban Heat Island Effect
studyfor7hrs
 
NEUROMOROPHIC nu iajwojeieheueueueu.pptx
knkoodalingam39
 
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
Innowell Capability B0425 - Commercial Buildings.pptx
regobertroza
 
drones for disaster prevention response.pptx
NawrasShatnawi1
 
BioSensors glucose monitoring, cholestrol
nabeehasahar1
 
REINFORCEMENT AS CONSTRUCTION MATERIALS.pptx
mohaiminulhaquesami
 
Zilliz Cloud Demo for performance and scale
Zilliz
 
Benefits_^0_Challigi😙🏡💐8fenges[1].pptx
akghostmaker
 
monopile foundation seminar topic for civil engineering students
Ahina5
 
artificial intelligence applications in Geomatics
NawrasShatnawi1
 

Load Balancing Algorithms - Which one to choose?

  • 9. Random algorithm: • Can you “truly randomly” distribute load? • It is simple to implement and scales well when you have a distributed load balancer setup. • Latency is not being accounted for. • Servers which are underperforming can have more requests being sent to them.
  • 11. 1 1 1
  • 12. 2 2 2
  • 13. 3 3 3
  • 14. Round Robin algorithm • Guarantees same number of requests to all servers. • We again face the same latency problem. • Does not scale well for distributed Load balancers as the logic of where to start from needs to be statically hardcoded. • What if the backend servers have different configs?
  • 17. Weighted Round Robin algorithm • Servers can take load based on their H/W configs. • Can introduce another service which check for latency and update the weights dynamically. • The weights are present on the load balancer and not the servers, so if it is distributed, all need to be in sync. • Also called “Join shortest queue” algorithm.
  • 20. Least Connections algorithm • Routes requests considering the current load on each servers. • In a distributed setup, the LBs should be in sync about the active connections on each server. • We can have race condition of all LBs sending to the same server if all requests come to the LBs at once.
  • 21. 5. Least connections with randomness
  • 22. Each LB, when receives a request chooses a set of random servers. Then, the least connection algorithm is applied to those servers and the backend server is chosen for the request.
  • 23. Least connections with randomness • We are trying to solve the problem of race condition in Least connections algorithm by using this approach. • This works only in a distributed LB setup. • Adds one more layer of complexity to choose random set of servers. • The number of random servers that need to be chosen needs to be hardcoded in each LB. This number cannot be too close to the actual number of servers ? And cannot be too less as well?
  • 24. • All the techniques that we have looked at so far assume that the application is stateless and any of the servers can serve requests. • Maintaining persistent connections is a much more difficult task and shall be discussed in the future videos.
  • 25. • Join idle queue algorithm – Link • Source IP hash algorithm, based on consistent hashing – Link1, Link2 • This is used for maintaining persistent connections. • Global Server Load Balancing – Link Further reading:
  • 26. References • Comparison between basic LB algorithms: Link • Tyler McMullen - Load Balancing is Impossible: Link • “Balls into Bins” — A Simple and Tight Analysis - Link • The Power of Two Choices in Randomized Load Balancing - Link