Discussion:
[Dnsmasq-discuss] Huge hosts file and CPU usage
Mike Leong
2016-04-26 22:43:34 UTC
Permalink
Hi,

I have a blacklist of 1.5 million entries loaded into dnsmasq via "address"
definitions. eg:

address="/bad-site.com/192.168.5.1"

The 1.5 million entries are a list of porn/warze sites collected from
various blacklists.

According to top, dnsmasq uses about 200MB of RAM w/ that list loaded.

I'm noticing high CPU usage w/ that blacklist. (spikes to about 80% on an
i7)

dnsmasq version: 2.62-3+deb7u3 (from debian wheezy)

Are there any tuning (compiler options, code changes) what would reduce the
CPU usage?

I also tried using addn-hosts format but CPU usage was the same.

thx
mike
Simon Kelley
2016-05-02 16:13:39 UTC
Permalink
Post by Mike Leong
Hi,
I have a blacklist of 1.5 million entries loaded into dnsmasq via "address"
address="/bad-site.com/192.168.5.1"
The 1.5 million entries are a list of porn/warze sites collected from
various blacklists.
According to top, dnsmasq uses about 200MB of RAM w/ that list loaded.
I'm noticing high CPU usage w/ that blacklist. (spikes to about 80% on an
i7)
dnsmasq version: 2.62-3+deb7u3 (from debian wheezy)
Are there any tuning (compiler options, code changes) what would reduce the
CPU usage?
I also tried using addn-hosts format but CPU usage was the same.
Are you sure? That would be my suggestion, since it uses much more
efficient search code. BTW, ensure that you're mapping the bad domains
to one or a few IP addresses, since reverse (address->name) lookups are
not so well optimised.



Cheers,

Simon.
Post by Mike Leong
thx
mike
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Chen Wei
2016-05-04 08:04:25 UTC
Permalink
Post by Mike Leong
I have a blacklist of 1.5 million entries loaded into dnsmasq via "address"
address="/bad-site.com/192.168.5.1"
https://github.com/infinet/dnsmasq
Post by Mike Leong
The 1.5 million entries are a list of porn/warze sites collected from
various blacklists.
According to top, dnsmasq uses about 200MB of RAM w/ that list loaded.
I'm noticing high CPU usage w/ that blacklist. (spikes to about 80% on an
i7)
dnsmasq version: 2.62-3+deb7u3 (from debian wheezy)
Are there any tuning (compiler options, code changes) what would reduce the
CPU usage?
I also tried using addn-hosts format but CPU usage was the same.
--
Chen Wei
Loading...