nextdns: High CPU usage on Unifi Dream Machine
I use the nextdns CLI on a Unifi Dream Machine with firmware 1.8.1-rc.3
I already had it twice that the nextdns CLI has a very high CPU usage:

Restarting the service with nextdns restart solved the problem.
The logs from nextdns logs:
-- Logs begin at Mon 2020-09-14 00:13:05 CEST, end at Mon 2020-09-14 00:33:12 CEST. --
Sep 14 00:13:05 PAYNEBOX systemd[1]: Starting NextDNS DNS53 to DoH proxy....
Sep 14 00:13:05 PAYNEBOX nextdns[77]: Starting NextDNS 1.8.3/linux on localhost:5553
Sep 14 00:13:05 PAYNEBOX nextdns[77]: Listening on TCP/127.0.0.1:5553
Sep 14 00:13:05 PAYNEBOX nextdns[77]: Listening on UDP/127.0.0.1:5553
Sep 14 00:13:05 PAYNEBOX nextdns[77]: Starting mDNS discovery
Sep 14 00:13:05 PAYNEBOX ssh[78]: Welcome to UbiOS
Sep 14 00:13:05 PAYNEBOX ssh[78]: By logging in, accessing, or using the Ubiquiti product, you
Sep 14 00:13:05 PAYNEBOX ssh[78]: acknowledge that you have read and understood the Ubiquiti
Sep 14 00:13:05 PAYNEBOX ssh[78]: License Agreement and agree to be bound by its terms.
Sep 14 00:13:05 PAYNEBOX systemd[1]: Started NextDNS DNS53 to DoH proxy..
Sep 14 00:13:10 PAYNEBOX nextdns[77]: Setting up router
Sep 14 00:13:14 PAYNEBOX nextdns[77]: Activating
Sep 14 00:13:14 PAYNEBOX nextdns[77]: Activate: setup resolv.conf: rename /etc/resolv.conf /etc/resolv.conf.nextdns-bak: device or resource busy
Sep 14 00:13:14 PAYNEBOX nextdns[77]: Connected 45.90.28.0:443 (con=22ms tls=711ms, TLS13)
Sep 14 00:13:14 PAYNEBOX nextdns[77]: Connected 199.247.16.158:443 (con=21ms tls=27ms, TLS13)
Sep 14 00:13:14 PAYNEBOX nextdns[77]: Switching endpoint: https://vultr-fra-1.edge.nextdns.io#199.247.16.158,2a05:f480:1800:8ed:5400:2ff:fec8:7e46
Sep 14 00:13:30 PAYNEBOX nextdns[77]: Query 192.168.1.84 UDP PTR b._dns-sd._udp.0.1.168.192.in-addr.arpa. (qry=57/res=12) 0ms : not found
Sep 14 00:13:30 PAYNEBOX nextdns[77]: Query 192.168.1.84 UDP PTR lb._dns-sd._udp.0.1.168.192.in-addr.arpa. (qry=58/res=12) 1ms : not found
Sep 14 00:13:30 PAYNEBOX nextdns[77]: Query 192.168.1.84 UDP PTR db._dns-sd._udp.0.1.168.192.in-addr.arpa. (qry=58/res=12) 1ms : not found
Sep 14 00:13:31 PAYNEBOX nextdns[77]: Query 192.168.1.84 UDP PTR b._dns-sd._udp.0.1.168.192.in-addr.arpa. (qry=57/res=12) 0ms : not found
Sep 14 00:13:31 PAYNEBOX nextdns[77]: Query 192.168.1.84 UDP PTR lb._dns-sd._udp.0.1.168.192.in-addr.arpa. (qry=58/res=12) 0ms : not found
Sep 14 00:13:31 PAYNEBOX nextdns[77]: Query 192.168.1.84 UDP PTR db._dns-sd._udp.0.1.168.192.in-addr.arpa. (qry=58/res=12) 0ms : not found
Sep 14 00:13:33 PAYNEBOX nextdns[77]: Query 192.168.1.84 UDP PTR lb._dns-sd._udp.0.1.168.192.in-addr.arpa. (qry=58/res=12) 0ms : not found
Sep 14 00:13:33 PAYNEBOX nextdns[77]: Query 192.168.1.84 UDP PTR db._dns-sd._udp.0.1.168.192.in-addr.arpa. (qry=58/res=12) 0ms : not found
Sep 14 00:13:33 PAYNEBOX nextdns[77]: Query 192.168.1.84 UDP PTR b._dns-sd._udp.0.1.168.192.in-addr.arpa. (qry=57/res=12) 0ms : not found
Sep 14 00:16:09 PAYNEBOX nextdns[77]: Connected 199.247.16.158:443 (con=16ms tls=20ms, TLS13)
Sep 14 00:17:18 PAYNEBOX nextdns[77]: Connected 199.247.16.158:443 (con=20ms tls=22ms, TLS13)
Sep 14 00:21:18 PAYNEBOX systemd[1]: Stopping NextDNS DNS53 to DoH proxy....
Sep 14 00:21:18 PAYNEBOX nextdns[77]: Received signal: terminated
Sep 14 00:21:18 PAYNEBOX nextdns[77]: Stopping NextDNS 1.8.3/linux
Sep 14 00:21:18 PAYNEBOX nextdns[77]: Restore router settings
Sep 14 00:21:18 PAYNEBOX nextdns[77]: Deactivating
Sep 14 00:21:18 PAYNEBOX nextdns[77]: NextDNS 1.8.3/linux stopped
Sep 14 00:21:18 PAYNEBOX systemd[1]: nextdns.service: Succeeded.
Sep 14 00:21:18 PAYNEBOX systemd[1]: Stopped NextDNS DNS53 to DoH proxy..
Sep 14 00:21:18 PAYNEBOX systemd[1]: Starting NextDNS DNS53 to DoH proxy....
Sep 14 00:21:18 PAYNEBOX nextdns[2634]: Starting NextDNS 1.8.3/linux on localhost:5553
Sep 14 00:21:18 PAYNEBOX nextdns[2634]: Listening on TCP/127.0.0.1:5553
Sep 14 00:21:18 PAYNEBOX nextdns[2634]: Starting mDNS discovery
Sep 14 00:21:18 PAYNEBOX nextdns[2634]: Listening on UDP/127.0.0.1:5553
Sep 14 00:21:18 PAYNEBOX ssh[2635]: Welcome to UbiOS
Sep 14 00:21:18 PAYNEBOX ssh[2635]: By logging in, accessing, or using the Ubiquiti product, you
Sep 14 00:21:18 PAYNEBOX ssh[2635]: acknowledge that you have read and understood the Ubiquiti
Sep 14 00:21:18 PAYNEBOX ssh[2635]: License Agreement and agree to be bound by its terms.
Sep 14 00:21:18 PAYNEBOX systemd[1]: Started NextDNS DNS53 to DoH proxy..
Sep 14 00:21:23 PAYNEBOX nextdns[2634]: Setting up router
Sep 14 00:21:24 PAYNEBOX nextdns[2634]: Activating
Sep 14 00:21:24 PAYNEBOX nextdns[2634]: Activate: setup resolv.conf: rename /etc/resolv.conf /etc/resolv.conf.nextdns-bak: device or resource busy
Sep 14 00:21:24 PAYNEBOX nextdns[2634]: Connected 45.90.28.0:443 (con=26ms tls=109ms, TLS13)
Sep 14 00:21:25 PAYNEBOX nextdns[2634]: Connected 199.247.16.158:443 (con=16ms tls=23ms, TLS13)
Sep 14 00:21:25 PAYNEBOX nextdns[2634]: Switching endpoint: https://vultr-fra-1.edge.nextdns.io#199.247.16.158,2a05:f480:1800:8ed:5400:2ff:fec8:7e46
Sep 14 00:25:27 PAYNEBOX nextdns[2634]: Connected 199.247.16.158:443 (con=0ms tls=0ms, )
Context
- Version: 1.8.3
- Platform: UbiOS 1.8.1-rc3
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 46 (15 by maintainers)
Commits related to this issue
- Fix unclosed UDP sockets on discovery DNS Could be related to #321 — committed to nextdns/nextdns by rs 4 years ago
I reproduced the issue twice, and query logs did not show anything suspicious. I will add a debug interface in order to inspect the process. In the meantime, restarting the daemon will fix the issue.
1.8.5 should come with more potential fixes