Ok, you’ve seen what load balancing can do, but what actually is it? The term has been around for many years and chances are that anyone who hasn’t kept up with development of the Web will think it has to do with electricity and power stations. Before you laugh, they’re quite correct, so this is a great place for you to start your load-balancing journey! No really, it is!
Load Balancing, Old Style Most things in the home use electricity and that electricity comes from the power grid. To generate electricity, we need power stations of some form or another. That much is fairly obvious and straightforward.
However, at different times of the day the requirement for power changes. In the morning, when people are getting up and getting ready for work, there is a large demand. People are turning on kettles, toasters, ovens, and other high usage appliances. The grid needs to make sure that there is enough power available for everyone to do this.
But what happens when people go to work? Suddenly not so much power is needed, but you can’t just turn off a power station. It’s also quite possible that when everyone starts making breakfast, the load placed on the grid is higher than what the individual power stations can supply. Fortunately, it’s load balancing to the rescue. By storing power when it’s not being used during the off-peak times, the grid is able to provide higher amounts of power during the on-peak times. So, how is this like load balancing in the computing world?
Well, it all comes down to having finite resources and trying to make the best possible use of them. You have the goal of making your web sites fast and stable; to do that you need to route your requests to the machines best capable of handling them.
Load Balancing, New Style In computing terms, you’re going to be doing something similar. People put load on your web site by making lots of requests to it. This is a normal state of affairs and is, after all, why you have a web site in the first place. No one wants a web site that nobody looks at. But what happens when people turn on their appliances and start stressing your server? At this point things can go bad; if the load is too high (because too many people are visiting), your web site is going to take a performance hit. It’s going to slow down, and with more and more users, it will get slower and slower until it fails completely. Not what you want.
To get around this, you need more resources. You can either buy a bigger machine to replace your current server (scale up) or you can buy another small machine to work alongside your existing server (scale out).