Re: [Dnsmasq-discuss] [PATCH] Remove upper limit of 10, 000 for cache size

2018-05-09 Thread Dominik DL6ER
[PATCH] Remove upper limit of 10,000 for cache size

Signed-off-by: Dominik Derigs 
---
 src/option.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/option.c b/src/option.c
index 65df93a..180517a 100644
--- a/src/option.c
+++ b/src/option.c
@@ -2589,8 +2589,6 @@ static int one_opt(int option, char *arg, char
*errstr, char *gen_err, int comma
   
    if (size < 0)
  size = 0;
-   else if (size > 1)
- size = 1;
   
    daemon->cachesize = size;
  }
-- 2.7.4


On 09.05.2018 13:13, Geert Stappers wrote:
> ---
>  man/dnsmasq.8| 2 +-
>  man/es/dnsmasq.8 | 3 ++-
>  man/fr/dnsmasq.8 | 3 ++-
>  3 files changed, 5 insertions(+), 3 deletions(-)
>
> Note that this patch contains non-ASCII characters,
> those might be mangled during transport ...
>
>
> diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
> index 21069de..7664e06 100644
> --- a/man/dnsmasq.8
> +++ b/man/dnsmasq.8
> @@ -692,7 +692,7 @@ will add 1.2.3.0/24 for both IPv4 and IPv6 requestors.
>  
>  .TP
>  .B \-c, --cache-size=
> -Set the size of dnsmasq's cache. The default is 150 names. Setting the cache 
> size to zero disables caching.
> +Set the size of dnsmasq's cache. The default is 150 names. Setting the cache 
> size to zero disables caching. Note: huge cache size impacts performance.
>  .TP
>  .B \-N, --no-negcache
>  Disable negative caching. Negative caching allows dnsmasq to remember
> diff --git a/man/es/dnsmasq.8 b/man/es/dnsmasq.8
> index 81c745a..4a70a4f 100644
> --- a/man/es/dnsmasq.8
> +++ b/man/es/dnsmasq.8
> @@ -478,7 +478,8 @@ la traza reversa direcci
>  .TP
>  .B \-c, --cache-size=
>  Fijar el tama�o del cach� de dnsmasq. El predeterminado es 150 nombres.
> -Fijar el tama�o a cero deshabilita el cach�.
> +Fijar el tama�o a cero deshabilita el cach�. Nota: el gran tama�o de
> +cach� afecta el rendimiento.
>  .TP
>  .B \-N, --no-negcache
>  Deshabilitar cach� negativo. El cach� negativo le permite a dnsmasq
> diff --git a/man/fr/dnsmasq.8 b/man/fr/dnsmasq.8
> index 80cef39..d3c05b8 100644
> --- a/man/fr/dnsmasq.8
> +++ b/man/fr/dnsmasq.8
> @@ -666,7 +666,8 @@ différentes pourraient-être rencontrés, alors le cache 
> devrait être désacti
>  .TP
>  .B \-c, --cache-size=
>  Définit la taille du cache de Dnsmasq. La valeur par défaut est de 150 noms.
> -Définir une valeur de zéro désactive le cache.
> +Définir une valeur de zéro désactive le cache. Remarque: la taille importante
> +du cache a un impact sur les performances.
>  .TP
>  .B \-N, --no-negcache
>  Désactive le "cache négatif". Le "cache négatif" permet à Dnsmasq de se 
> souvenir
>
>
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] [PATCH] Warn about the impact of cache-size on performance

2018-05-09 Thread Geert Stappers
---
 man/dnsmasq.8| 2 +-
 man/es/dnsmasq.8 | 3 ++-
 man/fr/dnsmasq.8 | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

Note that this patch contains non-ASCII characters,
those might be mangled during transport ...


diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
index 21069de..7664e06 100644
--- a/man/dnsmasq.8
+++ b/man/dnsmasq.8
@@ -692,7 +692,7 @@ will add 1.2.3.0/24 for both IPv4 and IPv6 requestors.
 
 .TP
 .B \-c, --cache-size=
