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

2018-05-11 Thread Simon Kelley
OK, I removed the limit, but added a big logged warning if you exceed it



Cheers,

Simon.


On 09/05/18 13:00, Dominik DL6ER wrote:
> [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 mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


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

2018-05-10 Thread wkitty42

On 05/08/2018 05:16 PM, Dominik wrote:

Hey Simon,

removing the upper limit will not change anything except for the few
users that have set this value manually to a very large number. However,
if they did so they were surely not expecting that dnsmasq could just
ignore their setting.



agreed...

->8 snip /etc/dnsmasq.conf 8<-
# Configuration file for dnsmasq.
#Dnsmasq version 2.59  Copyright (c) 2000-2011 Simon Kelley
#Compile time options no-IPv6 GNU-getopt no-DBus no-i18n DHCP TFTP no-conntrack 
no-IDN

[...]
# Make the cache large enough to be useful
cache-size=5
[...]
->8 snip /etc/dnsmasq.conf 8<-


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list unless*
   *a signed and pre-paid contract is in effect with us.*

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


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


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

2018-05-08 Thread Dominik
Hey Simon,

removing the upper limit will not change anything except for the few
users that have set this value manually to a very large number. However,
if they did so they were surely not expecting that dnsmasq could just
ignore their setting.

Personal experience with dnsmasq as a caching DNS server for a few
hundred fairly active clients shows no notable performance impact even
when allowing the maximum cache size to be > 100,000 (query reply time
from cache is on the order of < 5 msec). It may always be that I miss
something but even when dnsmasq's cache would be 10 (or more) times
slower, it would still be much faster than when we'd periodically ask
upstream servers.

Best,
Dominik


On 08.05.2018 22:17, Simon Kelley wrote:
> The reason for the limit is actually performance: there may be plenty of
> RAM, but the larger the cache is, the slower it is. This is true for
> reverse (PTR) queries, which are less optimised than normal forward queries.
>
> I accept that the limit may now be too small, but it would be worth
> doing some measurements of cache performance before raising or removing it.
>
>
> Cheers,
>
> Simon.
>
>> From: Dominik Derigs 
>> Date: Tue, 8 May 2018 18:44:41 +0200
>> Subject: [PATCH] Remove upper limit of 10,000 for cache size. We should
>> allow
>>  users to set any (maximum) cache size they like to set. Even embedded
>> devices
>>  usually ship with at least 1 GB of RAM nowadays so memory shouldn't be an
>>  issue. Furthermore, this clipping is also not documented in the man page.
>> To: dnsmasq-discuss@lists.thekelleys.org.uk
>>
>> 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;
>>   }
>>
> ___
> 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] [PATCH] Remove upper limit of 10, 000 for cache size

2018-05-08 Thread Simon Kelley
The reason for the limit is actually performance: there may be plenty of
RAM, but the larger the cache is, the slower it is. This is true for
reverse (PTR) queries, which are less optimised than normal forward queries.

I accept that the limit may now be too small, but it would be worth
doing some measurements of cache performance before raising or removing it.


Cheers,

Simon.

> From: Dominik Derigs 
> Date: Tue, 8 May 2018 18:44:41 +0200
> Subject: [PATCH] Remove upper limit of 10,000 for cache size. We should
> allow
>  users to set any (maximum) cache size they like to set. Even embedded
> devices
>  usually ship with at least 1 GB of RAM nowadays so memory shouldn't be an
>  issue. Furthermore, this clipping is also not documented in the man page.
> To: dnsmasq-discuss@lists.thekelleys.org.uk
> 
> 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;
>   }
> 

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


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

2018-05-08 Thread Dominik DL6ER
From c3fdb31d68d80e08679524ebe02113fe1f11b0b2 Mon Sep 17 00:00:00 2001
From: Dominik Derigs 
Date: Tue, 8 May 2018 18:44:41 +0200
Subject: [PATCH] Remove upper limit of 10,000 for cache size. We should
allow
 users to set any (maximum) cache size they like to set. Even embedded
devices
 usually ship with at least 1 GB of RAM nowadays so memory shouldn't be an
 issue. Furthermore, this clipping is also not documented in the man page.
To: dnsmasq-discuss@lists.thekelleys.org.uk

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


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