Previous | Next --- Slide 11 of 66
Back to Lecture Thumbnails
Split_Personality_Computer

Would a load balancer just keep track of how many requests each server is currently processing, or is there some smarter way of estimating load?

This still seems like the balancer wouldn't be doing much work; do balancers ever preprocess the requests to make it easier for the server they eventually send off to?

cloudhary

@Split_Personality_Computer Load balancers have many different methods of distributing the workload. One of the simplest ones would be to randomly assign an incoming request to a machine. Another might be to do some sort of round robin. Another might be to assign probabilities with which to send an incoming request to each machine. Another might be to keep track of how much workload each machine has and to send to the one that has the least, which you suggested. As you can see, there are so many different options, and I bet I didn't even cover what actually gets used by these big companies. As for the fact that load balancers don't do much work - if the load balancer starts doing a lot of work and bottles up, that would affect performance of the entire system regardless of the efficiency of the web server. So it's probably best it was not left doing a lot.