[Dnsmasq-discuss] how can i make cache_size more than 10000

Albert ARIBAUD albert.aribaud at free.fr
Wed Dec 2 07:50:46 GMT 2015


Hi "cochen",

Le Wed, 2 Dec 2015 14:31:13 +0800 (CST)
cochen <workhardcc at 163.com> a écrit:

> Hello everyone,
>     When i use command " kill -s SIGUSR1 `cat /var/run/dnsmasq.pid`",
> the output in log as below: Dec  2 14:23:48 dnsmasq[22548]: cache
> size 10000, 22230/42649 cache insertions re-used unexpired cache
> entries. Dec  2 14:23:48 dnsmasq[22548]: queries forwarded 97058,
> queries answered locally 544818
> 
> 
>     I am so confused that cache size is 10000, but "the total number
> of names that have been inserted into the cache" is 42649, why these
> two numbers are not the same?

The cache does not stop caching when it is full; at this point, a new
query will still get cached by dropping another cached query. The
dropped query is chosen so that its disappearance from the cache will
have the least effect on performance (incidentally, DNS queries have an
"expiry date", and may therefore be dropped before the cache is full).

Therefore, a cache with 10 000 entries will only hold up to 10 000
cached queries at any given time, but over time it may cache way more
than this.

> And how can i make cache size bigger
> than 10000 if my memory is lager enough? Thanks! 

The dnsmasq manpage describes all the settings available to control the
cache size, negative caching behavior, and TTL ("expiry date") min and
max capping on cached entries.

Amicalement,
-- 
Albert.



More information about the Dnsmasq-discuss mailing list