It has been shown that loading 50 or 60 filter lists on a low memory router or appliance is not indicative of a memory leak on adguardhomes part but a lack of memory present in the device. Doing such is enough to bring any low RAM appliance or router to its metaphorical knees. The same would happen with dnsmasq, dnscrypt-proxy, or Unbound on a low memory system. The problem with AdGuardHome is that is designed for multiple platforms, but is not usable across all platforms equally without taking in consideration of the amount of RAM on the physical device it is being ran on. Sure I can load AdGuardHome up on a x86_64 platform with 10gb of ram no problem.The memory constraint is negligible at that point; However, when running Adguardhome on small memory appliance/routers, special considerations need to be taken when choosing filters and blocklists. Otherwise, updating the list may grab more memory than the router has available. Then we switch to swapping, and adguardhome holds onto a greater amount of VSZ memory in anticipation of the next time it may need it for another list upgrade. The makers of AdGuardHome should have more documentation in regards to these nuances, so users don't feel like they are chasing down a memory leak when in fact they are just seeing the impacts of using AdGuardHome with limited RAM availability.AGH has a memory leak problem with blocklist update. Whenever list(s) update happens memory usage skyrockets and stays high until a reboot or a restart of AGH service, it's so annoying. I had to increase filter update interval just to avoid this.
Sure I can load AdGuardHome up on a x86_64 platform with 10gb of ram no problem.
@Tech9 This is exactly what I mean. AdGuardHome has to be utilized adjacent to its setup. See, you have the flexibility to use these filters with no tight memory constraints. No Problems here. It is different firing this up on a router that is already using 70% or more percent of its memory.
I posted here as an FYI, they know the problem, sorry I forgot to add the link:It has been shown that loading 50 or 60 filter lists on a low memory router or appliance is not indicative of a memory leak on adguardhomes part but a lack of memory present in the device. Doing such is enough to bring any low RAM appliance or router to its metaphorical knees. The same would happen with dnsmasq, dnscrypt-proxy, or Unbound on a low memory system. The problem with AdGuardHome is that is designed for multiple platforms, but is not usable across all platforms equally without taking in consideration of the amount of RAM on the physical device it is being ran on. Sure I can load AdGuardHome up on a x86_64 platform with 10gb of ram no problem.The memory constraint is negligible at that point; However, when running Adguardhome on small memory appliance/routers, special considerations need to be taken when choosing filters and blocklists. Otherwise, updating the list may grab more memory than the router has available. Then we switch to swapping, and adguardhome holds onto a greater amount of VSZ memory in anticipation of the next time it may need it for another list upgrade. The makers of AdGuardHome should have more documentation in regards to these nuances, so users don't feel like they are chasing down a memory leak when in fact they are just seeing the impacts of using AdGuardHome with limited RAM availability.
See, you have the flexibility to use these filters with no tight memory constraints. No Problems here.
That's awesome I linked a study I participated in https://github.com/AdguardTeam/AdGuardHome/issues/4437 to your issue tracker. The same "issue", but different people trying to draw the same conclusions.I posted here as an FYI, they know the problem, sorry I forgot to add the link:
High RAM consumption during filter updates · Issue #5606 · AdguardTeam/AdGuardHome
Prerequisites I have checked the Wiki and Discussions and found no answer I have searched other issues and found no duplicates I want to report a bug and not ask a question Operating system type Li...github.com
Pihole with 3.4million domains on an RPI4
I saw this thread and did as advised. However I got very inconsistent results. Sometimes I saw ~300MB free men post startup, other times ~70MBI posted here as an FYI, they know the problem, sorry I forgot to add the link:
High RAM consumption during filter updates · Issue #5606 · AdguardTeam/AdGuardHome
Prerequisites I have checked the Wiki and Discussions and found no answer I have searched other issues and found no duplicates I want to report a bug and not ask a question Operating system type Li...github.com
How big is your blocklist or filter size because this greatly impacts how much memory guzzling adguardhome requires.I saw this thread and did as advised. However I got very inconsistent results. Sometimes I saw ~300MB free men post startup, other times ~70MB.
Now I’m basically forced to schedule reboots (twice a wk) to prevent router freezes from happening. This is on top of env vars + swappiness config
Now I’m basically forced to schedule reboots (twice a wk) to prevent router freezes from happening.
and sometimes not even a full 1GB after all is said and done. Ideally, adguardhome runs best on a device with a minimum of 2gb of RAM. Here is what openwrt says about adguardhomeI did a test run with AGH on AX86U with about 10 lists from the default options in adblocking and security categories and the free RAM was >300MB for a week. If you push extra installed software to the point you need a swap - your router is dead. The swap on USB is mostly useless. You have to understand your router is a RPi with very limited RAM. The RPi4 with Pi-hole example above perhaps has 4GB RAM. Your router has 1GB RAM.
I am sure part of the "runs better" does come from better memory utilization support of the OS as well. Along with low memory foot print.The router is a device with what Asus decided is enough to run Asuswrt on it. I have one GL-MT2500A device running OpenWrt and AGH pre-installed. It has 1GB RAM, but no TrendMicro and Ookla bloatware. I had no time to play with it for long, but quick runs show AGH runs better on it.
#!/bin/sh
# Changeme # Start #
MemoryThreshold=900000 ; # set 900MB threshold
SwapPath=/tmp/mnt/180GB/myswap.swp ; # path of swap file
AGHRestart="/opt/etc/init.d/S99AdGuardHome restart" ; # full path of Adguard Home to restart
# Changeme # End #
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin ; # making sure PATH works
MemoryFree=$(free | awk 'NR==2{print $3}') ; # get live memory
# Check if free memory is less than the threshold
if [[ "$MemoryFree" -lt "$MemoryThreshold" ]]; then
: ; # Threshold is okay. No action needed.
else
$AGHRestart && sleep 60 ; # restart Adguard Home and sleep for a minute
swapoff -a && swapon $SwapPath ; # disable/enable swap
fi
Welcome to the forums @balr0g.
There is no need to do this at all. The router (Linux) does this as it sees fit.
Were you having other issues that this solved? Unused RAM is wasted RAM.
Thanks for the welcome @L&LD ! As a former Solaris/Linux Sysadmin, In general, that is correct. Adguard Home (AGH) running is roughly using 300MB RAM with huge 400K+ rules on my blocklists.Welcome to the forums @balr0g.
There is no need to do this at all. The router (Linux) does this as it sees fit.
Were you having other issues that this solved? Unused RAM is wasted RAM.
To be clear, No restart of router... the script runs everyday @6am via cru If memory used is 900MB+, restart only AGH and disable/enable swap to clear it. It doesn't do anything if it's less than 900MB total memory. Note, my GT-AX6000 has 1GB of RAM. You probably need to change the script upper limit to 400MB if your router has 512MB of RAM.@Kingp1n:
It seems the script only restarts the AGH vs restarting the whole router! I don't think the router automatically restarts AGH when the RAM is high....maybe the whole router restarts but the script would be more convenient correct?
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!