djsoltan
asked on
load balancing
hi guys,
i have two linux boxes in differnet locations, and i wanted to know if i can somehow do load balacing on the two so that people would hit a different box at a time,, like lets say if one box is in california and one in florida, if someone in california wants to get a file, it would hit the box in california and if someone in florida wants a file, it would hit the box in florida, is this possible?
thanks
i have two linux boxes in differnet locations, and i wanted to know if i can somehow do load balacing on the two so that people would hit a different box at a time,, like lets say if one box is in california and one in florida, if someone in california wants to get a file, it would hit the box in california and if someone in florida wants a file, it would hit the box in florida, is this possible?
thanks
DNS Round-Robin
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.
DNS Load-Balancing
A sophisticated DNS-based method for load-balancing is to use the program lbnamed which is a Perl 5 program in conjunction with auxilliary tools which provides a real load-balancing for DNS. http://www.stanford.edu/~riepel/lbnamed/
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.
DNS Load-Balancing
A sophisticated DNS-based method for load-balancing is to use the program lbnamed which is a Perl 5 program in conjunction with auxilliary tools which provides a real load-balancing for DNS. http://www.stanford.edu/~riepel/lbnamed/
ASKER
thanks for the help,
is there an easier way to do this? i remember theplanet used to offer a software that would do load balancing for you if u had two of their servers, is there a software i can get to do this other than the ilbnamed u mentioned?
is there an easier way to do this? i remember theplanet used to offer a software that would do load balancing for you if u had two of their servers, is there a software i can get to do this other than the ilbnamed u mentioned?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
and my answer is not valid? you read-it cyclops?
I didn't believe it was. pablouruguay, yours seemed to be instructions to get two internet linked mux'ed into one box, whereas that is not what the asker seemed to be going after since they stated in the original question:
"like lets say if one box is in california and one in florida,"
If I am wrong, please clarify why your suggestion was indeed valid.
"like lets say if one box is in california and one in florida,"
If I am wrong, please clarify why your suggestion was indeed valid.
no its ok. dont worry
http://tetro.net/misc/multilink.html