[Dnsmasq-discuss] load balancing using round robin dns
aweber at comcast.net
Tue Sep 29 22:46:07 BST 2009
Yeah, you're probably better installing something like pen or another
readily-available load-balancer. Some of them are very lightweight, but
would require you to send all traffic back to your controller (set
server.test.local as an alias of controller.test.local), and then the
load-balancer would redirect to the individual servers that are available.
It would also solve the problem you might run into if one of the embedded
servers is down, dnsmasq (or any pure DNS round-robin implementation) will
still reply to every 3rd client's request with the down server's address.
And as Simon says (no pun intended), that client's browser or OS may cache
the resolution and not try any of the other servers...they'll just think the
website is completely down.
Not a lot of work to change-around and should be much more robust.
I love dnsmasq, and have used it on various platforms for a long time, but
you should look to a different solution for this kind of load-balancing.
----- Original Message -----
From: "Simon Kelley" <simon at thekelleys.org.uk>
To: "Melissa Lim" <mlim at bbn.com>
Cc: <dnsmasq-discuss at lists.thekelleys.org.uk>
Sent: Tuesday, September 29, 2009 4:17 PM
Subject: Re: [Dnsmasq-discuss] load balancing using round robin dns
> Melissa Lim wrote:
>> I'm trying to get Round Robin DNS with dnsmasq working on my embedded
>> But it's not quite working. I have 4 boards (1 controller and 3 web
>> servers) in
>> my system each with a static IP address. I have dnsmasq running on the
>> controller board and lighttpd (web server) running on the 3 web server
>> In my /etc/hosts file I have:
>> 188.8.131.52 controller.test.local
>> 184.108.40.206 server.test.local
>> 220.127.116.11 server.test.local
>> 18.104.22.168 server.test.local
>> I've added the controller board's IP address to my laptop's DNS adresses,
>> when I access server.test.local from my web browser on my laptop, I see
>> my test
>> web page.
>> Each time I access the web page, I'd like for dnsmasq to load balance the
>> request to the 3 web servers in a round robin fashion. Is this
>> supported? How
>> do I know which web server is actually being used? Is this information
>> in a certain mode? I'm running in daemon mode and I see the following:
>> dnsmasq: query[A] server.test.local from 22.214.171.124
>> dnsmasq: /etc/hosts server.test.local is 126.96.36.199
>> dnsmasq: /etc/hosts server.test.local is 188.8.131.52
>> dnsmasq: /etc/hosts server.test.local is 184.108.40.206
> That's expected: dnsmasq will supply all three addresses for
> server.test.local each time it's queried. It implements round-robin by
> shuffling the order in which the addresses appear in the reply - the
> resolver library used by the web browser will always take the first one.
>> This infomation is NOT provided everytime the web page is accessed - only
>> it switches web server. Round robin does appear to be working, but not
>> every access. How do I set it up so that it occurs for every access? Is
>> load balancing feature doing a redirect or is the data always going
>> through the
>> controller board?
> Probably the the name->address mapping is being cached in the browser,
> this is a limitation of DNS based load-balancing.
>> Also, is there a way to have load balancing occur when I access the IP
>> of the controller? (i.e. have http://220.127.116.11 look like
>> http://server.test.local and access the web server boards). Maybe via
>> dnsmasq config file???
> Dnsmasq can't help you here: it's only doing DNS, and can't influence
> anything that doesn't do a DNS lookup. There are other ways of doing
> load-balancing, via fancy switches or reverse-proxies, but I know
> nothing about them, other than that they exist. There's probably an
> O'Reilly book that will help......
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
More information about the Dnsmasq-discuss