What is a Load Balancer?

IBM Technology
4 Oct 202108:22

Summary

TLDRIn this IBM Cloud video, Bradley Knapp explores the concept of a network load balancer, crucial for managing traffic in high-demand websites. He illustrates the importance of load balancers in distributing user requests across multiple servers to prevent overload, ensuring scalability and reliability. The video discusses three load balancing methods: Round Robin for simple, sequential traffic distribution, smart load balancing for dynamic server load awareness, and random selection for a balance between simplicity and control. The discussion highlights the role of load balancers in cloud-native architectures and their impact on performance and cost.

Takeaways

  • 🌐 A network load balancer is essential for distributing incoming traffic across multiple servers to ensure high availability and reliability of a website or application.
  • πŸš€ It's crucial for scaling a website to handle millions of users by directing traffic efficiently to multiple application servers, preventing any single server from becoming a bottleneck.
  • πŸ’‘ Load balancers can be hardware devices or software-defined, and they intercept incoming traffic to distribute it among servers based on various algorithms.
  • πŸ”„ The Round Robin algorithm is a basic load balancing method where traffic is distributed sequentially across servers, but it may not be ideal for long user sessions.
  • πŸ€– Smart load balancing involves load balancers working in cooperation with application servers, which report their load status to the balancer for more dynamic and efficient traffic distribution.
  • πŸ“ˆ Load balancers can help in auto-scaling by turning off underutilized servers or spinning up new ones based on real-time load data, thus optimizing resource usage and cost.
  • πŸ›‘οΈ Load balancers are a key component of cloud-native architectures, ensuring that traffic is evenly distributed among application servers, which in turn communicate with a common database.
  • πŸ”‘ There are more complex load balancing algorithms beyond Round Robin, such as random selection, that can provide better distribution without the need for smart load balancing's complexity.
  • πŸ’Ό IBM Cloud offers expertise and support in designing and architecting load balancing solutions tailored to specific customer needs and traffic patterns.
  • πŸ”§ For more detailed advice or specific scenarios, reaching out to IBM or exploring additional resources can provide in-depth guidance on implementing effective load balancing strategies.

Q & A

  • What is a network load balancer?

    -A network load balancer is a hardware device or software-defined device that intercepts incoming traffic from the Internet and distributes it across multiple servers to ensure no single server becomes overwhelmed, thus improving the distribution of network or application traffic and providing high availability.

  • Why is it important to scale application servers?

    -Scaling application servers is important to handle increasing loads, such as serving millions of users simultaneously. It allows the infrastructure to grow horizontally by adding more servers rather than just scaling vertically by making existing servers more powerful, which has physical and cost limitations.

  • How does a load balancer help in managing traffic for a website with high user traffic?

    -A load balancer helps by distributing incoming traffic across multiple application servers, ensuring no single server is overwhelmed. It also dynamically scales the application servers up or down based on the current load, which helps in maintaining performance and reducing costs.

  • What is the Round Robin algorithm used by load balancers?

    -Round Robin is a simple load balancing algorithm that distributes traffic sequentially across servers. It sends the first request to the first server, the second request to the second server, and so on, cycling back to the first server after the last one.

  • What are the limitations of using Round Robin for load balancing?

    -Round Robin may not be suitable for scenarios with long user sessions because it can lead to an imbalance in server loads. It does not consider the current load or capacity of the servers, which can result in some servers being overutilized while others are underutilized.

  • What is smart load balancing and how does it differ from Round Robin?

    -Smart load balancing, also known as load-aware load balancing, involves the load balancer working in cooperation with the application servers. It takes into account the current load on each server and makes decisions based on this information, unlike Round Robin, which simply cycles through servers without considering their current load.

  • Why might a company choose not to use smart load balancing?

    -A company might choose not to use smart load balancing due to its higher complexity in setup and configuration, as well as the potentially higher cost of the required load balancer software or hardware.

  • What is the random selection algorithm used in load balancing?

    -The random selection algorithm in load balancing involves the load balancer using a randomizing function to decide which server should handle each incoming connection, providing a balance that is less predictable than Round Robin but simpler than smart load balancing.

  • How does a load balancer contribute to cloud-native architectures?

    -In cloud-native architectures, load balancers are key components that assign traffic to different application servers, ensuring scalability and high availability. They also facilitate communication with a common database tier, preventing issues like split-brain scenarios.

  • What are some other algorithms that can be used for load balancing besides Round Robin and random selection?

    -There are various other algorithms for load balancing, including Least Connections, which sends traffic to the least busy server, and IP Hash, which directs traffic based on the source IP address to ensure session persistence.

  • How can IBM assist in designing a load balancing solution?

    -IBM can assist by providing expertise and resources to help design and architect a load balancing solution tailored to specific needs. This can include consultation on choosing the right type of load balancer, setting up smart load balancing, and integrating with existing infrastructure.

