Load Balancing and Apache Offer Clear Benefits for Users and Administrators

The Apache HTTP Server is one of the most widely used web servers. Its platform independence and open-source model are just two of the many reasons for its popularity. A load balancer is important for running web servers smoothly and professionally. This is especially true when a system hosts several websites with attached databases or when a website has grown considerably over time. Load balancing ensures that when a web server reaches a critical load, additional capacity from other servers is made available automatically. In practice, the load balancer sits in front of the actual server infrastructure and forwards incoming requests to one of the Apache servers that has sufficient free resources. Users benefit because websites respond reliably and quickly. For administrators, maintenance and operation become easier. The system reacts automatically and also compensates for failures of individual web servers. Further benefits become apparent in practice.

Apache and Automatic Load Distribution

Version 2.1 brought an interesting feature to the Apache HTTP Server. This is the load balancing already mentioned, which can be implemented with the module mod_proxy_balancer. The module is installed in addition to Apache on the server that previously acted as the web server. This system now becomes the actual load balancer. Any number of web servers can be placed behind it and addressed by the load balancer. For users, there is no visible change. They open the website as usual. The Apache load balancer accepts the request, forwards it to one of the connected web servers, and fetches the required data. The load balancer selects a system with sufficient free resources. This helps ensure that users can access websites with high performance.

mod_proxy_balancer offers further benefits, particularly for users. These concern logins and sessions, for example. Once the load balancer has assigned a user to a web server, that server remains responsible for the entire session. This avoids unusual website behavior, such as the user having to log in again. Regardless of how many web servers actually exist in the back end, this generally remains invisible to visitors of the website. They continue to open the familiar web address and notice no difference.

To set up a cluster of several servers, you need another module of the Apache HTTP Server. mod_proxy is responsible for creating a virtual host from several physical machines. This makes it possible to distribute web, application, and database servers across several systems. mod_proxy also allows two or more servers to be given the same task. In this way, two separate servers become web servers that can deliver exactly the same data.

Example Setup of Apache with Four Downstream Servers and Load Balancing

In practice, the following setup is possible. One Apache server acts as the load balancer and accepts requests from users. Directly behind the load balancer are two regular web servers running Apache. They host the actual website with mirrored content. Depending on the load, the load balancer decides which of the two web servers a user’s request is assigned to. A JBoss cluster is in turn placed behind the two Apache HTTP servers. It is protected against direct access from outside and can only be addressed by the web servers. This cluster also consists of two servers, which are available for applications. As with the web servers, the data is mirrored here as well. Both servers can be addressed by both HTTP servers, so automatic load distribution is possible at this tier too. The final tier is the database server. It answers queries to SQL databases, for example, and hosts all databases required to run the website.

Further Benefits for Scaling, Updates, and Maintenance

The benefits for website operators are most evident in administration. Updates and changes to websites, for example, are critical and unpopular moments for operators. With websites hosted entirely on one server, the site normally has to be taken offline to carry out this work. Apache includes a Balancer Manager that shows the status of the connected HTTP web servers. It also allows individual web servers to be disabled. Work on the website can thus be carried out while the site remains reachable. You can roll out an update on one of the two web servers first, check the changes internally, and then switch the active web server through the Balancer Manager. You then roll out the update on the second web server and re-enable both through the manager. For users, the website and all applications remain reachable, and the site does not have to be taken offline.

The Apache load balancer also absorbs unexpected failures. If one of the two web or application servers fails during operation, the website remains reachable. All requests are directed to the server that is still active. The Balancer Manager shows you the state of the HTTP servers, so you can spot problems at a glance. You then have the opportunity to respond in a targeted way. With the Apache server and the load balancer, you can therefore build highly available systems.

Another positive characteristic of load balancing is the efficient use of resources. Systems no longer have to be sized for a maximum load that is reached only rarely at peak times. Instead, load balancing allows further systems to be added to the infrastructure quickly and flexibly when needed. Load balancers also make it possible to build a scalable infrastructure. This is especially beneficial for fast-growing websites with large databases and applications, since they require a great deal of computing power. Rather than permanently keeping an eye on the capacity of a single system, you simply add new systems that serve as web, application, or database servers.

Conclusion

Taken as a whole, many individual aspects speak in favor of the Apache HTTP Server and load balancing. In professional web hosting, reliability, performance, an efficient infrastructure, and administration that is as automated as possible matter most. All of these points can be addressed with the load balancing capabilities of the Apache HTTP Server. Scalability and the option of expanding the cluster as needed are further arguments for this approach. In addition, Apache is platform independent and open source. Thanks to these characteristics, the Apache HTTP Server with a load balancer is well suited to the demands of professional web hosting.

Share LinkedIn X Email