You use a load balancer in the high availability cluster to distribute the workload evenly over two or more servers and to achieve optimal network performance.
The following figure shows how the load balancer forwards browser requests to one of the Tomcat instances:
In this diagram, the browser sends the request to the load balancer. The load balancer determines which Tomcat instance will handle the request and forwards the request to the Tomcat instance. The Tomcat instance processes the request and sends the result back to the load balancer. The load balancer forwards the result back to the browser.
The load balancer determines which Tomcat computer handles each request. This computer might vary from request to request and depends on the configuration.
You can use any load balancing software or hardware.
This chapter includes examples for configuring load balancing with a newly installed copy of Apache HTTP Server.