Outlines

00:00

🌐 Introduction to Network Load Balancers

Bradley Knapp from IBM Cloud introduces the concept of a network load balancer by setting a scenario of running a highly popular website that needs to scale for millions of users. He explains the potential bottleneck of a single application server and how scaling out horizontally with multiple servers can help. The load balancer's role is to distribute incoming traffic efficiently among these servers. It can also dynamically scale servers up or down based on the load, thus optimizing performance and cost. The paragraph concludes with an introduction to different load balancing scenarios and algorithms.

05:00

πŸ”„ Load Balancing Scenarios and Algorithms

This paragraph delves into three different load balancing scenarios. The first is a basic Round Robin method, where traffic is distributed sequentially across servers, which may not be ideal for long user sessions. The second scenario introduces smart load balancing, where the load balancer works in tandem with application servers to distribute traffic based on real-time load data, providing a more balanced approach but at a higher complexity and cost. The third scenario offers a middle ground with various algorithms, such as random selection, that provide more control than Round Robin without the full complexity of smart load balancing. The paragraph concludes with an invitation for further discussion and assistance from IBM Cloud in designing load balancing solutions.

Mindmap

Keywords

πŸ’‘Network Load Balancer

A network load balancer is a system that distributes network or application traffic across multiple servers. In the context of the video, it is crucial for managing traffic to a website, particularly when the website is immensely popular and needs to scale to serve millions of users simultaneously. The load balancer ensures that no single server becomes overwhelmed by distributing the workload evenly across multiple servers.

πŸ’‘Scalability

Scalability refers to the ability of a system to handle a growing amount of work by adding resources. In the video, scalability is discussed in the context of a website needing to scale to serve a large number of users. The speaker mentions that as the number of users increases, the application server might need to scale out, which means adding more servers to handle the increased load.

πŸ’‘Application Server

An application server is a software framework and environment used to host applications and services that users access. In the video, the application server is where the data for the website is hosted and served back to the user's device. The concept is integral to the discussion of load balancing, as it is the servers that the load balancer distributes traffic to.

πŸ’‘Horizontal Scaling

Horizontal scaling, also known as 'scaling out,' involves adding more servers to a system to increase its capacity. The video script mentions horizontal scaling as a solution when a single application server cannot handle the traffic load, suggesting adding more servers to distribute the load.

πŸ’‘Auto-Scaling

Auto-scaling is the automatic adjustment of computing resources to meet the demands of an application. In the video, auto-scaling is discussed in relation to the load balancer's ability to add or remove application servers based on the current load, helping to manage costs and maintain performance.

πŸ’‘Round Robin

Round Robin is a basic load balancing algorithm that distributes traffic sequentially across servers. The video uses Round Robin as an example of a simple load balancing method where each incoming connection is directed to the next server in line, cycling through all available servers.

πŸ’‘Smart Load Balancing

Smart load balancing refers to a more advanced method of load balancing where the load balancer is aware of the load on each server and makes decisions based on this information. In the video, smart load balancing is contrasted with Round Robin, where the load balancer works in cooperation with application servers to distribute traffic based on current load and server capacity.

