Closed laughtLOOL closed 2 years ago
似乎这个issue类似同样问题. https://github.com/AdguardTeam/AdGuardHome/issues/4437 高CPU占用大概率是内存不足使用swap的锅
我在用 opwnwrt 版 adguardhome, 然后规则文件也有点多大概在80个左右,自定义规则也有许多,版本为 107.2-107.7,从路径看规则文件大小是3-400MB,我也不记得了,我是在arm 版的设备 r2s 发现这个问题的,它只有1g ram, 我在x86设备也成功复现这个问题, 当adguardhome启动已经完成时,dns 拦截列表全部加载完成,修改/添加自定义过滤规则就会触发这个问题导致内存溢出然后死机,并且cpu也会变成高负载状态。我开启adguardhome的平时占用是这样子的,原本我只分配了800m的ram给adguardhome使用,但是现在只能增大ram使用
建议翻译为英文, ADH的维护者可能看不懂中文.
[TRANSLATION] Titile: Too much Memory Consumption after specific operation Causing System Crashed - Memory Leak? Details I have ADH run on NanoPi R2S Router(1GiB RAM version) , which is ARM device with OpenWRT system, and the version of ADH varied from 107.2 to 107.7. I added many DNS blocklists, about 80 ones, the files for these rules take up about 400MB of disk space. I also added many custom filtering rules.
After I noticed this problem on my R2S, I began to investigate the reason causing memory leak.
When the ADH has been started and the blocklists fully loaded, the memory usage is still normal.
But the time when I modifying/adding custom filtering rules , I notice a sharp increase in ADH's memory usage. The system will also come into a high high load average status with high CPU usage. If the memory is insufficient, the CPU usage will reach 99%, and the system will even crash.
I also reproduced this problem on x86 device.
The execution logic seems like this: firstly copy all new rules to RAM, and then remove the old ones to free memory.
This is due to device performance and has nothing to do with AdGuardHome. In addition, the more rule files are not the better, it can even be said that in most cases the more, the worse, that would just lead to a lot of false interceptions and a high memory usage. Therefore, the things you can do now:
I have to say again that 80 rule files are too many, which will lead to a lot of false interception, and high memory usage is completely normal. Consider whether you really need them, and if so, you probably need a more powerful device.
no worry,I just report this issue, false interceptions I can easy to solve or Temporarily ignore, I Tring to reduce not using rule link I know some rule was not useful, but I cant see all rule for the Utilization. So not to delate it, if the device only 1 gigabyte ram, I will clear the normal using not larger that 500mb
我在用 opwnwrt 版 adguardhome, 然后规则文件也有点多大概在80个左右,自定义规则也有许多,版本为 107.2-107.7,从路径看规则文件大小是3-400MB,我也不记得了,我是在arm 版的设备 r2s 发现这个问题的,它只有1g ram, 我在x86设备也成功复现这个问题, 当adguardhome启动已经完成时,dns 拦截列表全部加载完成,修改/添加自定义过滤规则就会触发这个问题导致内存溢出然后死机,并且cpu也会变成高负载状态。我开启adguardhome的平时占用是这样子的,原本我只分配了800m的ram给adguardhome使用,但是现在只能增大ram使用 当修改的时候会急剧使用ram, 内存不够cpu就会占用99然后死机然后cpu一直处在7-90的区间。 求解决这个问题,这个逻辑像是在复制全部的规则创建新的在ram,然后删除旧规则,然后再从ram移动到硬盘里然后释放内存,使得修改变得困难