HAProxy configuration to load-balance Monero nodes
To get an understanding of HAProxy’s possibilities, I grabbed a list of nodes from monero.fail and created a configuration that load-balances connections among them.
The configuration would allow you to connect Monero to HAProxy, which in turn takes care of selecting a remote node that responds fairly quickly.
However, using HAProxy makes more sense in a scenario where you want to load balance multiple public nodes that you operate yourself.
Note that there’s also a project named Monerod-Proxy that offers similar functionality.
You may append as many nodes as you want, but be aware that each one implies more health checks and slows down HAProxy-startup.
Once HAProxy is running (haproxy -W -f <path-to-config>) you can test the connection with Monero RPC or CLI (monero-wallet-cli --daemon-host <haproxy-ip> --daemon-port 18081 <further-options>).
The configuration surely has room for improvement. If you know any tweaks, please comment in our thread on Monero Town.