πŸ’‘Load Balancing Algorithms

Load balancing algorithms are the methods used by load balancers to decide how to distribute traffic among servers. The video script discusses different algorithms, including Round Robin and random selection, which are used to determine the distribution of traffic to ensure efficient and fair server usage.

πŸ’‘User Sessions

User sessions refer to the period during which a user is actively engaged with an application or website. The video mentions that user sessions can vary in length, which can affect how load balancing is managed, as some sessions may last only a few minutes while others may last hours.

πŸ’‘Cloud-Native Architectures

Cloud-native architectures are designed to take advantage of cloud computing's distributed nature, typically including microservices, containers, and dynamic orchestration. The video highlights the load balancer as a key component in cloud-native architectures, emphasizing its role in efficiently distributing traffic among application servers.

Highlights

Introduction to the concept of a network load balancer by Bradley Knapp with IBM Cloud.

Scenario of running a popular website needing to scale for millions of users.

Explanation of how a single user's traffic is handled by an application server.

Challenge of handling traffic from 10,000 users simultaneously.

Limitations of scaling up application servers and the need for horizontal scaling.

The role of a load balancer in distributing traffic among multiple application servers.

Load balancer's function as a hardware or software-defined device.

How load balancers collect and provide information to dynamically scale application servers.

The importance of load balancers in cloud-native architectures.

Description of the Round Robin algorithm used by load balancers for traffic distribution.

Limitations of Round Robin for long user sessions leading to server imbalance.

Introduction to smart load balancing and its cooperation with application servers.

Complexity and cost considerations of setting up smart load balancing.

Alternative load balancing algorithms beyond Round Robin and smart balancing.

Example of a random select algorithm for load balancing.

Offer to share more specific information on load balancing and assistance from IBM.

Transcripts

play00:00

Hi there, and thanks so much for

play00:01

stopping by today.

play00:02

My name is Bradley Knapp with IBM

play00:04

Cloud. And the question that I

play00:06

wanted to go over with you guys

play00:07

today is what is a network

play00:09

load balancer?

play00:10

And so I want you to imagine

play00:12

a scenario, right?

play00:14

You have decided that you are going

play00:15

to run a website and this website

play00:17

is going to be immensely popular.

play00:19

You need to build it to scale to

play00:21

serve millions of users,

play00:23

all of whom are accessing it at the

play00:25

same time. So imagine

play00:27

that single user and what

play00:30

is his experience going to be?

play00:31

Right.

play00:32

So you've get your guy, he's

play00:34

out here and he's got

play00:36

a laptop.

play00:37

Right. And so on his laptop, he

play00:39

wants to open your awesome

play00:41

new website. So he's going to send

play00:43

that traffic out into the

play00:45

Internet, which we're going to

play00:47

put a little cloud in there for the

play00:49

Internet.

play00:49

And then is it transmits through

play00:51

the Internet to the actual servers

play00:53

where the data is hosted, it's

play00:56

going to get down here, and it's

play00:57

going to get to an application

play00:59

server. And that application server

play01:01

is going to be what actually serves

play01:03

all of the data back

play01:05

via the Internet to his laptop

play01:07

so that he can view what's going on

play01:09

on your website.

play01:10

Now, that's fine.

play01:12

If you've just got one person who

play01:14

accesses your website at a time,

play01:16

what if you have ten people at once?

play01:18

Well, that app server is probably

play01:20

going to be fine to do that.

play01:21

What if you have 10000 people

play01:23

who are accessing it at once?

play01:25

And so that's when you get into

play01:26

these interesting scenario

play01:28

where you can saturate

play01:30

out this application server.

play01:32

And so if you think about an

play01:33

infrastructure level definition of

play01:35

an app server, you can scale them up

play01:37

to a certain size, but

play01:39

you've got limits in how big these

play01:41

application servers can be.

play01:43

So what do you do?

play01:44

All right. Well, you need to scale

play01:45

them out, right?

play01:46

