You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Amol Puglia <am...@yahoo.com> on 2013/02/11 09:52:59 UTC

[users@httpd] apache mod_proxy_balancer is not redirecting user request evenly to bakcend tomcat servers.

Hello Team,

I have configured loadbalancing using apache web server with mod_proxy and mod_proxy_balancer module.

I am having following versions of apache and tomcat 


Apache web server version :- Server version: Apache/2.2.16 (Unix)
                                              Server built:   Sep 27 2010 12:48:44


Tomcat Application Server :- Apache Tomcat/6.0.26

Now the issue is the load is not balanced properly between the tomcat servers in the backend.
It means there are more users are on some tomcat and less users on other tomcats.
I wanted to distribute equal loads on all tomcats.
Kindly give me suggestions.
Let me know if any information is required.


Below is the configuration of loadbalancer in httpd.conf file.

# Port 80
   Listen server1:80
   
   <VirtualHost _default_:80>
      ServerName server1
       
        ServerAlias sev2
        <Directory /app>

        Order deny,allow

        Deny from all

        Allow from 153.88.251.174 153.88.251.160 153.88.251.165 153.88.251.170 153.88.251.212 153.88.251.199

      </Directory>

      Timeout 3600
      ProxyTimeout 3600
      ProxyRequests Off
      ProxyPass /app balancer://cluster stickysession=JSESSIONID|jsessionid nofailover=On
      ProxyPreserveHost On
      
      ProxyPass /app ajp://server2:8009/app
      ProxyPass /app ajp://server2:8010/app
      ProxyPass /app ajp://server2:8011/app
      ProxyPass /app ajp://server2:9009/app
      ProxyPass /app ajp://server2:9010/app
      ProxyPass /app ajp://server2:9011/app


      ProxyPassReverse /app ajp://server2:8009/app
      ProxyPassReverse /app ajp://server2:8010/app
      ProxyPassReverse /app ajp://server2:8011/app
      ProxyPassReverse /app ajp://server2:9009/app
      ProxyPassReverse /app ajp://server2:9010/app
      ProxyPassReverse /app ajp://server2:9011/app
        
       <Proxy balancer://cluster>
         BalancerMember ajp://server2:8009/app route=marsprod_rmiserver_1 loadfactor=33 retry=60
         BalancerMember ajp://server2:8010/app route=marsprod_rmiserver_2 loadfactor=33 retry=60
         BalancerMember ajp://server2:8011/app route=marsprod_rmiserver_3 loadfactor=33 retry=60
         BalancerMember ajp://server2:9009/app route=marsprod_rmiserver_4 loadfactor=33 retry=60
         BalancerMember ajp://server2:9010/app route=marsprod_rmiserver_5 loadfactor=33 retry=60
         BalancerMember ajp://server2:9011/app route=marsprod_rmiserver_6 loadfactor=33 retry=60
         ProxySet lbmethod=bybusyness
       </Proxy>

       #Status page for balancer

       <Location /balancer>
       SetHandler balancer-manager
       Order Deny,Allow
       Deny from all
       Allow from all
      </Location>

      ProxyStatus On
      
      <Location /status>
      SetHandler server-status
      Order Deny,Allow
      Deny from all
      Allow from all
      </Location>

      ErrorLog /opt/web/apache/app/logs/error.log

  </VirtualHost>

Re: [users@httpd] apache mod_proxy_balancer is not redirecting user request evenly to bakcend tomcat servers.

Posted by Giles Coochey <gi...@coochey.net>.
On 12/02/2013 07:06, Amol Puglia wrote:
> Hello Giles,
>
> You mean we should disable stickyness option to distribute load evenly 
> on all tomcats.
>
> Is there any other way to distribute load evenly on the servers 
> without disabling stickyness option in apache configuration?
>
>
Stickyness is, in general, needed - so that each user who accesses the 
site tends to use the same backend server - otherwise you might find 
that users are, for instance, redirected to a logon page when they click 
a link within the application. This is because that user only 
established the session with one of the backend servers. There are 
various methods on how to achieve that stickness and you will have to 
take a look at how your backend application works to find out what might 
give you the best load balancing results.

Because of this stickyness though, you will never get exact 50/50 or 
33/34/33 load balancing, but as you increase the number of users the 
statistical even-ness of your load balancing ought to level out.

-- 
Regards,

Giles Coochey, CCNA, CCNAS
NetSecSpec Ltd
+44 (0) 7983 877438
http://www.coochey.net
http://www.netsecspec.co.uk
giles@coochey.net


Re: [users@httpd] apache mod_proxy_balancer is not redirecting user request evenly to bakcend tomcat servers.

Posted by Amol Puglia <am...@yahoo.com>.
Hello Giles,

You mean we should disable stickyness option to distribute load evenly on all tomcats.

Is there any other way to distribute load evenly on the servers without disabling stickyness option in apache configuration?




________________________________
 From: Giles Coochey <gi...@coochey.net>
To: users@httpd.apache.org 
Sent: Monday, February 11, 2013 7:05 PM
Subject: Re: [users@httpd] apache mod_proxy_balancer is not redirecting user request evenly to bakcend tomcat servers.
 
