[Dnsmasq-discuss] CPU at 100%

Christopher Moore ( Linux Epos) chris at linuxepos.com
Wed Jan 18 13:35:03 GMT 2012


-----Original message-----
To:	dnsmasq-discuss at lists.thekelleys.org.uk; 
From:	Simon Kelley <simon at thekelleys.org.uk>
Sent:	Wed 18-01-2012 13:00
Subject:	Re: [Dnsmasq-discuss] CPU at 100%
> On 18/01/12 12:01, Christopher Moore ( Linux Epos) wrote:
> > Hi,
> >
> > I'm running dnsmasq 2.59 on a few hundred linux servers.
> >
> > After anything from an hour to a few days dnsmasq will use 100% of the CPU.
> >
> > Doing an strace on a running process I get:
> >
> > time(NULL) = 1326874188
> > fcntl64(0, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
> > fcntl64(0, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
> > recvmsg(0, 0xbfb3fbb4, MSG_PEEK|MSG_TRUNC) = -1 ENOTSOCK (Socket
> > operation on non-socket)
> > recvmsg(0, 0xbfb3fbb4, 0) = -1 ENOTSOCK (Socket operation on non-socket)
> > fcntl64(0, F_SETFL, O_RDWR|O_LARGEFILE) = 0
> > select(6, [0 3 4 5], [], [], NULL) = 1 (in [0])
> >
> > time(NULL) = 1326874188
> > fcntl64(0, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
> > fcntl64(0, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
> > recvmsg(0, 0xbfb3fbb4, MSG_PEEK|MSG_TRUNC) = -1 ENOTSOCK (Socket
> > operation on non-socket)
> > recvmsg(0, 0xbfb3fbb4, 0) = -1 ENOTSOCK (Socket operation on non-socket)
> > fcntl64(0, F_SETFL, O_RDWR|O_LARGEFILE) = 0
> > select(6, [0 3 4 5], [], [], NULL) = 1 (in [0])
> >
> > This repeats very quickly until the dnsmasq process is restarted.
> >
> > Any ideas?
> 
> How is the daemon being started? It's getting confused about file 
> descriptor zero, which is stdin, and is normally open to /dev/null on a 
> "daemonised" dnsmasq process.
> 
> If you restart dnsmasq and strace it before things go awry, is it 
> select()ing on file descriptor zero, or a different set of file descriptors?
> 
> Complete dnsmasq configuration would be useful too.
> 
> Cheers,
> 
> Simon.
> 

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?

Regards, Chris.

> >
> > Regards, Chris.
> >
> >
> >
> > _______________________________________________
> > Dnsmasq-discuss mailing list
> > Dnsmasq-discuss at lists.thekelleys.org.uk
> > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 
>

_________________________________________________________________________________
Scanned by an Igaware Box - protecting computers from viruses, spam, spyware and other Internet junk.
For more information visit http://www.igaware.com/
_________________________________________________________________________________




More information about the Dnsmasq-discuss mailing list