-Set the size of dnsmasq's cache. The default is 150 names. Setting the cache 
size to zero disables caching.
+Set the size of dnsmasq's cache. The default is 150 names. Setting the cache 
size to zero disables caching. Note: huge cache size impacts performance.
 .TP
 .B \-N, --no-negcache
 Disable negative caching. Negative caching allows dnsmasq to remember
diff --git a/man/es/dnsmasq.8 b/man/es/dnsmasq.8
index 81c745a..4a70a4f 100644
--- a/man/es/dnsmasq.8
+++ b/man/es/dnsmasq.8
@@ -478,7 +478,8 @@ la traza reversa direcci
 .TP
 .B \-c, --cache-size=
 Fijar el tama�o del cach� de dnsmasq. El predeterminado es 150 nombres.
-Fijar el tama�o a cero deshabilita el cach�.
+Fijar el tama�o a cero deshabilita el cach�. Nota: el gran tama�o de
+cach� afecta el rendimiento.
 .TP
 .B \-N, --no-negcache
 Deshabilitar cach� negativo. El cach� negativo le permite a dnsmasq
diff --git a/man/fr/dnsmasq.8 b/man/fr/dnsmasq.8
index 80cef39..d3c05b8 100644
--- a/man/fr/dnsmasq.8
+++ b/man/fr/dnsmasq.8
@@ -666,7 +666,8 @@ différentes pourraient-être rencontrés, alors le cache 
devrait être désacti
 .TP
 .B \-c, --cache-size=
 Définit la taille du cache de Dnsmasq. La valeur par défaut est de 150 noms.
-Définir une valeur de zéro désactive le cache.
+Définir une valeur de zéro désactive le cache. Remarque: la taille importante
+du cache a un impact sur les performances.
 .TP
 .B \-N, --no-negcache
 Désactive le "cache négatif". Le "cache négatif" permet à Dnsmasq de se 
souvenir
-- 
2.15.1


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Remove upper limit of 10,000 for cache size

2018-05-09 Thread Geert Stappers
On Wed, May 09, 2018 at 11:21:31AM +0200, Dominik DL6ER wrote:
> Geert Stappers wrote:
> >  [ ... ] I'm trying to tell that the performance penality that Simon
> >  warns us about, might by canceled by high computing power.
> 
> I agree, but you should probably not be running a caching DNS server
> with hundreds of active clients on a really low-power embedded machine
> like the good old Raspberry Pi in its first version.

:-)


> I'm just trying to make clear that removing this artificial limit may
> improve the situation for those on beefier hardware but not impact the
> others as they are responsible for what they set when they decide to
> manually tweak their settings in this regard. It's a value where I think
> the hand-holding dnsmasq is doing for possibly supporting embedded
> devices better is just too much. In the end, Simon has to say if or not
> this artificial clipping can be removed or not. I think yes, because it
> doesn't affect anyone who has not changed the default value and allows
> the others to use any value for cache size them deem right for their
> hardware and application.

I also think that the clipping should be removed.

