Route traffic to node with lowest latency in HAproxy

haproxylatencyload balancing

Is it possible to route requests via HAproxy to a server that has the lowest latency from the source IP? This seems like a much needed requirement but I can't seem to find anything.

My problem is that our data center is on the West Coast of the United States and we are getting more and more demand from Europe, Asia, and South America, while the latency from these locations is making the application unusable.

Best Answer

Given that haproxy proxies requests, all traffic's going to go through haproxy anyway, so sending them to different places isn't going to help you any because all you'll be doing is adding more latency by running the traffic around more than it needs to be. You need to send the user directly to the closest available server, using a geographic or topological DNS engine.