Web Hosting Talk







View Full Version : Setting up a round robin..


jic
05-03-2003, 08:05 AM
Anyone have a good FAQ on setting up a round robin or decently cheap hware for doing it. We just landed a deal with a large NFL football team to do their hosting and we are going to offer them this as a "24 hour setup solution" in case they make the playoffs and the box we setup has to be ready.

dynamicnet
05-03-2003, 09:57 AM
Greetings Jic:

You may want to look at hardware-based load balancing (Ace Director 3 does a wonderful job), as it is far more reliable than round robin DNS.

I found http://www.tek-tips.com/gfaqs.cfm/lev2/4/lev3/31/pid/333/fid/1754 to be of interest specifically at the "Round-robin DNS" section.

It did point out the following:

=== START CLIP ===

"First, load balancing is only performed once for each client at the beginning of a session.

Second, it's possible for the load balancing scheme to get a little skewed.

For instance, all the users that have been sent to MyServer1 may go to lunch while all the users who have been sent to MyServer2 continue to send requests. In this case, one server could become overloaded while another server is sitting by idly.

Third, A more significant problem with session-based load balancing is that it exposes the IP addresses of the servers in the farm to the client-side browser.

What happens when a server crashes or is taken offline? Your balancing algorithm needs to account for this as soon as possible, but doing so can be problematic. If you're passing out bad IP addresses, your users will start to receive "server not available" errors.

In a round-robin DNS system, it still can take as long as 48 hours to fix the problem once you've discovered that one of your servers has crashed.

This is due to the fact that the changes to your IP address mappings need to be propagated to DNS servers throughout the Internet."

=== END CLIP ===

http://www.vergenet.net/linux/has/html/node10.html also does a good job at reporting the problems of DNS-based methods of load balancing:

=== START CLIP ===

1. The time to live (TTL) on the zone files needs to be turned down severely to to reduce the time for which results are cached.

The longer the TTL, the less control there is over which IP addresses that end-users are accessing. The shorter that TTL, the greater the potential for congestion on the DNS server.

2. Users may access servers using an IP address rather than a host name.

3. Users may use non-DNS methods such as an /etc/hosts file to map server host names to IP addresses.

4. An additional problem with round-robin DNS is that the DNS daemon cannot differentiate between a request for a one-off hit, and a request that will result in many hits. That is, it is hard to control the granularity of scheduling.

5. When using round-robin DNS there is no way to assign weights to servers, all servers will theoretically receive the same number of requests, regardless of their resources and current load.

=== END CLIP ===

BTW, http://www.mydomain.com/help/mydomainplus/tut-robin is an ok article on this subject.

Thank you

m-b
05-04-2003, 07:38 AM
I've often read about Round Robin DNS here, but never about managing this issue with your very own Software!

It can be done in any Web based Scripting language (PHP, JSP, Perl, ASP, etc):
In my case I'd prefer loadbalancing with PHP (http://www.google.com/search?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8&as_qdr=all&q=load+balancing+PHP&spell=1), create the main VHost with the managing application that redirects the requests to the "slave"-Hosts (can be a HTTP Redirect or Frame).

The nice side effect also is: You can improve it to your own needs :)
Round Robin DNS in most cases is "dumb", it will also activate Hosts that are actually down, overloaded, etc.
So you could code this little thingie to consider the online status, server load and what ever else of your Hosts.

While there are sure more ways to do this (reverse proxies, "real" load balancing, ...), this one is quite cheap!

So long,
Michael

dynamicnet
05-04-2003, 10:00 AM
Greetings m-b:

Would it be correct that the scripting language method (especially PHP) would be for Apache load balancing only?

Is there a specific link or set of links on the search page you provided that would provide more details?

I couldn't find any links on the 1st page that really delved into the issue.

Thank you.

m-b
05-04-2003, 02:59 PM
My first Contact to this was this article (http://www.php-center.de/artikel/loadbalancing.php3). Since it is written in german language (what you probably don't understand?!) I decided to post this Google Link just as a first impression ;)
(But you may understand the PHP-Code on this german page)

And yes, this is Webserver specific (but not apache-only!).

And for large Websites, there are quite more possibilities to tweak (Pear::Cache could also be interesting for you).

But if you get on to it feel free ask questions :stickout:

Michael