Resubmitting the patch with a new commit message would be a good thing.
(The original patch commit message would result in an ugly git log
when `git am`, "git apply-mail" was used.)`

I'll follow up this posting with a patch on the manual page.


Groeten
Geert Stappers
-- 
Leven en laten leven

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Remove upper limit of 10,000 for cache size

2018-05-09 Thread Dominik DL6ER
Dear Geert and mailinglist members,

> Thing I wonder about is how the cache size clipping was discovered.
I recently sent a SIGUSR1 to our dnsmasq because a user said that some
queries have continuously been answered NXDOMAIN although they
shouldn't. As they have been answered within less than a millisecond, I
thought it must be an issue with the cache. Make a long story short it
was their fault (an ordinary typo).

However, by chance, I found

May  4 18:06:13 dnsmasq[22952]: cache size 150, 2191/57999 cache
insertions re-used unexpired cache entries.

which seemed odd to me. I then looked at the man page and increased the
cache size limit to 100,000 in the config but the startup message told
me that the cache size is only 10,000. The way to the location where
this clipping is done wasn't long from here and I figured removing might
just be the best solution.

> I'm trying to tell that the performance penality that Simon warns us about, 
> might by canceled by high computing power.
I agree, but you should probably not be running a caching DNS server
with hundreds of active clients on a really low-power embedded machine
like the good old Raspberry Pi in its first version.
We have a dedicated (small) server for DNS, DHCP and email. dnsmasq is
able to handle DNS blazingly fast - even with a maximum cache size of
100,000 (I may even want to increase this further if it prevents
deletion of unexpired cache entries).

I'm just trying to make clear that removing this artificial limit may
improve the situation for those on beefier hardware but not impact the
others as they are responsible for what they set when they decide to
manually tweak their settings in this regard. It's a value where I think
the hand-holding dnsmasq is doing for possibly supporting embedded
devices better is just too much. In the end, Simon has to say if or not
this artificial clipping can be removed or not. I think yes, because it
doesn't affect anyone who has not changed the default value and allows
the others to use any value for cache size them deem right for their
hardware and application.

Best regards,
Dominik


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Reponse time is huge for big payload SRV record on dnsmasq servers

2018-05-09 Thread Simon Kelley


On 09/05/18 07:48, Harish Shetty wrote:
> HI
> 
> I am upgrading the dnsmasq now,   But I have couple  of more question, I
> read somewhere, dnsmasq can cache only A,  records only.. is that
> true??  

A,  (some) PTR and CNAME


and multiple line caching is not supported.  Is there anyway we

Not sure what you mean by "multiple line"


Simon.

> can cache the TCP query??
> 
> Regards
> Harish Shetty
> 
> On Wed, May 9, 2018 at 1:42 AM, Simon Kelley  > wrote:
> 
> Check all the servers you have configured. If one is not accepting TCP
> connections, that could delay things whilst the connection attempt times
> out.
> 
> If the upstream servers accept TCP connections and reply on them in a
> timely manner, I don't know what else could be causing the problem. It
> would be worth setting --log-queries to try and see where the delays
> are.
> 
> 2.48 is very, very old. Can you upgrade?
> 
> 
> Cheers,
> 
> Simon.
> 
> On 07/05/18 15:30, Harish Shetty wrote:
> > Hi Simon
> >
> > Thanks for the reply,  Yes you are rite, Truncated bit  is set in the
> > message. I am seeing ";; Truncated, retrying in TCP mode."  in the
> > answer. But it is expected and answer is more than 512 bytes (which is
> > size of UDB packet). TCP port 53 is allowed , but DNS respone time
> from
> > dnsmasq service is more than 3 sec sometime 4 or 5 sec.  When we query
> > directly upstream server we are seeing the response  on avg of 100 to
> > 200 ms.
> >
> > Is there anyway we can make DNS query faster in dnsmasq  server,
> because
> > it is making our application timeouts.
> >
> > Regards
> > Harish Shetty
> >
> > On Mon, May 7, 2018 at 7:03 PM, Simon Kelley
> mailto:si...@thekelleys.org.uk>
> > >>
> wrote:
> >
> >     That's large enough to need TCP.
> >
> >     What I'd expect top happen is that the upstream server returns
> an answer
> >     with the truncated bit setin the header. This answer gets
> returned by
> >     dnsmasq to the original requestor. The original requestor
> makes a TCP
> >     connection to dnsmasq and re-sends the query. Dnsmasq makes a TCP
> >     connection upstream and send the query, and gets the result.
> It then
> >     send the result back down the TCP connection to the original
> requestor.
> >
> >     Anything blocking or distrupting TCP connections on port 53 is
> suspect.
> >     An non-responsive upstream server will cause delays whilst the
> >     connection times out.
> >
> >     Try running the query direct to the upstream servers using dig +vc
> >
> >     Cheers,
> >
> >     Simon.
> >
> >
> >     On 07/05/18 13:57, Harish Shetty wrote:
> >     > Hi All
> >     >
> >     > I  am facing some issue with dnsmasq. Currently I am using
> >     dnsmasq-2.48
> >     > ,  I am using this as my forwarder and caching sever. But my
> >     problem is,
> >     > when i query for a high payload SRV record  (answer size is
> about 3500
> >     > bytes) response time some times crosses 4000ms, and
> intermittently
> >     timeout.
> >     >
> >     > I have tried enabling the logquries, but it didnt give much
> >     information
> >     > to me,  Any suggestion on the debugging or more details will be
> >     helpful
> >     >
> >     > Regards
> >     > Harish Shetty
> >     >
> >     >
> >     >
> >     >
> >     > ___
> >     > Dnsmasq-discuss mailing list
> >     > Dnsmasq-discuss@lists.thekelleys.org.uk
> 
> >      >
> >     >
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 
> >   
>   >
> >     >
> >
> >     ___
> >     Dnsmasq-discuss mailing list
> >     Dnsmasq-discuss@lists.thekelleys.org.uk
> 
> >      >
> >   
>  http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 
> >   
>   

Re: [Dnsmasq-discuss] Reponse time is huge for big payload SRV record on dnsmasq servers

2018-05-09 Thread Harish Shetty
HI

I am upgrading the dnsmasq now,   But I have couple  of more question, I
read somewhere, dnsmasq can cache only A,  records only.. is that
true??  and multiple line caching is not supported.  Is there anyway we can
cache the TCP query??

Regards
Harish Shetty

On Wed, May 9, 2018 at 1:42 AM, Simon Kelley 
wrote:

> Check all the servers you have configured. If one is not accepting TCP
> connections, that could delay things whilst the connection attempt times
> out.
>
> If the upstream servers accept TCP connections and reply on them in a
> timely manner, I don't know what else could be causing the problem. It
> would be worth setting --log-queries to try and see where the delays are.
>
> 2.48 is very, very old. Can you upgrade?
>
>
> Cheers,
>
> Simon.
>
> On 07/05/18 15:30, Harish Shetty wrote:
> > Hi Simon
> >
> > Thanks for the reply,  Yes you are rite, Truncated bit  is set in the
> > message. I am seeing ";; Truncated, retrying in TCP mode."  in the
> > answer. But it is expected and answer is more than 512 bytes (which is
> > size of UDB packet). TCP port 53 is allowed , but DNS respone time from
> > dnsmasq service is more than 3 sec sometime 4 or 5 sec.  When we query
> > directly upstream server we are seeing the response  on avg of 100 to
> > 200 ms.
> >
> > Is there anyway we can make DNS query faster in dnsmasq  server, because
> > it is making our application timeouts.
> >
> > Regards
> > Harish Shetty
> >
> > On Mon, May 7, 2018 at 7:03 PM, Simon Kelley  > > wrote:
> >
> > That's large enough to need TCP.
> >
> > What I'd expect top happen is that the upstream server returns an
> answer
> > with the truncated bit setin the header. This answer gets returned by
> > dnsmasq to the original requestor. The original requestor makes a TCP
> > connection to dnsmasq and re-sends the query. Dnsmasq makes a TCP
> > connection upstream and send the query, and gets the result. It then
> > send the result back down the TCP connection to the original
> requestor.
> >
> > Anything blocking or distrupting TCP connections on port 53 is
> suspect.
> > An non-responsive upstream server will cause delays whilst the
> > connection times out.
> >
> > Try running the query direct to the upstream servers using dig +vc
> >
> > Cheers,
> >
> > Simon.
> >
> >
> > On 07/05/18 13:57, Harish Shetty wrote:
> > > Hi All
> > >
> > > I  am facing some issue with dnsmasq. Currently I am using
> > dnsmasq-2.48
> > > ,  I am using this as my forwarder and caching sever. But my
> > problem is,
> > > when i query for a high payload SRV record  (answer size is about
> 3500
> > > bytes) response time some times crosses 4000ms, and intermittently
> > timeout.
> > >
> > > I have tried enabling the logquries, but it didnt give much
> > information
> > > to me,  Any suggestion on the debugging or more details will be
> > helpful
> > >
> > > Regards
> > > Harish Shetty
> > >
> > >
> > >
> > >
> > > ___
> > > Dnsmasq-discuss mailing list
> > > Dnsmasq-discuss@lists.thekelleys.org.uk
> > 
> > > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> > 
> > >
> >
> > ___
> > Dnsmasq-discuss mailing list
> > Dnsmasq-discuss@lists.thekelleys.org.uk
> > 
> > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> > 
> >
> >
>
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss