Mike explores the concepts of load balancing, as well as why and how to implement this type of configuration.
- I'm really excited because I've got myself a web server serving something cool, whatever it is, you know, the new Mike Web App or whatever it might be. So, I'm real happy with my web server, in fact, I'm just gonna put "WWW" up here to remind us it's a web server. I'm so happy with my web server because more and more people are accessing my web server and after a while I need some help because I've got so many people accessing my web server that it's slowing this guy down.
So, what I need to do is come up with a way to have lots and lots of web servers, but if I have lots and lots of web servers they have to be giving out the same thing and they have to be doing it at the same time and there could be a lot of challenges. So, what we're gonna talk about in this episode is load balancing. Load balancing simply means to be able to have lots of servers giving out the same thing and to do it in a nice, even way. We're gonna be using web servers here, but it's not limited to web servers. There's all kinds of stuff that uses load balancing, but let's stick with the web, 'cause everybody's comfortable with that.
So, the first thing that's gonna be happening here, is I'm gonna start adding more servers. Now, as I add more servers, these servers are passing out the exact same thing the exact same web pages. Now, let's assume for a moment that these web servers are physically in the same room, okay? And what I wanna do, is I want to have the ability to not overload any one of these, to space out the requests across the three servers.
Now, there's a lot of different ways to do this, load balancing, the first way I wanna talk about is kind of an old fashioned way, but it's on the exam so it's worth mentioning. And that's using a DNS server. So, I've got a DNS server someplace else that's actually the authoritative server for this particular domain. And what we're gonna do is we're gonna put stuff inside the DNS server to kinda fool people. So, I'm gonna call this WW one, WW two, and WWW three. And what I can create is a lookup zone that does something very, very interesting called round robin.
With a round robin what I'll do, I'm gonna have all three of these guys in a lookup zone and I'm gonna have a kind of a special DNS server. And what this DNS server does, is that when a request comes in, first it gives it to number one. The next request comes in then gives it number two. Next request comes in then he gives it to number three. This is about the first generation of load balancing called round robin, and it worked okay, but there were some problems with it.
For example, remember that if I as a client access this web site, I'm going to cache the IP address. So, what will happen is next time I try to get to this particular site, I'm not even gonna use this DNS server. I've already got, say, this guy's IP address. So, round robin load balancing was kind of the first generation, had a few problems, but they worked on it. The other big issue that comes into play with load balancing is what if all these computers are in different continents? Now, this is a big thing that a lot of us do because it's a lot faster to get to a physically close server than one that's far away.
So, the other thing we'll do is another DNS feature called delegation. There's my eraser. With delegation what we'll do is we'll set up another zone, but it's gonna have sub-zones for each of these and most importantly, it's gonna have a reverse lookup zone with different PTR records for each of these. Now, this does something really interesting in the world of DNS.
What'll start taking place, is if I have some client over here, when he comes in just tries to query to this guy, he might, he's gonna try to get to the zone that's closest to him. And what will happen is you'll have this DNS server and another DNS server someplace else, and they'll actually compete for resolving to that particular DNS. And what will happen is based on the amount of time to get on the pointer value, you really end up going with the closest one.
And this is a very common way to handle load balancing just using DNS. The problem with DNS load balancing is that you're counting on a third tool, DNS, to do what you need to do. So, a lot of times what will happen is that we will dump DNS completely and instead do what's known as server-side load balancing. Server-side load balancing usually involves some kind of very, very smart device running very, very smart software that is physically at the location of your servers.
There's some real benefits to having your web servers or whatever servers you might have at the same physical location. One big benefit is we could take advantage of something called clustering. With clustering what we'll do is we will have separate machines, or at least separate virtual machines, but what they'll do is they will actually talk to each other on the back end. They will have their own little private network. And what this little back end private network does, separate network cards and everything, makes sure that all three of these systems are absolutely identical at all times.
For example, if you have a database involved or something like that, these guys can all update each other. Even more interesting, when you're using clustering, you can usually offload all of your data to a separate device, and all three of these will simply just read off that. So, if you add a new game or if you add a new customer record, you're not trying to add it to three different machines, you're just adding it to one database. So, clustering is a huge benefit. So, when we're doing server-side like this we get some other really cool features.
First of all, this smart box, this load balancer, can actually talk to these guys individually. And by talking to them individually we can do some cool things. Cool thing number one, he can actually query and go, "Are you busy right now?" He can see who's the least busy and then send that data over to that particular machine. If the machine goes down he can automatically re-rout without any problems whatsoever. This guy can even act as a proxy server, for example, this box right here can handle all the SSL if you're on a https website he can be a certificate server and handle all this and take that load off of these individual machines.
So, load balancing is an incredibly powerful tool. Now, right here you'll notice I'm showing this as a box, what's fascinating in today's world is that most people, if you have a website anymore it's probably gonna be on the cloud. So, what will happen is you'll have three or four instances of your particular web app, your web page, whatever it might be, and even the load balancer these days is virtualized. So, all of this is really nothing more than software and where it's running, we don't care because the beautiful part about it is that load balancing works.
Now, there's some features about load balancing you need to be careful about. Let's just say for example, I'm a client and I get assigned to this machine, well if I'm assigned to this machine I might have some certain things going on at any given moment that I wanna get back to that machine and even though the load says, "Oh, he's the slow one now." A good load balancer will sit there and go, "Ah, you have a session with this particular client, "as long as your session lasts "I'm not gonna move you to another machine. "I'll keep you on that machine until "your particular session is done." So, this is just a real basic idea of load balancing, it's a fascinating world and you get to add all kinds of interesting boxes to your network to take care of these things, but do keep in mind that there's really two big chunks to load balancing, at least for the exam.
There's gonna be DNS solutions, and then server-side solutions. Make sure you're comfortable with those two.
This Total Seminars course covers the exam certification topics. For information on additional study resources—including practice tests, lab simulations, books, and discounted exam vouchers—visit totalsem.com/linkedin. LinkedIn Learning members receive special pricing.
This course was created by Total Seminars. We are pleased to offer this training in our library.
We are a CompTIA Partner. As such, we are able to offer CompTIA exam vouchers at a 10% discount. For more information on how to obtain this discount, please download these PDF instructions.
- Making secure connections through tunnels
- InterVLAN routing
- Port bonding and port mirroring
- IDS vs. IPS
- Routing and switching with IPv6
- Packet switching
- ISDN and BPL
- Remote desktop connectivity