Instead of having one app server,

play01:48

you might have three or you might

play01:50

have four, or you might have five,

play01:52

or you might have 10 or you might

play01:53

have 10000.

play01:54

You were going to horizontally scale

play01:57

those application servers

play01:58

so that you have enough to

play02:00

satisfy your customer load.

play02:03

But how do you know how much

play02:05

scaling you need?

play02:05

And more importantly, how does this

play02:07

guy with his laptop get

play02:09

to the application server that he

play02:11

needs in order to be successful?

play02:13

And the answer to that is in between

play02:15

your

play02:17

customer and all of your

play02:19

app servers, you are going

play02:21

to put a load balancer.

play02:22

What is a load balancer?

play02:24

It's a hardware device, or it could

play02:26

be a software defined device, and

play02:28

that load balancer is going to

play02:29

intercept all of the

play02:31

traffic that's coming in from the

play02:32

Internet. And it's going to decide

play02:35

what goes to this server, what goes

play02:37

to this server, what goes to this

play02:38

server, and so on, and so

play02:40

forth.

play02:41

It's also going to provide and

play02:43

collect information.

play02:44

So your application servers down

play02:46

here, they can be talking to this

play02:47

load balancer. They can be saying,

play02:49

hey, I'm only being used

play02:51

20 percent of the time.

play02:52

Maybe you don't need me right now.

play02:54

And that load balancer can then

play02:55

dynamically scale, or auto

play02:57

scale, and turn that application

play03:00

server off if you don't need it -

play03:01

helps drive down costs.

play03:03

Likewise, if all of your app servers

play03:05

are checking in and they're saying,

play03:06

hey, I'm super busy, I'm running at

play03:08

85, 90 percent utilization,

play03:10

it's time to bring in help.

play03:12

Then that load balancer can hit that

play03:14

auto scale service again and can

play03:15

say, hey, look, I need another one.

play03:17

I need another app server to try and

play03:19

decrease my load.

play03:21

And so when folks talk about cloud

play03:23

native architectures, this is a

play03:24

key component. The load balancer is

play03:26

a key component because that load

play03:28

balancers going to assign out that

play03:30

traffic to all of the different

play03:32

application servers, and

play03:34

then the app servers, they're all

play03:35

going to go down here and they're

play03:36

going to talk to a common database

play03:37

tier because you don't want to get

play03:39

into a goofy split brain scenario

play03:40

with your database.

play03:42

But they're going to get

play03:44

the data that they need and they're

play03:46

going to serve that back up to the

play03:47

end customer directly.

play03:48

So that's how you split up

play03:50

the data.

play03:51

That's how you serve it up.

play03:52

But so now that we're in load

play03:54

balancers, we said it's going to

play03:56

decide which application server

play03:58

gets the traffic, right.

play04:00

How does it decide what to

play04:02

do? And so let's get our three

play04:04

most common scenarios right.

play04:05

So we're going to go over here and

play04:07

we're going to have scenario one,

play04:09

scenario two,

play04:12

and then scenario three.

play04:17

So scenario one:

play04:19

our load balancer right here,

play04:21

right, it's got all its app

play04:23

servers and

play04:25

we're going to call this one a

play04:26

relatively dumb load

play04:28

balancer, right?

play04:29

We don't need a lot of complexity in

play04:31

it. It's serving a fairly basic

play04:32

purpose.

play04:33

And so it's going to use an

play04:34

algorithm called Round Robin

play04:37

in order to assign

play04:39

the traffic.

play04:40

And so what does Round-Robin mean?

play04:42

It means that for the first user

play04:44

that connects, it's going to send

play04:45

that person to App Server 1.

play04:48

For the second person who connects,

play04:49

it's going to send them to

play04:50

App Server 2, the third person

play04:52

who connects is going to go to

play04:53

App Server 3.

play04:55

And then when the fourth one comes

play04:56

in, it's just going to start back

play04:57

over again.

play04:58

Round-Robin literally means just

play05:00

going sequentially through it.

