Web Hosting Talk







View Full Version : If I want to load balance..


Melee
07-30-2001, 09:40 PM
I will have TWO servers now!!!
Now Im very fuzzy on this, do I need a third to load balance the two? What software is good to help me do this. Nt platform for the two servers.

Thank you.
Melee
:)

allan
07-30-2001, 10:10 PM
Originally posted by Melee
I will have TWO servers now!!!
Now Im very fuzzy on this, do I need a third to load balance the two? What software is good to help me do this. Nt platform for the two servers.


Depends on what you are trying to do and how much traffic you have? You can do everything at the server level by using the clustering technology that Microsoft has built into Windows 2000 Advanced server, or in NT Enterprise Server:

http://www.microsoft.com/ntserver/ntserverenterprise/exec/overview/clustering/default.asp

Otherwise you probably want to use a load balancing type solution, generally something like a Cisco Content Switch, or an Alteon, if your IPS offers the service. You can even use a Phobos box, depending on how much bandwidth you intend to use.

The Prohacker
07-30-2001, 10:23 PM
<snip>
The simplest method for load-balancing is to use the DNS round-robin feature of BIND. Here you just configure www[0-9].foo.com as usual in your DNS with A(address) records, e.g.


www0 IN A 1.2.3.1
www1 IN A 1.2.3.2
www2 IN A 1.2.3.3
www3 IN A 1.2.3.4
www4 IN A 1.2.3.5
www5 IN A 1.2.3.6




Then you additionally add the following entry:

www IN CNAME www0.foo.com.
IN CNAME www1.foo.com.
IN CNAME www2.foo.com.
IN CNAME www3.foo.com.
IN CNAME www4.foo.com.
IN CNAME www5.foo.com.
IN CNAME www6.foo.com.



Notice that this seems wrong, but is actually an intended feature of BIND and can be used in this way. However, now when www.foo.com gets resolved, BIND gives out www0-www6 - but in a slightly permutated/rotated order every time. This way the clients are spread over the various servers. But notice that this not a perfect load balancing scheme, because DNS resolve information gets cached by the other nameservers on the net, so once a client has resolved www.foo.com to a particular wwwN.foo.com, all subsequent requests also go to this particular name wwwN.foo.com. But the final result is ok, because the total sum of the requests are really spread over the various webservers.

</snip>

Taken from the mod_rewrite guide at: http://httpd.apache.org/docs/misc/rewriteguide.html


This was put togather for apache, but will work with any server, mod_rewrite not needed..

allan
07-30-2001, 11:41 PM
what the prohacker suggested is a quick and easy solution, but keep in mind that unlike clustering or a load balancing solution, DNS round robin does not take into account whether or not a server is alive.

If one of your servers go down then about half of your potential visitors are still going to be trying to get to the downed server.

(SH)Saeed
07-30-2001, 11:50 PM
I wrote a loadbalancig script in Perl a long time ago. It tried to connect to the different servers in the list and then downloads the main page. It would put all that info in a database where the user could view them later to see uptime, speed etc. It also used that info to send the user to a server that was working. It had a few options, you could set it to round-robin, random or to send the user to the fastest server.

Ahh, well...
:eek2:

allan
07-31-2001, 06:14 AM
Originally posted by Mr. Amazon
I wrote a loadbalancig script in Perl a long time ago. It tried to connect to the different servers in the list and then downloads the main page.


That's cool -- you may be interested in the Linux Virtual Server project, which is building the same thing:

http://www.linuxvirtualserver.org