Last updated on November 16th, 2015 at 09:56 am
What is mod_proxy_balancer?
mod_proxy_balancer is an Apache module available since Apache 2.1. It allows turning an Apache installation into a load balancer retrieving requested pages from two or more backend web servers and delivering them to the userâ€™s computer.
One important feature of mod_proxy_balancer is that it can keep track of sessions which means that a single user always deals with the same backend webserver (sticky sessions).
Requirements and installation
The module requires:
an Apache HTTP Server installation version 2.1 or later (at the time of writing, 2.2.15 is the latest version available);
In order to install Apache and the required extensions, download the sources from the Apache HTTP Server website, untar the archive and run the following commands from the main directory:
./configure –enable-proxy –enable-proxy-balancer [run ./configure -h to list all the available options]
Main URL is http://loadtest.mistonline.in
and we have 2 nodes [MEMBERS] namely http://load1.mistonline.in and http://load2.mistonline.in
ProxyPass /example balancer://mywebcluster
An instance of cluster is created (mycluster) with two members.
The /example URL of the load balancer (i.e. http://loadtest.mistonline.in/example) is mapped to the two members.
Requests to the load balancer will be alternatively forwarded to the workers or members.
Three load balance methods are currently available:
byrequests: weighted request count balancing;
bytraffic: weighted traffic byte count balancing;
bybusyness: pending request balancing.
More coming soon….