[Dnsmasq-discuss] Many immortals slow down dnsmasq. Bug or expected ?

Simon Kelley simon at thekelleys.org.uk
Sat Oct 3 23:37:23 BST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

address=/abcd/0.0.0.0/ does NOT use the cache code. There's an implied
wildcard in the domain name, it matches *.abcd. The matching for this
is a relatively slow, linear, search. It is certainly not suitable for
250000 names!

If you don't need the wildcard matching, then using

host-record=abcd,0.0.0.0

instead will make real cache entries, which are efficently searched.
That will be much, much faster.

Cheers,

Simon.

On 03/10/15 11:20, reiner otto wrote:
> Followin scenario: dnsmasq runs on embedded system; many (250,000)
> entries like "address=/abcd/0.0.0.0/" in dnsmasq.conf Caches in
> dnsmasq and browser empty. Now, when browsing to a page with many
> links to other sites, page load takes more than 10sec. Clearing
> browser cache, and reloading the same page, is much faster.
> 
> Using dig on the system, running dnsmasq, I see, that first name
> resolution takes about 400ms. Second try takes 0ms.
> 
> Cache-size set to default or 10,000 makes no difference.
> cache-size=0 makes dnsmasq unbearable slow, looks like looping
> somewhere.
> 
> Dropping the 250,000 "address=xxx" from dnsmasq.conf, shows fast
> name resolution (about 25ms) for first try.
> 
> In principal, I see same effects on my faster x86-based system.
> 
> 
> My conclusions: Time for cache lookup is not influenced by number
> of IMMORTALs. But creating a new entry in cache is badly effected
> by IMMORTALs.
> 
> As creating a new entry assumes checking first, whether same entry
> exists as IMMORTAL already, which is very like a (fast)
> cache-lookup, this *should* not have a noticable negative effect. 
> Which points to a "very slow" insertion of a new entry into hash
> table.
> 
> So, are my observations because of a bug or to be expected ?
> 
> 
> 
> 
> _______________________________________________ Dnsmasq-discuss
> mailing list Dnsmasq-discuss at lists.thekelleys.org.uk 
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCAAGBQJWEFijAAoJEBXN2mrhkTWiUhEP+QFFn/K/pwkEP0jPBkIB6AwB
ZKzYyvAdltdykt0qyZvILCf8XUydGz4Fi9z+wtdZgCfDkF4QLalQM6PrO7upqxBw
/PHCv91CGoY7wo2vdnh7YHo8D7pgbZJsAUp7HNsV0cEpi3w5kSm4zrMTVXxi7zLY
+bRmmY1n03bux9ufkfXz80oUyaSVdYbDYP7tafgZZGqnCNovqVA1M9rfJym/p5TW
6B8B3XCKc2LzEuv+zafMiacwTpxgHRruIebDjQS06jOBBpTAU1xVjD0lNG28qK8H
RKG/49R8n93Uyy6B97Wo/g4EtkvLdXbmkW8zuG9+mLEZ/qVlBg0PgF1m9DPd+W3w
V0rV3d0UwNh8ztGoUE4HOQ4O13TlrO1wY69NffO1XE+S4kaTRO4j8z3qW9XK6wrh
pdzkmLQ+XXMi8+EUzNo9cSpQ/eFIzXoPFixLcvli4D+mqpVScBhUmU7vO6PyXDEO
fr6UHmkEGYcdz7zH7UrUHa61Yz+UuX7Sq33HprNMJacU1PAOjqDIR5I98bjmPGuV
p4uRsDIhLfW7mzTn/WdJKiQMBXOhqRcErAv3+g68YdtgiUV7vqP2naMRIJjpjI6r
DvnlXRjRX2J2WD7g7zd2WduQvvuw6gu8HmlsJoxoZK9xmmPk6ZO0rHlSm2NefeL4
uYtQRpW0aHr2v5KkGBvY
=Fy+4
-----END PGP SIGNATURE-----



More information about the Dnsmasq-discuss mailing list