10

I am using mod_proxy_balancer to manage failover of backend servers. Backend servers may return an error code instead of timing out when some other backend service fails such as NFS and we want such servers also to be marked as failed nodes. Hence we are using failonstatus directive.

<Proxy balancer://avatar>
    ProxySet failonstatus=503 
    BalancerMember http://active/ retry=30
    # the hot standby
    BalancerMember http://standby/ status=+H retry=0
</Proxy>

Currently the failover works perfectly with one glitch. When active node fails the user gets a 503 error and from the next request the Standby server takes over.

I dont want even a single request to fail though. Cant mod_proxy failover with out ever returning an error to the client? If active node fails I want mod_proxy to try the Standby for the same request and not just from the subsequent request!

broc.seib
  • 21,643
  • 8
  • 63
  • 62
Praveen
  • 375
  • 1
  • 5
  • 18

2 Answers2

3

I think you asked this on the Apache HTTPd mailing list but sadly didn't get a satisfactory answer. I've asked almost the same question in ServerFault so I'm joining them together.

https://serverfault.com/questions/414024/apache-httpd-workers-retry

Community
  • 1
  • 1
David Newcomb
  • 10,639
  • 3
  • 49
  • 62
  • 2
    I have spoken to a Dev on httpd mailing list and he confirmed that this feature has not been implemented in the current code base. The state machine inside mod_proxy_balancer cannot retry on HTTP error but can only do so in case of connection error. I tried to implement it myself but its too complicated and I can easily make the code base unstable. So I gave up... – Praveen Aug 06 '12 at 19:03
2

There is a new module that accomplishes what you are asking https://httpd.apache.org/docs/2.4/mod/mod_proxy_hcheck.html

Eric Cox
  • 31
  • 3