Grades 9–12 · Computing
How can a busy website distribute requests across several servers?
A popular website may receive more requests than one application server can handle comfortably. A load balancer accepts incoming requests and chooses among several servers that can provide the service.
In the diagramOne entry point distributes incoming workload balancerrequestsserver 1server 2server 3routing policyshared databaseDistribution cannot remove every shared bottleneck.
One policy sends successive requests around a repeating list. Another favors the server with fewer active connections, which can help when requests take different lengths of time. The policy determines distribution; it does not make every request require the same work.
The system also needs information about whether a server is usable. Failed attempts or explicit checks can help stop traffic being sent repeatedly to an unavailable machine. New servers can add capacity when the surrounding system supports them.
Distribution does not automatically solve every bottleneck. Servers may depend on the same database, and information associated with a user’s session must remain accessible. Reliability therefore depends on the application, storage and load-balancing layer working together rather than simply multiplying the number of machines.
About this explanation
Starting knowledge: Understand a web request, a server response and that one machine has limited processing capacity.
Sources
- NGINX — Using nginx as HTTP load balancer