It sounds like your primary criteria are simplicity and cost. If
that's the case, it doesn't get much easier or cheaper than these two
solutions.
The easiest is something called "round robin DNS". You probably know
that your server currently has an IP address, say "1.2.3.4", and a
hostname, say "www.site.com". When a user types "www.site.com" into a
browser, their computer asks the DNS system for the IP associated with
that address, and in this case gets "1.2.3.4". Then the user's
computer connects directly to that IP address to get the web site.
In a round robin DNS scheme, there is more than one IP address
associated with a single hostname. Say you associate both "1.2.3.4"
and "1.2.3.5" with "www.site.com". Now, the first user to enter
"www.site.com" into their browser will see the associated IP address
as "1.2.3.4", the second user will get "1.2.3.5", the third user will
get "1.2.3.4" again, and so on.
Assuming your DNS is managed by Rackspace, they should be able to help
you set this up. All you need to do is let them know that you want to
associate two IP addresses (one for each of your servers) with a
single hostname, to do round robin DNS.
Now, just make sure you have the exact same content on both servers at
all times, and you're all set.
There's some more information about this, including a discussion of
the advantages and disadvantages, at:
http://www.onjava.com/pub/a/onjava/2001/09/26/load.html
A second method for distributing load is setting up each server
individually, and then simply splitting the content between them. Many
popular sites, for example, put images on a separate server than HTML
files, and then simply reference the images by their full urls, e.g.
"http://images.site.com/foo.jpg"
You can, of course, split the content by whatever makes the most sense
for your site. You could put a certain set of pages on one server, for
example, and other pages on the second server. Again, all you need to
to is reference pages or images by their full URLs, including
hostname, whenever you refer to content that is on the other server.
This method will require a little more hand-tweaking in order to even
out the load between servers, as well as the effort required to
rearrange the files that make up your site and adjust references.
Other methods of load-balancing are available, of course, including
hardware solutions, dedicated load balancing servers, etc., which may
perform better under certain circumstances, but they are generally
much more complex and/or expensive. For sites just starting out with
load balancing, one of the two simple techniques above should be more
than enough.
If you need more information, or have any specific questions, please
request a clarification before submitting a rating. If you do, it
would also be helpful to know what OS and HTTP server software you're
using. |
Clarification of Answer by
alexander-ga
on
20 Apr 2003 11:08 PDT
Sorry, typo -- I meant Rackshack.
You should have access to the configuration for your domain. When you
do a whois on your domain, there's a section at the bottom called
"Domain servers in listed order:". The first machine on that list is
usually the one you need to change. IF the IP address shown is your
machine, then the DNS is running primarily off of your machine, and
you can update its configuration. You didn't say what OS you're using,
but if you're using BIND on a UNIX architecture, see this example for
what the configuration files should look like:
http://www.rim.edu.bt/manual/linux/config/bind-8.2.html
You would need to add another A record in the zone file. In the
example, it's "/var/named/rim.zone" (your filename will be different).
There will be one entry for your current machine, e.g.:
www IN A 1.2.3.4
You would just need to add another for the second machine:
www IN A 1.2.3.5
But I must say that having to enter this information by hand in a
managed hosting environment is quite unusual. The host will usually do
this for you, or provide a custom management interface for your
domain. You can also have your DNS hosted elsewhere for a trivial fee
(e.g. http://www.123cheapdomains.com , $14/year including registration
), and then just use their managed DNS services to point back to your
Rackshack servers.
If Rackshack will normally update your DNS configuration, but they're
a bit confused by the round robin thing, the procedure is exactly the
same as if they were adding another host to your domain, e.g.
"www2.yoursite.com", except that one hostname happens to have two
entries with different IPs.
|