On 11/02/2013 13:29, Eric Covener wrote:
> On Mon, Feb 11, 2013 at 8:18 AM, Amol Puglia <am...@yahoo.com> wrote:
>> Kindly reply to my POST
> Seems like a duplicate of  "LoadBalancingIssue - Users are not
> distributed equally among users"?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
I suspect you have encountered a byproduct of 'stickyness', as described 
in the documentation:

http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html

Re: [users@httpd] apache mod_proxy_balancer is not redirecting user request evenly to bakcend tomcat servers.

Posted by Giles Coochey <gi...@coochey.net>.
On 11/02/2013 13:29, Eric Covener wrote:
> On Mon, Feb 11, 2013 at 8:18 AM, Amol Puglia <am...@yahoo.com> wrote:
>> Kindly reply to my POST
> Seems like a duplicate of  "LoadBalancingIssue - Users are not
> distributed equally among users"?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
I suspect you have encountered a byproduct of 'stickyness', as described 
in the documentation:

http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html




Re: [users@httpd] apache mod_proxy_balancer is not redirecting user request evenly to bakcend tomcat servers.

Posted by Eric Covener <co...@gmail.com>.
On Mon, Feb 11, 2013 at 8:18 AM, Amol Puglia <am...@yahoo.com> wrote:
>
> Kindly reply to my POST

Seems like a duplicate of  "LoadBalancingIssue - Users are not
distributed equally among users"?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache mod_proxy_balancer is not redirecting user request evenly to bakcend tomcat servers.

Posted by Amol Puglia <am...@yahoo.com>.
Kindly reply to my POST




________________________________
 From: Amol Puglia <am...@yahoo.com>
To: "users@httpd.apache.org" <us...@httpd.apache.org> 
Sent: Monday, February 11, 2013 2:22 PM
Subject: [users@httpd] apache mod_proxy_balancer is not redirecting user request evenly to bakcend tomcat servers.
 

Hello Team,

I have configured loadbalancing using apache web server with mod_proxy and mod_proxy_balancer module.

I am having following versions of apache and tomcat 


Apache web server version :- Server version: Apache/2.2.16 (Unix)
                                              Server built:   Sep 27 2010 12:48:44


Tomcat Application Server :- Apache Tomcat/6.0.26

Now the issue is the load is not balanced properly between the tomcat servers in the backend.
It means there are more users are on some tomcat and less users on other tomcats.
I wanted to distribute equal loads on all tomcats.
Kindly give me suggestions.
Let me know if any information is required.


Below is the configuration of loadbalancer in httpd.conf file.

# Port 80
   Listen server1:80
   
   <VirtualHost _default_:80>
      ServerName server1
       
        ServerAlias sev2
        <Directory /app>

        Order deny,allow

        Deny from all

        Allow from 153.88.251.174 153.88.251.160 153.88.251.165 153.88.251.170 153.88.251.212 153.88.251.199

      </Directory>

      Timeout 3600
      ProxyTimeout 3600
      ProxyRequests Off
      ProxyPass /app balancer://cluster stickysession=JSESSIONID|jsessionid
 nofailover=On
      ProxyPreserveHost On
      
      ProxyPass /app ajp://server2:8009/app
      ProxyPass /app ajp://server2:8010/app
      ProxyPass /app ajp://server2:8011/app
      ProxyPass /app ajp://server2:9009/app
      ProxyPass /app ajp://server2:9010/app
      ProxyPass /app ajp://server2:9011/app


      ProxyPassReverse /app ajp://server2:8009/app
      ProxyPassReverse /app ajp://server2:8010/app
      ProxyPassReverse /app ajp://server2:8011/app
      ProxyPassReverse /app ajp://server2:9009/app
      ProxyPassReverse /app ajp://server2:9010/app
      ProxyPassReverse /app
 ajp://server2:9011/app
        
       <Proxy balancer://cluster>
         BalancerMember ajp://server2:8009/app route=marsprod_rmiserver_1 loadfactor=33 retry=60
         BalancerMember ajp://server2:8010/app route=marsprod_rmiserver_2 loadfactor=33 retry=60
         BalancerMember ajp://server2:8011/app route=marsprod_rmiserver_3 loadfactor=33 retry=60
         BalancerMember ajp://server2:9009/app route=marsprod_rmiserver_4 loadfactor=33 retry=60
         BalancerMember ajp://server2:9010/app route=marsprod_rmiserver_5 loadfactor=33 retry=60
         BalancerMember ajp://server2:9011/app route=marsprod_rmiserver_6
 loadfactor=33 retry=60
         ProxySet lbmethod=bybusyness
       </Proxy>

       #Status page for balancer

       <Location /balancer>
       SetHandler balancer-manager
       Order Deny,Allow
       Deny from all
       Allow from all
      </Location>

      ProxyStatus On
      
      <Location /status>
      SetHandler
 server-status
      Order Deny,Allow
      Deny from all
      Allow from all
      </Location>

      ErrorLog /opt/web/apache/app/logs/error.log

  </VirtualHost>