Search code examples
apachetomcatproxyload-balancingmod-proxy

apache http server load balancer monitoring


I configured apache http server to act as load balancer using mod-proxy module

<Proxy balancer://clusterABCD>
    BalancerMember http://192.168.0.222:8080/geoserver/wms loadfactor=8
    BalancerMember http://192.168.0.14:8081/geoserver/wms loadfactor=8
    BalancerMember http://192.168.0.222:8082/geoserver/wms status=+H
    ProxySet lbmethod=bytraffic
    Order allow,deny
    Allow from all
</Proxy>

ProxyPass /LGroup balancer://clusterABCD/

Is there any way to monitor the load balancer functionality

My question is

  1. is there any way to find from which BalanceMember the request is processing
  2. is there any settings available to increase functionality

Thanks IN Advance


Solution

  • In response to your both your questions, yes it is possible but you will need to enhance your configuration for Apache Load Balancing via Mod Proxy to have this functionality available.

    I suggest you use the sample setup below:

    <VirtualHost *:80>
    ProxyRequests off
    
    ServerName servername.local
    
    <Proxy balancer://mycluster>
            # TomcatA
            BalancerMember http://172.20.20.101:8080 route=tomcatA
            # TomcatB
            BalancerMember http://172.20.20.102:8080 route=tomcatB
            # TomcatC
            BalancerMember http://172.20.20.103:8080 route=tomcatC
    
    
            # Security – to determine who is allowed to access
            # Currently all are allowed to access
            Order Deny,Allow
            Deny from none
            Allow from all
    
            # Load Balancer Settings
            # We will be configuring a simple Round
            # Robin style load balancer.  This means
            # that all nodes take an equal share of
            # of the load.
            ProxySet lbmethod=byrequests
    
    </Proxy>
    
    # balancer-manager
    # This tool is built into the mod_proxy_balancer
    # module and will allow you to do some simple
    # modifications to the balanced group via a gui
    # web interface.
    <Location /balancer-manager>
            SetHandler balancer-manager
    
            # I recommend locking this one down to your
            # administering location
            Order deny,allow
            Allow from all
    </Location>
    
    # Point of Balance
    # This setting will allow to explicitly name the
    # location in the site that we want to be
    # balanced, in this example we will balance "/"
    # or everything in the site.
    ProxyPass /balancer-manager !
    ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=Off scolonpathdelim=On
    

    To view the Balance Request you need to have the module

    mod_proxy_balancer

    installed and then use the configuration from above.

    In regards to availability, it depends on the Load Balancer Settings the Round Robin approach share the traffic equally between the nodes, and is seen as possibly the best option for availabilty:

    ProxySet lbmethod=byrequests

    Also, if you are considering sharing sessions with your request from Apache to app servers, then configuration to the AJP instead of the HTTP port is needed along with changes needed on the Application Servers (such as Tomcat). More details are available at:

    Load Balancing: Apache versus Physical Appliance