Bug 56312

Summary: Can't configure different balancing workers that contain the same balancer url
Product: Apache httpd-2 Reporter: Marc Arens <marc.arens>
Component: mod_proxy_balancerAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED LATER    
Severity: normal CC: lakshmi
Priority: P2 Keywords: MassUpdate
Version: 2.2.22   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Marc Arens 2014-03-25 16:21:39 UTC
Let's take an example config that configures 3 different balancer workers named cluster_100, cluster_200, cluster_300 that each have a different timeout of 100s, 200s and 300s. Now we want to ProxyPass specific application paths to those configured workers as we know that those different applications need different timeout values to handle requests properly e.g. /ajax/test_200 needs up to 200s to write a response to a request so we map it to balancer://cluster_200/ajax/test_200.

<IfModule mod_proxy_http.c>
  ProxyRequests Off
  ProxyStatus On
  ProxyPreserveHost On

  <IfModule mod_status.c>
    <Location /balancer-manager>
      SetHandler balancer-manager
      Order Allow,Deny
      Allow from all
    </Location>
  </IfModule>

  # Define default Proxy container
  <Proxy balancer://cluster_100>
      Order deny,allow
      Allow from all
      BalancerMember http://127.0.0.1:8009 timeout=100 smax=0 ttl=60 retry=0 loadfactor=50 keepalive=On route=member1
      #BalancerMember http://your_additional_member:8009 timeout=100 smax=0 ttl=60 retry=0 loadfactor=50 keepalive=On route=member2
      ProxySet stickysession=JSESSIONID|jsessionid scolonpathdelim=On
      SetEnv proxy-initial-not-pooled
      SetEnv proxy-sendchunked
  </Proxy>

  <Proxy balancer://cluster_200>
      Order deny,allow
      Allow from all
      BalancerMember http://127.0.0.1:8009 timeout=200 smax=0 ttl=60 retry=0 loadfactor=50 keepalive=On route=member1
      #BalancerMember http://your_additional_member:8009 timeout=200 smax=0 ttl=60 retry=0 loadfactor=50 keepalive=On route=member2
      ProxySet stickysession=JSESSIONID|jsessionid scolonpathdelim=On
      SetEnv proxy-initial-not-pooled
      SetEnv proxy-sendchunked
  </Proxy>

  <Proxy balancer://cluster_300>
      Order deny,allow
      Allow from all
      BalancerMember http://127.0.0.1:8009 timeout=300 smax=0 ttl=60 retry=0 loadfactor=50 keepalive=On route=member1
      #BalancerMember http://your_additional_member:8009 timeout=300 smax=0 ttl=60 retry=0 loadfactor=50 keepalive=On route=member2
      ProxySet stickysession=JSESSIONID|jsessionid scolonpathdelim=On
      SetEnv proxy-initial-not-pooled
      SetEnv proxy-sendchunked
  </Proxy>

  ProxyPass /ajax/test_100        balancer://cluster_100/ajax/test_100
  ProxyPass /ajax/test_200        balancer://cluster_200/ajax/test_200
  ProxyPass /ajax/test_300        balancer://cluster_300/ajax/test_300
  ProxyPass /ajax                 balancer://cluster_100/ajax
  ProxyPass /servlet              balancer://cluster_100/servlet

</IfModule>

All of this works as expected in 2.4.6.

Testing this with 2.2.16 (debian squeeze) or 2.2.22 (debian wheezy) though fails as requests to /ajax/test_200 which need 200s or to /ajax/test_300 which need 300s to return a result are terminated after 100s, the timeout configured for balancer://cluster_100.


Raising the LogLevel to debug informs us about the following:
 service apache2 restart
[....] Restarting web server: apache2[Tue Mar 25 17:18:30 2014] [info] worker http://192.168.32.50:8009 already used by another worker
[Tue Mar 25 17:18:30 2014] [info] worker http://192.168.32.50:8009 already used by another worker
 ... waiting [Tue Mar 25 17:18:31 2014] [info] worker http://192.168.32.50:8009 already used by another worker
[Tue Mar 25 17:18:31 2014] [info] worker http://192.168.32.50:8009 already used by another worker
. ok
Comment 1 William A. Rowe Jr. 2018-11-07 21:09:19 UTC
Please help us to refine our list of open and current defects; this is a mass update of old and inactive Bugzilla reports which reflect user error, already resolved defects, and still-existing defects in httpd.

As repeatedly announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases. All reports older than 2.4.x have been updated to status RESOLVED/LATER; no further action is expected unless the report still applies to a current version of httpd.

If your report represented a question or confusion about how to use an httpd feature, an unexpected server behavior, problems building or installing httpd, or working with an external component (a third party module, browser etc.) we ask you to start by bringing your question to the User Support and Discussion mailing list, see [https://httpd.apache.org/lists.html#http-users] for details. Include a link to this Bugzilla report for completeness with your question.

If your report was clearly a defect in httpd or a feature request, we ask that you retest using a modern httpd release (2.4.33 or later) released in the past year. If it can be reproduced, please reopen this bug and change the Version field above to the httpd version you have reconfirmed with.

Your help in identifying defects or enhancements still applicable to the current httpd server software release is greatly appreciated.