Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirect users to the nearest server based on their location without changing url

Tags:

This is my case:

I have 6 servers across US and Europe. All servers are on a load balancer. When you visit the website (www.example.com) its pointing on the load balancer IP address and from their you are redirect to one of the servers. Currently, if you visit the website from Germany for example, you are transfered randomly in one of the server. You could transfer to the Germany server or the server in San Fransisco.

I am looking for a way to redirect users to the nearest server based on their location but without changing url. So I am NOT looking of having many url's such as www.example.com, www.example.co.uk, www.example.dk etc

I am looking for something like a CDN where you retrieve your files from the nearest server (?) so I can get rid of the load balancer because if it crashes, the website does not respond (?)

For example:

If you are from uk, redirect to IP 53.235.xx.xxx If you are from west us, redirect to IP .... if you are from south europe, redirect to IP ... etc

DNSMadeeasy offers a feature similar to this but they are charging a 600 dollars upfront price and for a startup that doesnt know if that feature will work as expected or there is no trial version we cannot afford: http://www.dnsmadeeasy.com/enterprise-dns/global-traffic-director/

What is another way of doing this?

Also another question on the current setup. Even with 6 servers all connected to the load balancer, if the load balancer has lag issues, it takes everything with it, right? or if by any change it goes down, the website does not respond. So what is the best way to eliminate that downtime so that if one server IP address does not respond, move to the next (as a load balancer would do but load balancers can have issues themselves)

like image 923
jQuerybeast Avatar asked Feb 04 '12 05:02

jQuerybeast


People also ask

Which load balancing feature redirects clients request to the nearest location server?

Global server load balancing (GSLB) is the act of load balancing across globally distributed servers. This allows distribution of traffic to be performed efficiently across application servers that are dispersed geographically.

What is geo IP Redirect?

Geo IP based redirection is the process of automatically redirecting a website visitor by their geolocation (country, state or city). It works by detecting the visitor's location from their IP address by matching it against a database of IPs and locations.


1 Answers

Would help to know what type of application servers you're talking about; i.e. J2EE (like JBoss/Tomcat), IIS, etc?

You can use a hardware or software load balancer with Sticky IP and define ranges of IPs to stick to different application servers. Each country's ISPs should have it's own block of IPs.

There's a list at the website below.

http://www.nirsoft.net/countryip/

Here's also a really, really good article on load balancing in general, with many high availability / persistence issues addressed. That should answer your second question on the single point of failure at your load balancer; there's many different techniques to provide both high availability and load distribution. Alot depends on what kind of application your run and whether you require persistent sessions or not. Load balancing by sticky IP, if persistence isn't required and you're LB does health checks properly, can provide high availability with easy failover. The downside is that load isn't evenly distributed, but it seems you're looking for distribution based on proximity, not on load.

http://1wt.eu/articles/2006_lb/index.html

like image 144
Jim Avatar answered Oct 12 '22 22:10

Jim