Koozali.org formerly Contribs.org

dnscache 50% CPU

dnscache 50% CPU
« on: June 21, 2015, 03:16:55 PM »
Dnscache process gets 50% CPU usage after some minutes running.
I have this problem on 3 sme Servers only.
When I have only sme server and a router running (no Windows Client or other Computers) is the the Problem after some minutes.
I think this problem is only then, when a host have no ip.
I get this message 10 time pro secound in /var/log/dnscache/current and never stopp:

2015-06-21 15:07:14.107621500 query 431094 c0a87b02:5064:6aaf 1 4-u.co.uk.
2015-06-21 15:07:14.107653500 tx 0 1 4-u.co.uk. . 7f000002
2015-06-21 15:07:14.110441500 drop 430895 timed out
2015-06-21 15:07:14.110445500 query 431095 c0a87b02:4995:1af6 1 4-u.co.uk.
2015-06-21 15:07:14.110448500 tx 0 1 4-u.co.uk. . 7f000002
2015-06-21 15:07:14.113528500 drop 430896 timed out
2015-06-21 15:07:14.113532500 query 431096 c0a87b02:5732:c5d9 1 4-u.co.uk.
2015-06-21 15:07:14.113535500 tx 0 1 4-u.co.uk. . 7f000002
2015-06-21 15:07:14.113917500 drop 430897 timed out
2015-06-21 15:07:14.113919500 query 431097 c0a87b02:1348:a350 1 4-u.co.uk.
2015-06-21 15:07:14.113922500 tx 0 1 4-u.co.uk. . 7f000002
2015-06-21 15:07:14.113924500 drop 430898 timed out
2015-06-21 15:07:14.113926500 query 431098 c0a87b02:0b6b:39c0 1 4-u.co.uk.
2015-06-21 15:07:14.113929500 tx 0 1 4-u.co.uk. . 7f000002

on a other sme server without this problem, I see this message in the /var/log/dnscache/current:

2015-06-21 15:13:21.234820500 query 6878 c0a8c90a:d5d5:eee3 1 4-u.co.uk.
2015-06-21 15:13:21.234828500 tx 0 1 4-u.co.uk. . 7f000002
2015-06-21 15:13:26.232671500 query 6879 c0a8c90a:d5d5:eee3 1 4-u.co.uk.
2015-06-21 15:13:26.232687500 tx 0 1 4-u.co.uk. . 7f000002
2015-06-21 15:13:31.232783500 query 6880 c0a8c90a:eab9:3d2e 1 4-u.co.uk.swt-online.de.
2015-06-21 15:13:31.232884500 cached nxdomain 4-u.co.uk.swt-online.de.
2015-06-21 15:13:31.232885500 sent 6880 41
2015-06-21 15:13:47.160591500 servfail 4-u.co.uk. input/output error
2015-06-21 15:13:47.160612500 sent 6878 27
2015-06-21 15:13:51.283568500 servfail 4-u.co.uk. input/output error
2015-06-21 15:13:51.283589500 sent 6879 27

What is wrong on my sme servers?
All sme servers uptodate.
When I change the DNS Server in the router, there is the same.

« Last Edit: June 21, 2015, 03:20:51 PM by yythoss »

Offline Stefano

  • *
  • 10,800
  • Skype account: maghissimo
    • Smeserver italian community
Re: dnscache 50% CPU
« Reply #1 on: June 21, 2015, 04:21:37 PM »
try:

Code: [Select]
config setprop dnscache Forwarder 8.8.8.8
signal-event dns-update

and let us know
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia

Re: dnscache 50% CPU
« Reply #2 on: June 21, 2015, 04:25:57 PM »
No, the problem is the same.
Now no host is relsove.

Re: dnscache 50% CPU
« Reply #3 on: June 21, 2015, 04:37:10 PM »
I find the problem!

The sme server with this problem has a Forwarder2 in the configuration db:

dnscache=service
    Forwarder=192.168.123.1
    Forwarder2=192.168.123.2
    TCPPort=53
    UDPPort=53
    access=private
    status=enabled

router ip: 192.168.123.1
sme server ip: 192.168.123.2

when I remove the entry: Forwarder2=192.168.123.2
every works fine!
All other sme server that works, have not this entry in the configurations db.
Is this a Bug?
« Last Edit: June 21, 2015, 04:51:03 PM by yythoss »

