nextdns: High CPU on EdgeOS

Context

  • CLI Version: nextdns version 1.37.2
  • Platform: EdgeRouter ER-X-SFP / EdgeOSv2.0.9-hotfix.2

NextDNS starts consuming all the CPU on my EdgeRouter, at least once a day.

Example: top output

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                                         
 3889 root      20   0  670268  87888   5148 R 272.4 34.7  49:20.80 nextdns         

Config:

cache-size 0
cache-max-age 0s
bogus-priv true
timeout 5s
listen localhost:53
control /var/run/nextdns.sock
use-hosts true
max-inflight-requests 256
detect-captive-portals false
hardened-privacy false
log-queries false
max-ttl 0s
report-client-info true
discovery-dns 
setup-router true
config ****
auto-activate false

Trace here: https://gist.github.com/nbrewster/fd250ddc3cad791073756ddb2007bba5

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 66 (11 by maintainers)

Commits related to this issue

Most upvoted comments

1.37.7 is using Go 1.16. See https://github.com/nextdns/nextdns/pull/618. It has been confirmed by several people this was solving the problem for them on ER-X. Maybe you can try the snapshot in https://github.com/nextdns/nextdns/pull/620. This is using the exact same version Go version than for 1.35.

I run into the same issue with my Edgerouter lite. Every few days, this happens.

  • dns resolving stops working.
  • edgerouter process consumes a lot of CPU Internet connectivity is fine. Pinging or ssh to known IP addresses works. Only resolving is broken. I fix it by restarting nextdns on the router.

I’ve been running nextdns version 0.0.0-SNAPSHOT-ff4185e since a couple of days. The problem remains on this snapshot.

During the last outage I took these trace, lsof and log output. lsof.txt trace.txt log.txt

Note that nextdns is listening on port 5555. I have my dnsmasq listening on port 53 and configured to forward all request to port 5555. config.txt

If this is not related, I’m happy to open a new issue.

Oh, and I didn’t do a hardware reset lately.

I’m trying with older version 1.36.0. Will report back if i can reproduce the problem.

I think to set installation version, we can use NEXTDNS_VERSION environment variable Run this command first before sh the installation script. export NEXTDNS_VERSION=1.36.0

To install the older version, i first remove nextdns via CLI, then reinstall it.