[Dnsmasq-discuss] CPU at 100%

Simon Kelley simon at thekelleys.org.uk
Wed Jan 18 13:48:57 GMT 2012


On 18/01/12 13:35, Christopher Moore ( Linux Epos) wrote:

>
> Thanks for the quick reply.
>
> Dnsmasq is being started via:
>
> nice -n 0 initlog -q -c /usr/local/sbin/dnsmasq --cache-size=500 --dns-forward-max=150
>
> Here's the output of lsof -c dnsmasq (This output was taken when the process is using 100% of the CPU) :
>
> COMMAND   PID   USER   FD   TYPE     DEVICE SIZE/OFF     NODE NAME
> dnsmasq 16818 nobody  cwd    DIR        9,5     4096        2 /
> dnsmasq 16818 nobody  rtd    DIR        9,5     4096        2 /
> dnsmasq 16818 nobody  txt    REG        9,5   164296    22152 /usr/local/sbin/dnsmasq
> dnsmasq 16818 nobody  mem    REG        9,5    42496   775855 /lib/libnss_files-2.10.1.so
> dnsmasq 16818 nobody  mem    REG        9,5  1327456   775734 /lib/libc-2.10.1.so
> dnsmasq 16818 nobody  mem    REG        9,5   117348   355541 /lib/ld-2.10.1.so
> dnsmasq 16818 nobody    0u   CHR        1,3      0t0    19603 /dev/null
> dnsmasq 16818 nobody    1u   CHR        1,3      0t0    19603 /dev/null
> dnsmasq 16818 nobody    2u   CHR        1,3      0t0    19603 /dev/null
> dnsmasq 16818 nobody    3u  IPv4   20851151      0t0      UDP *:domain
> dnsmasq 16818 nobody    4u  IPv4   20851152      0t0      TCP *:domain (LISTEN)
> dnsmasq 16818 nobody    5r  FIFO        0,6      0t0 20851159 pipe
> dnsmasq 16818 nobody    6w  FIFO        0,6      0t0 20851159 pipe
> dnsmasq 16818 nobody    7u  unix 0xf6ed9a80      0t0 20851162 socket
>
>
> Dnsmasq configuration is :
>
> domain-needed
> bogus-priv
> resolv-file=/var/igaware/local/nameservers
> user=nobody
> group=nobody
> interface=eth0
> interface=eth1
> interface=eth2
> no-dhcp-interface=eth0
> no-dhcp-interface=eth1
> no-dhcp-interface=eth2
> cache-size=500
> local-ttl=3600
>
>
> I have just realised that the eth2 interface doesn't actually exist on the machine, would that cuse a problem?
>


Lack of eth2 won't cause a problem.

If would be useful to see the output of lsof _before_ the 100% CPU 
phase. What's obvious from the information we already have is that:

1) The netlink socket which should be open, isn't.

2) dnsmasq believes that the netlink socket is open and that it's file 
descriptor zero.

File descriptor zero is actually open to /dev/null (that's OK). My guess 
is that something, somewhere on the machine writing to /dev/null is 
enough to make it ready for reading in select() and that's when the 100% 
CPU thing starts.

I assume because it's in /usr/local/sbin that this is a locally-compiled 
binary. It's not locally-modified code, is it?


Cheers,

Simon.



More information about the Dnsmasq-discuss mailing list