Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

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?
1 Solution
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
www1   IN  A
www2   IN  A
www3   IN  A
www4   IN  A
www5   IN  A

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/

djsoltanAuthor Commented:
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?
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

If you have a third Apache server, you can configure a round robin behind it with mod_rewrite, and some server side modifications.

Your third box would run a script to round robin hosts behind it. DNS would point only to that server and it would hand off.
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.
no its ok. dont worry

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now