Discussion:
[Dnsmasq-discuss] load balancing using round robin dns
Melissa Lim
2009-09-29 20:09:42 UTC
Permalink
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000066">
<font size="-1"><font face="Helvetica, Arial, sans-serif">Hello:<br>
<br>
I'm trying to get Round Robin DNS with dnsmasq working on my embedded
system.&nbsp; But it's not quite working.&nbsp; I have 4 boards (1 controller and
3 web servers) in my system each with a static IP address.&nbsp; I have
dnsmasq running on the controller board and lighttpd (web server)
running on the 3 web server boards. &nbsp;<br>
<br>
In my /etc/hosts file I have:<br>
<br>
192.1.253.162&nbsp;&nbsp; &nbsp;controller.test.local<br>
192.1.253.163&nbsp;&nbsp; &nbsp;server.test.local<br>
192.1.253.164&nbsp;&nbsp; &nbsp;server.test.local<br>
192.1.253.165&nbsp;&nbsp; &nbsp;server.test.local<br>
<br>
I've added the controller board's IP address to my laptop's DNS
adresses, so when I access server.test.local from my web browser on my
laptop, I see my test web page. &nbsp;<br>
<br>
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.&nbsp; Is this
supported?&nbsp; How do I know which web server is actually being used?&nbsp; Is
this information provided in a certain mode?&nbsp; I'm running in daemon
mode and I see the following:<br>
<br>
dnsmasq: query[A] server.test.local from 192.1.255.186<br>
dnsmasq: /etc/hosts server.test.local is 192.1.253.165<br>
dnsmasq: /etc/hosts server.test.local is 192.1.253.163<br>
dnsmasq: /etc/hosts server.test.local is 192.1.253.164<br>
<br>
This infomation is NOT provided everytime the web page is accessed -
only when it switches web server.&nbsp; Round robin does appear to be
working, but not for every access.&nbsp; How do I set it up so that it
occurs for every access?&nbsp; Is the load balancing feature doing a
redirect or is the data always going through the controller board? &nbsp;<br>
<br>
Also, is there a way to have load balancing occur when I access the IP
address of the controller?&nbsp; (i.e. have <a moz-do-not-send="true"
class="moz-txt-link-freetext" href="http://192.1.253.162">http://192.1.253.162</a>
look like
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://server.test.local">http://server.test.local</a> and
access the web server boards).&nbsp; Maybe via
the dnsmasq config file???<br>
<br>
Any help would be much appreciated.<br>
<br>
Thanks,<br>
Melissa &nbsp;</font></font>
</body>
</html>
Simon Kelley
2009-09-29 20:17:35 UTC
Permalink
I'm trying to get Round Robin DNS with dnsmasq working on my embedded system.
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 boards.
192.1.253.162 controller.test.local
192.1.253.163 server.test.local
192.1.253.164 server.test.local
192.1.253.165 server.test.local
I've added the controller board's IP address to my laptop's DNS adresses, so
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 provided
dnsmasq: query[A] server.test.local from 192.1.255.186
dnsmasq: /etc/hosts server.test.local is 192.1.253.165
dnsmasq: /etc/hosts server.test.local is 192.1.253.163
dnsmasq: /etc/hosts server.test.local is 192.1.253.164
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 when
it switches web server. Round robin does appear to be working, but not for
every access. How do I set it up so that it occurs for every access? Is the
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 address
of the controller? (i.e. have http://192.1.253.162 look like
http://server.test.local and access the web server boards). Maybe via the
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......

Cheers,

Simon.
AJ Weber
2009-09-29 21:46:07 UTC
Permalink
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.

-AJ


----- Original Message -----
From: "Simon Kelley" <***@thekelleys.org.uk>
To: "Melissa Lim" <***@bbn.com>
Cc: <dnsmasq-***@lists.thekelleys.org.uk>
Sent: Tuesday, September 29, 2009 4:17 PM
Subject: Re: [Dnsmasq-discuss] load balancing using round robin dns
Post by Simon Kelley
I'm trying to get Round Robin DNS with dnsmasq working on my embedded system.
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 boards.
192.1.253.162 controller.test.local
192.1.253.163 server.test.local
192.1.253.164 server.test.local
192.1.253.165 server.test.local
I've added the controller board's IP address to my laptop's DNS adresses, so
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 provided
dnsmasq: query[A] server.test.local from 192.1.255.186
dnsmasq: /etc/hosts server.test.local is 192.1.253.165
dnsmasq: /etc/hosts server.test.local is 192.1.253.163
dnsmasq: /etc/hosts server.test.local is 192.1.253.164
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 when
it switches web server. Round robin does appear to be working, but not for
every access. How do I set it up so that it occurs for every access? Is the
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 address
of the controller? (i.e. have http://192.1.253.162 look like
http://server.test.local and access the web server boards). Maybe via the
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......
Cheers,
Simon.
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Melissa Lim
2009-09-30 13:25:14 UTC
Permalink
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000066">
<font size="-1"><font face="Helvetica, Arial, sans-serif">Thanks for
all the information.&nbsp; I'll try looking into pen.&nbsp; I'm looking for a
redirection solution since I already have a solution that pushes
everything through the controller and we've run into bandwidth issues
for larger web pages.&nbsp; <br>
<br>
Thanks again,<br>
Melissa<br>
</font></font><br>
AJ Weber wrote:
<blockquote cite="mid:000301ca414e$41bd9b00$***@webtekllc.com"
type="cite">Yeah, you're probably better installing something like pen
or another readily-available load-balancer.&nbsp; 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.
<br>
<br>
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.
<br>
<br>
Not a lot of work to change-around and should be much more robust.
<br>
<br>
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.
<br>
<br>
-AJ
<br>
<br>
<br>
----- Original Message ----- From: "Simon Kelley" <a class="moz-txt-link-rfc2396E" href="mailto:***@thekelleys.org.uk">&lt;***@thekelleys.org.uk&gt;</a>
<br>
To: "Melissa Lim" <a class="moz-txt-link-rfc2396E" href="mailto:***@bbn.com">&lt;***@bbn.com&gt;</a>
<br>
Cc: <a class="moz-txt-link-rfc2396E" href="mailto:dnsmasq-***@lists.thekelleys.org.uk">&lt;dnsmasq-***@lists.thekelleys.org.uk&gt;</a>
<br>
Sent: Tuesday, September 29, 2009 4:17 PM
<br>
Subject: Re: [Dnsmasq-discuss] load balancing using round robin dns
<br>
<br>
<br>
<blockquote type="cite">Melissa Lim wrote:
<br>
<blockquote type="cite">Hello:
<br>
<br>
I'm trying to get Round Robin DNS with dnsmasq working on my embedded
system.
<br>
But it's not quite working.&nbsp; I have 4 boards (1 controller and 3 web
servers) in
<br>
my system each with a static IP address.&nbsp; I have dnsmasq running on the
<br>
controller board and lighttpd (web server) running on the 3 web server
boards.
<br>
<br>
In my /etc/hosts file I have:
<br>
<br>
192.1.253.162&nbsp;&nbsp;&nbsp; controller.test.local
<br>
192.1.253.163&nbsp;&nbsp;&nbsp; server.test.local
<br>
192.1.253.164&nbsp;&nbsp;&nbsp; server.test.local
<br>
192.1.253.165&nbsp;&nbsp;&nbsp; server.test.local
<br>
<br>
I've added the controller board's IP address to my laptop's DNS
adresses, so
<br>
when I access server.test.local from my web browser on my laptop, I see
my test
<br>
web page.
<br>
<br>
Each time I access the web page, I'd like for dnsmasq to load balance
the
<br>
request to the 3 web servers in a round robin fashion.&nbsp; Is this
supported?&nbsp; How
<br>
do I know which web server is actually being used?&nbsp; Is this information
provided
<br>
in a certain mode?&nbsp; I'm running in daemon mode and I see the following:
<br>
<br>
dnsmasq: query[A] server.test.local from 192.1.255.186
<br>
dnsmasq: /etc/hosts server.test.local is 192.1.253.165
<br>
dnsmasq: /etc/hosts server.test.local is 192.1.253.163
<br>
dnsmasq: /etc/hosts server.test.local is 192.1.253.164
<br>
</blockquote>
<br>
<br>
That's expected: dnsmasq will supply all three addresses for
<br>
server.test.local each time it's queried. It implements round-robin by
<br>
shuffling the order in which the addresses appear in the reply - the
<br>
resolver library used by the web browser will always take the first
one.
<br>
<blockquote type="cite"><br>
This infomation is NOT provided everytime the web page is accessed -
only when
<br>
it switches web server.&nbsp; Round robin does appear to be working, but not
for
<br>
every access.&nbsp; How do I set it up so that it occurs for every access?&nbsp;
Is the
<br>
load balancing feature doing a redirect or is the data always going
through the
<br>
controller board?
<br>
</blockquote>
<br>
Probably the the name-&gt;address mapping is being cached in the
browser,
<br>
this is a limitation of DNS based load-balancing.
<br>
<br>
<blockquote type="cite"><br>
Also, is there a way to have load balancing occur when I access the IP
address
<br>
of the controller?&nbsp; (i.e. have <a class="moz-txt-link-freetext" href="http://192.1.253.162">http://192.1.253.162</a> look like
<br>
<a class="moz-txt-link-freetext" href="http://server.test.local">http://server.test.local</a> and access the web server boards).&nbsp; Maybe via
the
<br>
dnsmasq config file???
<br>
</blockquote>
<br>
Dnsmasq can't help you here: it's only doing DNS, and can't influence
<br>
anything that doesn't do a DNS lookup. There are other ways of doing
<br>
load-balancing, via fancy switches or reverse-proxies, but I know
<br>
nothing about them, other than that they exist. There's probably an
<br>
O'Reilly book that will help......
<br>
<br>
Cheers,
<br>
<br>
Simon.
<br>
<br>
_______________________________________________
<br>
Dnsmasq-discuss mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Dnsmasq-***@lists.thekelleys.org.uk">Dnsmasq-***@lists.thekelleys.org.uk</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</a>
<br>
<br>
</blockquote>
<br>
<br>
<br>
</blockquote>
</body>
</html>

Loading...