amuck-landowner

Poor man's load balancing / geo-based forwarding - Need some hints.

Amitz

New Member
Dear all,

I would like to install something that I would call "Poor man's load balancing / geo-based forwarding" and would appreciate your hints.

Here is the idea:

I have a site that has an equal amount of visitors from the EU and America (The continent, not the country). I would like to run 2 VPS with the actual website content. One in the USA (Server A), one in the EU (Server B )

Sync between the two is already up an running, so this is not an issue.

Furthermore, there will be Server C. This server will be a small VPS or cloud instance at Prometeus/iwStack because of the impressive uptime that I have seen with them throughout the last 2 years. Server C will be the A-Entry of the domain in question. In my wildest dreams, Server C will look where the visitor comes from and either forwards him to Server A or Server B, based on the geo-location of the visitor. If Server C cannot geo-locate the visitor, then it will at least try to forward the requests equally to both other servers. All this should happen (if possible) non-transparent to the visitor, meaning that there will be no change in the URL, like us.domain.com or eu.domain.com.

Has anyone of you ever setup something like this and - if yes - would be willing to give me some insight? I am not looking (even though this would surely be nice) for a complete guide. I am willing to read and to learn. So any hint in the right direction is helpful.

Thank you for taking the time & kind regards

Amitz

P.S.: I forgot to mention - I would like to do this without having to pay for out-of-the-box solutions.

Could HAProxy be my solution?

https://www.digitalocean.com/community/articles/how-to-use-haproxy-to-set-up-http-load-balancing-on-an-ubuntu-vps
 
Last edited by a moderator:

drmike

100% Tier-1 Gogent
Well, depending on the number of lookups a month, you can do this with Rage4's geo-location DNS.

If you are an iwStack customer they offer Rage4 as a freebie benefit of being a customer and that has higher limits/none really.

Obviously, you can go the DNS route yourself and figure out how to make everything work + the geographic functionality.
 

ihatetonyy

New Member
I would go the Rage4 route and throw your iwStack server out of the mix (or add it as a third webserver) -- unless I misunderstand what you're trying to go for, wouldn't the benefits of directing American visitors to an American server be negated by sending them all to iwStack in the EU anyway?

If you're worried that visitors could be directed to a downed server, Rage4 has webhooks for UptimeRobot and the like that allow for a server to be automatically taken out of a rotation if it's down.
 
Last edited by a moderator:

scv

Massive Nerd
Verified Provider
Using a proxy server takes away most of the benefit of load balancing and might even cause more issues. You'd be better off with doing GeoDNS yourself - only hard part there is finding (or maintaining) an accurate geolocation DB. This way the visitor's traffic goes directly to the server closest to them without having to take an extra routing step.

The ideal solution is to find a provider that can give you anycast addressing.
 
Last edited by a moderator:

splitice

Just a little bit crazy...
Verified Provider
A reverse proxy will most likely give little to no overhead actually, it may even give you better routes if they are optimized (depending on your providers flexibility). There are exceptions where performance would be much greater of course (e.g LEB resources saved by pooling backend connections) but most of them are micro optimizations (shave a few ms).

The main reason to do a GeoDNS'ed proxy performance wise would be for Edge Caching or Edge SSL both of which would give very decent speed improvements.
 
Last edited by a moderator:

TheLinuxBug

New Member
Hello Amitz,

As stated before using Rage4 for geo-dns is a good solution to this if you wish to use multiple servers.  You really shouldn't need a 3rd server as a proxy as Rage4 DNS will handle the load balancing  based on geo-location. 

Another option may be using a proxy like Varnish/Haproxy in front with load balancing to accelerate loads and the ability to offload your client to multiple servers or depending on the size of your site you may consider an Origin Pull CDN.  Using CDN would allow you to use a single server to provide html content and the base content your site needs, while the CDN can provide quick geo-located access to js/css/images near to your end user.  Most sites especially if using WordPress or and popular CMS should provide plugins for easy use with CDN.  My suggestion would be to use InterNap's CDN services which if you purchase through the right re-seller can be $0.10/GB or less.  Now, this may not help as much with sites highly dependent on MySQL where using two different servers would, but it will accelerate the loading times of the site greatly and at usually a more than reasonable price.  If you are interested in a quote on CDN services or have any other questions about them, let me know and I can try to help you out.  

Cheers!
 
Last edited by a moderator:

Amitz

New Member
Thank you, Fellows! :)

I did not think about the possibility to do this on the DNS level because most services offering this cost some money. I was also not aware of Prometeus offering services with Rage4DNS and will definitely check this out! Sounds as if this is the simplest solution for my "problem".

Again, thank you all & kind regards

Amitz
 

drmike

100% Tier-1 Gogent
Thank you, Fellows! :)

I did not think about the possibility to do this on the DNS level because most services offering this cost some money. I was also not aware of Prometeus offering services with Rage4DNS and will definitely check this out! Sounds as if this is the simplest solution for my "problem".

Again, thank you all & kind regards

Amitz
iwStack has free Rage4 as long as you have active account/funds on hand there.   It makes the deposit of funds for iwStack more palatable *if* you use such function and drive traffic via DNS that you are already paying for directly.
 

rupe

New Member
I realize this is an old post, but I was wondering if the Rage4 service was geared mainly towards EU customers or would North American based sites benefit just as much. If it is more EU, then are there any NA equivalents?
 

wlanboy

Content Contributer
Look at their POP list, they are all around the world.

So everyone would benefit from it - as long as you have a vps in each area too.
 

rupe

New Member
Look at their POP list, they are all around the world.

So everyone would benefit from it - as long as you have a vps in each area too.
Signed up, and will test out a couple of 'throwaway' domains I have. Nice that they have a free tier with 250k hits per domain allowed.

They sure do have a lot of configuration options available. Anyone know of a good site/guide explaining some of the options - like DNSSEC, benefits and drawbacks of vanity NS, setting proper SOA records?

Thanks
 
Top
amuck-landowner