Re: dnscache 50% CPU
« Reply #4 on: June 21, 2015, 04:53:59 PM »
Now I make the change on all three sme server.
Now all is ok and the CPU load is normal.

Thank you for the suggestion with Forwarder!

guest22

Re: dnscache 50% CPU
« Reply #5 on: June 22, 2015, 06:03:03 AM »
when I remove the entry: Forwarder2=192.168.123.2
every works fine!
All other sme server that works, have not this entry in the configurations db.
Is this a Bug?

No, it's a human error. A property of 'Forwarder2' does not exist. If the core code (template) evaluates the db properties, it could well be that the value of the property Forwarder is overwritten by the value of the second Forwarder2 property, for the template seeks for the word 'Forwarder' only and finds another one...

Stick to official db entries only.

Re: dnscache 50% CPU
« Reply #6 on: June 22, 2015, 09:15:11 AM »
I have not made on any of these servers this Forwarder2 db entry.
I have just found this entry. The servers were all configured with the admin Console.

Offline Daniel B.

  • *
  • 1,697
    • Firewall Services, la sécurité des réseaux
Re: dnscache 50% CPU
« Reply #7 on: June 22, 2015, 09:35:49 AM »
Forwarder2 is an existing DB entry, and can be set from the server-manager (the domains panel, DNS settings, secondaray DNS server). There's no bug, but an admin error, you've set DNS so that SME should forward requests to itself, creating an infinite loop. Removing SME from the forwarders cleared the error as it opened this loop.

Cheers,
Daniel
C'est la fin du monde !!! :lol:

Re: dnscache 50% CPU
« Reply #8 on: June 22, 2015, 09:42:04 AM »
Sorry no, I have not set a second DNS Server on this three sme server.
Only used the admin console.
On the admin console I set the router as DNS Server, there is no question to a secound DNS Server in the admin console.

I talk with the local administrator, if he set this entry.

Thanks a lot.

guest22

Re: dnscache 50% CPU
« Reply #9 on: June 22, 2015, 12:46:56 PM »
Forwarder2 is an existing DB entry, and can be set from the server-manager (the domains panel, DNS settings, secondaray DNS server).


Then we have a documentation issue.

Offline Stefano

  • *
  • 10,800
  • Skype account: maghissimo
    • Smeserver italian community
Re: dnscache 50% CPU
« Reply #10 on: June 22, 2015, 12:55:19 PM »
I see that Forwarder2 value is used in /etc/e-mith/templates/var/service/dnscache.forwarder/root/servers/@

Code: [Select]
[root@fileserver templates]$ more var/service/dnscache.forwarder/root/servers/@
{
    my @servers = qw (
                        198.41.0.4
                        192.228.79.201
                        192.33.4.12
            199.7.91.13
                        192.203.230.10
                        192.5.5.241
                        192.112.36.4
                        128.63.2.53
                        192.36.148.17
                        192.58.128.30
                        193.0.14.129
                        199.7.83.42
                        202.12.27.33
                    );

    my $forwarder = $dnscache{Forwarder};

    $OUT = $forwarder ? "$forwarder" : join("\n", @servers);
    if ($forwarder = $dnscache{Forwarder2})
    {
        $OUT .= "\n$forwarder";
    }
}

I'm not a perl guru but.. if dnscache.forwarder is set, we use it instead of the root servers.. so far, so good

I'm a bit lost with:
Code: [Select]
if ($forwarder = $dnscache{Forwarder2})
    {
        $OUT .= "\n$forwarder";
    }

can anybody enlight me please? TIA
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia

Re: dnscache 50% CPU
« Reply #11 on: June 22, 2015, 03:45:02 PM »
can anybody enlight me please?

That says that if the Forwarder2 property is set, the value is listed as well - i.e. if there are two entries, list both of them.

There's clearly a validation error in the domains panel. We should prevent an admin from setting the SME server address as one DNS forwarder addresses.

Offline Stefano

  • *
  • 10,800
  • Skype account: maghissimo
    • Smeserver italian community
Re: dnscache 50% CPU
« Reply #12 on: June 22, 2015, 03:48:55 PM »
ok, re-reading code I finally understand.. $forwarder variable is assigned two times.. I was wrong and I see only one (the first one) assignment..

I agree there's a validation error.. yythoss, can you please open a bug and report here the reference? TIA
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia