AdguardTeam / AdGuardHome

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

v0.107.37 version is extremely slow on raspberrypi unless stats are cleared. #6197

Closed finBitorg closed 5 months ago

finBitorg commented 1 year ago

Prerequisites

Platform (OS and CPU architecture)

Darwin (aka macOS), AMD64 (aka x86_64)

Installation

GitHub releases or script from README

Setup

On one machine

AdGuard Home version

v0.107.37

Action

After updating to v0.107.37 version on raspberrypi the server becomes very slow an unresponsive due to stats/query collecting.

Clearing statistics alleviates this problem; but would be nice to be able to push stats into ram only.

My guess is that new stats just pushes the sdcard too much.

Expected result

expected same performance as previous version before v0.107.37

Actual result

Slow barely responding server

Additional information and/or screenshots

raspberypi os 32bit

Dynamic5912 commented 1 year ago

No issues here.

RPi4 with 64-bit DietPi install.

Statistics set to store 90 days and currently have around 30+ days of stored statistics.

finBitorg commented 1 year ago

Maybe stats db was corrupted after clearing all stats its pretty snappy

danieletorelli commented 1 year ago

This is even more clear on slower systems, where the I/O times with large databases of statistics and query log take a lot of time and degrade performances. I didn't personally investigate why this happens, but the persistence should ideally happen in parallel with the DNS resolution. As you say, stats and query logs should mostly stay in memory and be persisted every X amount of seconds (would be nice to be able to configure the X as well).

danieletorelli commented 1 year ago

I also had this issue on both my Raspberry Pi 2 and 4 (running it via Docker). On the Pi 2 it was way more visible as said before. This morning I deleted stats and query log databases and cleared cache on both machines. After that, everything normalized.

Here are the stats from both servers gathered from my HomeAssistant, and you can clearly see how if before the machine wasn't always responding (choppy purple data line), after it became normal again.

I want to add that I was having this issue from a while now, since version 0.107.30, but I never tried deleting the databases. However since version 0.107.37 became way more visible on my Raspberry Pi 2 (purple stats).

ghost commented 7 months ago

Hi there, are you still experiencing this?

danieletorelli commented 7 months ago

Hi there, are you still experiencing this?

I reconfigured both my AdguardHome containers to keep the data for 30 days instead of 90. This setting mitigated it for good. But I think the code could be still optimized to be less IO-intensive (e.g. database support instead of writing/querying from files).

HVR88 commented 6 months ago

Version: v0.107.48 - Router is Eero 6 Pro x3, testing only wired connections, all 1Gbe

I had my Pi Zero 2 W set to 90 days and every hour or two DNS would stall out, leaving me unable to even connect to the Adguard Home web UI. At first I thought it was the flooding of reverse lookups, but trying to resolve that didn't help.

I've set to 24 hours and 30 days for query log rotation and stats retention respectively. I still see the web UI popping network errors every now and then when I try to perform actions like enable/disable shortly after loading it up.

I don't recall any such issues when running on docker on my multi-Xeon rack server, so I'm thinking this is the RPi underperforming for the task.

The difference in speed of bringing up pretty much any site, is night and day when comparing the slow down of using Adguard Home vs. not, on this RPi HW setup.

overwatch3560 commented 6 months ago

Is this still an issue @finBitorg with the latest version ?