Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load balancing based on proximity

I'm working on a project were we have number (5 at the moment) of servers spread across the world. Clients connect to one of those servers through a centralized broker. We know the originating country of the client but nothing else. We have full control of the servers so we can have all the info we need on those. We don't control the clients, they have to connect through this broker as according to standard.

It's important that the broker picks a server that has low latency so with the data we have I think proximity is our only available criteria.

The first idea that came in mind is pinging the client from each server but we don't have an ip, only the country.

Other idea we had is to ping a root node in each country from each server. The problem there is finding a root node in each country.

Do you have any idea how to calculate/lookup proximity between "countries"? Do you have any insights or ideas on how to solve this problem in another way?

like image 273
Gunnar Steinn Avatar asked Nov 28 '08 11:11

Gunnar Steinn


People also ask

What are the two methods of load balancing technique?

Some of the common load balancing methods are as follows: Round robin -- In this method, an incoming request is routed to each available server in a sequential manner. Weighted round robin -- Here, a static weight is preassigned to each server and is used with the round robin method to route an incoming request.

What are the different methods of load balancing?

There are two primary approaches to load balancing. Dynamic load balancing uses algorithms that take into account the current state of each server and distribute traffic accordingly. Static load balancing distributes traffic without making these adjustments.

What are the most common load balancing methods?

Round-robin load balancing is the simplest and most commonly-used load balancing algorithm. Client requests are distributed to application servers in simple rotation.

What are load balancing rules?

Load-balancing rules - A load balancer rule is used to define how incoming traffic is distributed to the all the instances within the backend pool. A load-balancing rule maps a given frontend IP configuration and port to multiple backend IP addresses and ports.


2 Answers

This is tricky, more so than many imagine, but I feel there is a CORRECT answer.

Of course the naive (but cool) solution is checking the client's IP, this is a good start, but in "the real world" Geolocation isn't everything...

You just asked for "low latency", which means you should do ping between servers and clients and assign accordingly. A very good example of this problem that has affects me personally many times over is that I work in Japan, and a server say in Taiwan is many fold Closer to a Server in the USA for me. BUT, the latency between Japan and the USA is many fold less (better response) than with Taiwan, because the cables and routers and what-have-you that connect Japan-Taiwan are not as good as those between Japan-USA. So if you connected me to Taiwan because you figure my IP is closer, you'd be doing me a very big disfavor there. Besides a ping and actual little test at startup is easier to do than keep some constantly updated Geolocation database

like image 89
Robert Gould Avatar answered Nov 16 '22 02:11

Robert Gould


I think the term you need is "geographic load balancing". Most of the major load balancing vendors have a solution here - your broker could use of these.

Googling geographic load balancing gets some useful looking results.

like image 35
The Archetypal Paul Avatar answered Nov 16 '22 03:11

The Archetypal Paul