[Dnsmasq-discuss] dnsmasq pegs CPU and hangs?

Simon Kelley simon at thekelleys.org.uk
Thu May 15 09:53:51 BST 2008

Alex Chekholko wrote:
> Hi,
> I have an HPC cluster that uses dnsmasq on a head node with /etc/hosts
> for its internal DNS.
> Every once in a while, dnsmasq will use 100%CPU and hang, which creates
> various problems for the clients.
> A 'service dnsmasq reload' succeeds but does not fix the problem. A
> 'service dnsmasq restart' fixes the problem.  CPU usage is generally ~0%
> except when this happens.
> I don't see anything useful in the logs.
> This is dnsmasq-2.41-1.el5.rf (from RPMforge) on CentOS 5.1.
> Any suggestions for troubleshooting?  Looking at the documentation, it
> looks like I could turn on complete logging...

Worrying. In general the best way to troubleshoot this is to get a
core-dump of dnsmasq when it's in the "gone away" state. To do that
follow a procedure something like:

1) Download dnsmasq source and build a binary with debugging symbols

tar xzf dnsmasq-2.41.tar.gz
cd dnsmasq-2.41
make CFLAGS=-g

2) Stop the system dnsmasq and start the new binary, keeping it in the

(as root)
/etc/init.d/dnsmasq stop
cd dnsmasq-2.41/src
ulimit -c unlimited
./dnsmasq -d

3) kill dnsmasq so it dumps core.

(as root in a new window)
killall -ABRT dnsmasq
(original window should say -core dumped)

4) send src/dnsmasq and src/core to me, to check that I can read them
and we have good data.

5) restart dnsmasq in orginal window
./dnsmasq -d

6) wait for hang and repeat kill dnsmasq and sending core/binary steps

It would help if you could send the configuration file you're using too.



More information about the Dnsmasq-discuss mailing list