Re: mod_proxy_balancer not balancing equally

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

2017-01-25 22:05 GMT+01:00 Vamsee Lakamsani <vamsee@xxxxxxxxx.invalid>:

Hi,

We are using mod_proxy_balancer (mod_lbmethod_byrequests) with Apache httpd 2.4 on   Amazon Linux 4.4.41-35.53.amzn1.x86_64 (2016.09). 
We are using the docs from here:



Here is our balancer setup:

ProxyHCExpr ok234 {%{REQUEST_STATUS} =~ /^[234]/}
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
<Proxy "balancer://mainBalancer">
BalancerMember "http://api1:3000" route=1 loadfactor=1 hcmethod=GET hcuri=/onkore/api/v1/time hcexpr=ok234 hcinterval=10 hcpasses=2 hcfails=3
BalancerMember "http://api2:3000" route=2 loadfactor=1 hcmethod=GET hcuri=/onkore/api/v1/time hcexpr=ok234 hcinterval=10 hcpasses=2 hcfails=3
BalancerMember "http://api3:3000" route=3 loadfactor=1 hcmethod=GET hcuri=/onkore/api/v1/time hcexpr=ok234 hcinterval=10 hcpasses=2 hcfails=3
BalancerMember "http://api4:3000" route=4 loadfactor=1 hcmethod=GET hcuri=/onkore/api/v1/time hcexpr=ok234 hcinterval=10 hcpasses=2 hcfails=3
BalancerMember "http://api5:3000" route=5 loadfactor=1 hcmethod=GET hcuri=/onkore/api/v1/time hcexpr=ok234 hcinterval=10 hcpasses=2 hcfails=3
BalancerMember "http://api6:3000" route=6 loadfactor=1 hcmethod=GET hcuri=/onkore/api/v1/time hcexpr=ok234 hcinterval=10 hcpasses=2 hcfails=3
BalancerMember "http://api7:3000" route=7 loadfactor=1 hcmethod=GET hcuri=/onkore/api/v1/time hcexpr=ok234 hcinterval=10 hcpasses=2 hcfails=3
BalancerMember "http://api8:3000" route=8 loadfactor=1 hcmethod=GET hcuri=/onkore/api/v1/time hcexpr=ok234 hcinterval=10 hcpasses=2 hcfails=3
BalancerMember "http://api9:3000" route=9 loadfactor=1 hcmethod=GET hcuri=/onkore/api/v1/time hcexpr=ok234 hcinterval=10 hcpasses=2 hcfails=3
BalancerMember "http://api10:3000" route=10 loadfactor=1 hcmethod=GET hcuri=/onkore/api/v1/time hcexpr=ok234 hcinterval=10 hcpasses=2 hcfails=3
ProxySet lbmethod=byrequests stickysession=ROUTEID nofailover=Off
</Proxy>
We are seeing (as measure by New Relic our monitoring service) that http request are not being distributed equally. The first server (api1) is getting more than the second one and so on with the last one getting the least amount of request. Attached is a screen shot that shows this.

Quick sanity check: have you verified from the httpd access logs that the monitoring service is reporting correct metrics? 
 
We would appreciate any feedback on what is causing this and how to fix.  A related question is on the health checks. Is there any way to avoid copy/pasting the health check info on all the member lines?

https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html#stickyness

I would check what is the effect of the configured sticky session to the load balancer behavior (for example do some tests without it if possible).

Hope that helps!

Luca 

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux