httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Evans <>
Subject [users@httpd] mod_proxy_balancer re-orders my backend servers
Date Thu, 02 Apr 2009 16:45:28 GMT
Hi all

[ Apache 2.2, event MPM, FreeBSD 6.2 ]

I have two vhosts using mod_proxy_balancer to provide hot standby
replicas for our service, each in a different data centre, allowing us
to completely lose one data centre and still provide a service to our
Each balancer cluster is configured with one main server and one hot
standby. Anonymized configuration at the end.

The problem is that every now and again, it is reversing which server is
the hot backup and which is the current live. As you can see quite
clearly from the conf file, the hot standby is, and all
requests should be going to
Indeed, this is exactly how it behaves after a hard stop-start cycle,
and will continue like that for a while, until, mythically, magically,
it switches which host is the hot standby. 
The balancer admin interface gives no capability to change the hot
standby status of a balancer member, and does not revert to the config
as specified in the conf file without a full restart (graceful does not
fix it), so the only way to resolve this after it has happened is to
disable app04 (the server which should be the hot standby, but has been
promoted to live). 
It is a bit worse than I've indicated here, as there are actually two
front end proxies round-robinning requests, and each one will exhibit
the problem at different times, so one server may be proxying to one
place, and one server to another. There are also two vhosts with similar
clusters, which should be in sync with each other, and obviously in this
case, very quickly they are not!

Any ideas? I'm considering dropping all automatic failover, and make it
necessary to edit the conf file and restart the server to make this
reliable and predictable, which is clearly suboptimal!



Config file:

<VirtualHost *>
  DocumentRoot "/var/empty"

  <Directory "/var/empty">
    AllowOverride none
    Order allow,deny
    Allow from all

  <IfModule proxy_module>
    ProxyRequests Off
    ProxyPreserveHost on
    SetEnv proxy-nokeepalive 1

    <Proxy balancer://cluster>
      BalancerMember status=+H 

    ProxyPass /balancer !
    ProxyPass /internal/ balancer://cluster/internal/
    ProxyPassReverse /internal/
    ProxyPassReverse /internal/

    <Location /balancer>
      SetHandler balancer-manager

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message