Web server load balancing is essential when a website starts gaining more traffic than it is capable of handling or in case of dynamic web page services being provided by the website. A web server's performance is restricted by the underlying hardware and the available bandwidth. Load balancing a web server can effectively improve website performance and also increase the availability of the web services being provided by the web server.
Why is Web Server Load Balancing Essential
The performance of a web server depends completely on the underlying hardware and the bandwidth available to it. Under such restrictions, a web server is only capable of responding to a limited number of requests from clients. In a situation where more number of requests are made to the server than it can actually handle, a bottleneck situation occurs where the other requests wait till the server has finished responding to the previous requests. This results in a slow performance by the website from a user's point of view.
Also, if the services provided by the website are dynamic in nature such as dynamically generated content in response to a client request script, the limitations of the server increase many folds. This again results in a slow website.
How Does Load Balancing a Web Server Help
Load balancing is a technique in which a single point of operation is converted into many points i.e., more than one servers are made responsible for responding to client requests. The load is spread among many servers. This helps increase the number of resources that a web server can utilize.
The most common form of load balancing is to share multiple copies of the same files or website resources on different machines represented by the same network address and diverting traffic to the servers that are most capable of responding to the request.
How to Load Balance a Web Server
Web server load balancing can be done in several ways. The most common method is to use several servers instead of using a single machine. The purpose is to let the client see the group of servers as one single server. This can be done by a technique known as IP spraying.
A load balancer is placed at the gateway between a client request and the group of servers. This load balancer helps distribute the HTTP requests over the group of servers in a way to evenly spread the load.
The most basic technique of load balancing web servers involves DNS load balancing where several copies of the same website are placed on different servers and serving client requests on different servers. The DNS entry of the website returns different IP addresses each corresponding to a server.
There is a major drawback in this scheme of load balancing. The DNS entries are cached by client browsers and the other servers. This results in a client continuing to use the same copy on the same server, hence deterring the performance of the web server in case many requests require the service of the same server simultaneously, even when there are many servers available.
The above problem can be solved by using a reverse proxy server, that receives requests from clients and responses from the web servers and caches these on itself. When a repeated request is made, the proxy server can provide cached data; and on a request for dynamic content, it can divert the request to the most suitable server.
Advantages of Web Server Load Balancing
As discussed above, excessive load on the web server hinders the performance of the website. Web server load balancing not only improves website performance but also increases its scalability and reliability. In case the website experiences a sudden burst of traffic, load balancing helps managing the traffic to maintains it availability.
Further Reading:
- What is Internet Link Load Balancing and Link Load Balancer
- Windows Network Load Balancing Service Tutorial
- Load Balancers as Firewalls: Firewall Load Balancing Overview
Sources:
Network Load Balancing Technical Overview from Microsoft