[Dnsmasq-discuss] cache size & /etc/hosts

Gyorgy Farkas farkas.mailbox@axelero.hu
Thu, 16 Dec 2004 20:29:41 +0100

Dear Simon,

Please read this old post - quoted from the archive of floppyfw.devel NG.

From: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Newsgroups: floppyfw.devel
Date: 2003.11.25. 23:27:56
Subject: Re: dnsmasq crashes

On Tue, 25 Nov 2 Cristian Ionescu-Idbohrn wrote:

> On Tue, 25 Nov 2003, Hernan Freschi wrote:
> > I used a huge hosts file, gotten from
> > http://www.accs-net.com/hosts/get_hosts.html. But dnsmasq seems to
> > crash, i guess because the file is too big, because if i do head 1000
> > lines, then it works ok.
> > How big can the hosts file be for dnsmasq? Is there any way around?
> Let's ask Simon.

And Simon answers:

On Tue, 25 Nov 2003, Simon Kelley wrote:
> There's no hard limit, shouldn't be any real soft limit (Ie for any
> sane number, performance should be OK.)
> Which file exactly from that site causes the crash?
> Note that versions 1.14, 1.15, and 1.16 have a known problem: if you are
> running any of those then upgrade _now_. If you are seeing crashes on
> later versions I'd like to be able to reproduce that.
> Cheers,
> Simon.

You writes in /dnsmasq/CHANGELOG file:

release 0.992
Small change to memory allocation so that names in /etc/hosts
don't use cache slots.

release 1.14
Added hashed searching of domain names. People are starting
to use dnsmasq with larger loads now, and bigger caches,
and large lists of ad-block addresses. This means doing
linear searches can start to use lots of CPU so I added hashed
searching and seriously optimised the cache code for 
algorithmic efficiency. Also upped the limit on cache 
size to 10000.

I'm confused. What is the situation now with the size of cache
and the size of memory - allocated for /etc/hosts ?

2.0.x series of floppyfw has dnsmasq version 1.2 (because of size;)
2.9.x series has version 1.18
(and I'm using version 2.15 on ffw-2.9.13).

Thank you in advance,