AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home.html
GNU General Public License v3.0
25.5k stars 1.83k forks source link

High CPU once a day #4531

Closed Jleagle closed 2 years ago

Jleagle commented 2 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

Issue Details

I have AdGuard running in docker on my 4-core Intel NUC. Once a day at the same time the CPU will ramp up and go high for a couple of hours. Only filter updates in logs and nothing at the same time. I only have filter lists enabled, other filters are disabled.

/opt/adguardhome # ./AdGuardHome -v --version
AdGuard Home
Version: v0.107.6
Channel: release
Go version: go1.17.9
GOOS: linux
GOARCH: amd64
Race: false
Dependencies:
    github.com/AdguardTeam/dnsproxy@v0.41.4 (sum: h1:zA8BJmWBkSL5kp4b8CblQRgIrLGzJ4IUGQ7tA1255Cw=)
    github.com/AdguardTeam/golibs@v0.10.8 (sum: h1:diU9gP9qG1qeLbAkzIwfUerpHSqzR6zaBgzvRMR/m6Q=)
    github.com/AdguardTeam/urlfilter@v0.15.2 (sum: h1:LZGgrm4l4Ys9eAqB+UUmZfiC6vHlDlYFhx0WXqo6LtQ=)
    github.com/NYTimes/gziphandler@v1.1.1 (sum: h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=)
    github.com/aead/chacha20@v0.0.0-20180709150244-8b13a72661da (sum: h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=)
    github.com/aead/poly1305@v0.0.0-20180717145839-3fee0db0b635 (sum: h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw=)
    github.com/ameshkov/dnscrypt/v2@v2.2.3 (sum: h1:X9UP5AHtwp46Ji+sGFfF/1Is6OPI/SjxLqhKpx0P5UI=)
    github.com/ameshkov/dnsstamps@v1.0.3 (sum: h1:Srzik+J9mivH1alRACTbys2xOxs0lRH9qnTA7Y1OYVo=)
    github.com/beefsack/go-rate@v0.0.0-20200827232406-6cde80facd47 (sum: h1:M57m0xQqZIhx7CEJgeLSvRFKEK1RjzRuIXiA3HfYU7g=)
    github.com/cheekybits/genny@v1.0.0 (sum: h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE=)
    github.com/digineo/go-ipset/v2@v2.2.1 (sum: h1:k6skY+0fMqeUjjeWO/m5OuWPSZUAn7AucHMnQ1MX77g=)
    github.com/fsnotify/fsnotify@v1.5.1 (sum: h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=)
    github.com/go-ping/ping@v0.0.0-20211130115550-779d1e919534 (sum: h1:dhy9OQKGBh4zVXbjwbxxHjRxMJtLXj3zfgpBYQaR4Q4=)
    github.com/google/go-cmp@v0.5.6 (sum: h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=)
    github.com/google/gopacket@v1.1.19 (sum: h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=)
    github.com/google/renameio@v1.0.1 (sum: h1:Lh/jXZmvZxb0BBeSY5VKEfidcbcbenKjZFzM/q0fSeU=)
    github.com/google/uuid@v1.3.0 (sum: h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=)
    github.com/insomniacslk/dhcp@v0.0.0-20211214070828-5297eed8f489 (sum: h1:jhdHqd7DxBrzfuFSoPxjD6nUVaV/1RIn9aHA0WCf/as=)
    github.com/josharian/native@v0.0.0-20200817173448-b6b71def0850 (sum: h1:uhL5Gw7BINiiPAo24A2sxkcDI0Jt/sqp1v5xQCniEFA=)
    github.com/kardianos/service@v1.2.0 (sum: h1:bGuZ/epo3vrt8IPC7mnKQolqFeYJb7Cs8Rk4PSOBB/g=)
    github.com/lucas-clemente/quic-go@v0.25.0 (sum: h1:K+X9Gvd7JXsOHtU0N2icZ2Nw3rx82uBej3mP4CLgibc=)
    github.com/marten-seemann/qtls-go1-17@v0.1.0 (sum: h1:P9ggrs5xtwiqXv/FHNwntmuLMNq3KaSIG93AtAZ48xk=)
    github.com/mdlayher/ethernet@v0.0.0-20190606142754-0394541c37b7 (sum: h1:lez6TS6aAau+8wXUP3G9I3TGlmPFEq2CTxBaRqY6AGE=)
    github.com/mdlayher/netlink@v1.5.0 (sum: h1:r4fa439+SsMarM0rMONU3iSshSV3ArVqJl6H/zjrhh4=)
    github.com/mdlayher/raw@v0.0.0-20211126142749-4eae47f3d54b (sum: h1:MHcTarUMC4sFA7eiyR8IEJ6j2PgmgXR+B9X2IIMjh7A=)
    github.com/mdlayher/socket@v0.1.1 (sum: h1:q3uOGirUPfAV2MUoaC7BavjQ154J7+JOkTWyiV+intI=)
    github.com/ainar-g/dns@v1.1.49-0.20220411125901-8a162bbc18d8 (sum: h1:Hp2waLwK989ui3bDkFpedlIHfyWdZ77gynvd+GPEqXY=)
    github.com/patrickmn/go-cache@v2.1.0+incompatible (sum: h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=)
    github.com/pkg/errors@v0.9.1 (sum: h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=)
    github.com/satori/go.uuid@v1.2.0 (sum: h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=)
    github.com/ti-mo/netfilter@v0.4.0 (sum: h1:rTN1nBYULDmMfDeBHZpKuNKX/bWEXQUhe02a/10orzg=)
    github.com/u-root/uio@v0.0.0-20210528151154-e40b768296a7 (sum: h1:XMAtQHwKjWHIRwg+8Nj/rzUomQY1q6cM3ncA0wP8GU4=)
    go.etcd.io/bbolt@v1.3.6 (sum: h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=)
    golang.org/x/crypto@v0.0.0-20211215153901-e495a2d5b3d3 (sum: h1:0es+/5331RGQPcXlMfP+WrnIIS6dNnNRe0WB02W0F4M=)
    golang.org/x/net@v0.0.0-20220403103023-749bd193bc2b (sum: h1:vI32FkLJNAWtGD4BwkThwEy6XS7ZLLMHkSkYfF8M0W0=)
    golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c (sum: h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=)
    golang.org/x/sys@v0.0.0-20220406163625-3f8b81556e12 (sum: h1:QyVthZKMsyaQwBTJE04jdNN0Pp5Fn9Qga0mrgxyERQM=)
    golang.org/x/text@v0.3.7 (sum: h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=)
    gopkg.in/natefinch/lumberjack.v2@v2.0.0 (sum: h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=)
    gopkg.in/yaml.v2@v2.4.0 (sum: h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=)
    howett.net/plist@v1.0.0 (sum: h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM=)

