Forum

Suggestion(Idea) - Reverse Proxy Load Balancing / Failover

Ondrej
4 September 2016, 07:51
Hi guys, I was lately working on my new infrastructure solution. As Hiawatha doesn't offer load balancing natively, simple solution came to my mind for load balancing back-end servers on private networks (eg. Reverse Proxy exposed to public, reversing to hosts on private network):

1) in hiawatha.conf specifying : VirtualHost {
Hostname = www.mydomain.com
....
ReverseProxy .* http://webserver.local/
}
2) set up simple dns nameserver (djbdns/tinydns) with round-robin A records:
webserver.local A 10.0.0.1
webserver.local A 10.0.0.2
...
webserver.local A 10.0.0.10

As for failover, normally if web browser receives multiple A records, it tries them until first server replies, efficient enough for simple failover. I am not sure if Hiawatha reverse proxy works with multiple A records. In case if not, there is possibility to set up keepalived/vrrpd. However, the two solutions (DNS Round-Robin and keepalived/vrrpd) can not be simply combined.

Let me know your thoughts..
Hugo Leisink
7 September 2016, 10:32
Hiawatha does not actively support multiple A records. If the OS does some round robin in the lookup system API, it might work. However, this kind of load balancing does not take sessions into account. So, when a user logs in at backend webserver A and the next request is send to backend webserver B, the session is lost.
This topic has been closed.