3 ms·
Related question -- does anyone run a site which is hosted in multiple locations? Say you have a read-only site, and you have one copy in the Fremont CA data c
by chubot 11y ago
Related question -- does anyone run a site which is hosted in multiple locations?
Say you have a read-only site, and you have one copy in the Fremont CA data center, one in Frankfurt, and one in Asia. How do you direct users to the closest one network-wise?
(For static content, you can offload this problem to a CDN, but I'm wondering if you can do it just on Linode)
An old way to do it would be to have the users choose and set a cookie that redirects. But I wonder if you can do it transparently, like Google or Yahoo. Is there a DNS trick which implements this, or something else?
- samtho 11y agoRound Robbin DNS[0] is a simple method for balancing HTTP requests, done entirely at the nameserver. Let's say you have 3 servers, located at 3 separate IP addresses. You create multiple A-Records, each pointing to a different IP address, and (in theory) the client will choose the fastest connection. [0] https://en.wikipedia.org/wiki/Round-robin_DNS https://en.wikipedia.org/wiki/Round-robin_DNS
- chubot 11y agoWould clients actually choose the fastest connection? That page says that the client will typically choose the first address, so you can use this for load distribution among servers, but it doesn't say anything about client latency. If I have 5K users in US, 2K in Europe, and 1K in Asia, I wouldn't want the traffic to evenly distributed. I would want users to go to the closest/fastest server. The StackOverflow post above looks like a good start.
- Spittie 11y agoThe easiest way would be to use GeoDNS. You just have your DNS server send out a different IP according to the IP of the request. See http://www.caraytech.com/geodns/ http://www.caraytech.com/geodns/ and https://en.wikipedia.org/wiki/Geodns https://en.wikipedia.org/wiki/Geodns I've found this nice answer on StackOverlow that show the differences between Anycast, GeoDNS and using an http redirect: http://stackoverflow.com/a/25678199 http://stackoverflow.com/a/25678199
- chubot 11y agoGreat thanks! It looks like the questioner ended up using AWS Route 53, which supports this kind of thing. I'm not using AWS, and there are other options, but that is the kind of thing I am happy to offload to AWS.