play05:01

Now, Round-Robin is not a perfect

play05:03

scenario.

play05:04

If you have user sessions that last

play05:06

a long time, some people log

play05:08

in and run for five

play05:10

minutes. Some people log in and run

play05:11

for two hours.

play05:13

Your app servers can get out of

play05:14

balance with one another when

play05:16

you're using that round robin

play05:18

scenario.

play05:19

And so then you need to think

play05:21

about things like smart load

play05:23

balancing. Smart load balancing is

play05:24

going to be our second piece here.

play05:26

Right. And this is an application

play05:28

server load-aware

play05:30

load balancer.

play05:31

So again, just like before, we've

play05:33

got our load balancer here and

play05:35

we've got our app servers.

play05:37

But this

play05:39

scenario, this smart load balancing

play05:41

scenario, rather than the

play05:43

load balancer just acting as

play05:45

king and directing what all happens,

play05:48

the load balancer works in

play05:49

cooperation with the application

play05:51

servers. So the app servers are

play05:53

constantly transmitting data

play05:55

back and forth to that load

play05:56

balancer, letting them know how

play05:58

busy it is and

play06:01

that load balancer's then going to

play06:02

make the decisions to send the

play06:04

incoming connections.

play06:05

So your guy over here, if

play06:07

he comes in and he starts

play06:09

a user session, that load balancer

play06:11

is going to say, look, server three

play06:12

has the least load on it right now.

play06:13

I'm going to sign him over here.

play06:15

And it's constantly monitoring that.

play06:17

Now, obviously, you're going to look

play06:18

at that and you're going to say, well,

play06:19

why wouldn't you always use this

play06:21

kind of setup?

play06:22

Well, it is more complex

play06:24

to get set up initially, right?

play06:25

It takes more configuration.

play06:27

Also, the load balancer software

play06:29

or the hardware device that you use

play06:31

to set this kind of a scenario up,

play06:33

it is more expensive.

play06:34

And so while technologically

play06:36

it's probably always the best choice

play06:38

for your specific scenario,

play06:40

it might not be.

play06:42

And then the third scenario

play06:44

that we've got down here.

play06:45

Right. So we've got our load

play06:47

balancer and all of our app servers.

play06:50

This is a scenario where you want

play06:52

a little bit more control

play06:55

than you do in just a straight round

play06:57

robin, but you don't want to go all

play06:58

the way through the set up and

play06:59

config and everything like that that

play07:00

you need with a smart load balancing

play07:02

scenario.

play07:04

And so there are actually like

play07:06

nine different algorithms that you

play07:07

can pick from that split the

play07:09

difference between these two.

play07:10

The one that I'm going to use

play07:12

right now as an example is a

play07:15

random select, right.

play07:16

So the load balancer, rather

play07:18

than sequentially working through an

play07:20

application server.

play07:21

One, two, three, one, two, three,

play07:23

one, two, three, over and over

play07:24

again. It's just going to run a

play07:26

randomizing function and it's

play07:28

going to decide that may be the

play07:29

first to go to one.

play07:30

And the third connection goes to two

play07:32

and connections four through six are

play07:34

going to go to three and so on and

play07:36

so forth.

play07:36

Again, it's just it's different

play07:38

kinds of algorithms to decide

play07:41

where you need to go, where you need

play07:42

to send that traffic.

play07:44

And if you want to get into

play07:45

specifics, there's tons of

play07:47

information out there.

play07:48

I'd be happy to share that with you.

play07:50

Let us know in the comments.

play07:52

If you want to know specific advice,

play07:54

please feel free to reach out to

play07:56

anybody in the channel or anybody at

play07:58

IBM. We'll be glad to help you

play08:00

design an architect, a load

play08:01

balancing solution that is going to

play08:03

work to help you solve

play08:05

the needs of your customer.

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Load BalancingNetwork ScalabilityCloud ArchitectureWeb TrafficIBM CloudApplication ServersRound RobinSmart BalancingAuto ScalingTech Solutions