Screenshots

CPU charts of AdGuard (green)

ainar-g commented 2 years ago

Hello. What is your filter update interval? Recompilation of the filtering rule lists is a CPU intensive task, so if you have a lot of those, it may take a while.

Jleagle commented 2 years ago

Filters update interval = 24 hours. Looking at my lists they seem to update at 6PM, but CPU spikes at 11AM

ainar-g commented 2 years ago

I see, thanks. Can you configure AdGuard Home to collect verbose logs and wait until that happens again? You can send us the logs at devteam@adguard.com.

Jleagle commented 2 years ago

Is there an environment variable to do this on docker?

Edit, this worked for me, but isn't persistent:

docker exec -it adguard sh
apk add nano && nano /opt/adguardhome/conf/AdGuardHome.yaml
docker restart adguard
ainar-g commented 2 years ago

What command are you using to run the docker image? If you followed our guide then the configuration file should be in the directory that you've mounted.

Jleagle commented 2 years ago

Thanks, got it sorted.

I see, thanks. Can you configure AdGuard Home to collect verbose logs and wait until that happens again? You can send us the logs at devteam@adguard.com.

Sent!

EugeneOne1 commented 2 years ago

@Jleagle, we've received the logs and investigating it. Thanks.

EugeneOne1 commented 2 years ago

@Jleagle, hello again. Could you please try to install one of the latest beta/edge builds and check if it still loads the CPU? We suspect it may be related to the #3157 which is fixed in the mentioned builds.

Note that a few configuration changes have been made so you may want to backup your AdGuardHome.yaml file. Consider also making a backup of the data directory.