Slow page loading with AdGuardHome

Hi MGA: i am using your wonderful software on rpi4. i am really liking its efficiency and simplicity. I started encountering a problem after few days of setting Adguardhome. The pages become less responsive and take more time to open up as compared to fresh installation.
Is it a known fact ? is it related to cache settings ?

Any way to keep it always snappier ?

a pi isnt ideal as a router due to only single lan port. How much memory has your pi got?

I originally started out using AGH on a bt hub 5 which only had 128mb of ram and just 2 little mips cores. It managed but only as long as you did not use too many lists as it would out of memory with too many.

its a matter of not overloading your router's resources. And that is a "how long is a piece of string" question. The way I figured out resource usage was to start with basic lists then slowly add more till I started getting memory issues or CPU maxing out. Then roll back till it managed better.

i have 4gb Ram on the RPi4, most of the time 99% of it is free. So i dont think its a bottle necck issue for my Rpi4 to deal with it.
may be something else is playing a crucial part. How much cache memory inside AGH do you recommend as ideal ?

1 Like

I left those as defaults. May be worth installing monitoring software so you can see what resources are being used up and reducing your speeds.

I used a local grafana instance for monitoring my pi (it runs my plex and some other services)

Also map out your network. Does your pi run AGH as a separate DNS resource? or does it handle your internet connection too? You may need to customise your networking queues to spread loading. I assume you are running OpenWrt on your Pi? or are you running another linux distribution?

https://openwrt.org/toh/friendlyarm/nanopi_r4s_v1#cpu_management - This explains how to shift interrupt queues around. you may have to experiment to determine the Pi's queues and cpus. (I remember it being possible using pi software but that was running raspbian and is kinda getting off topic)

Hi i have trouble blocking ads even after installing and setting up Adguardhome on Rpi4 . I am using only crowdsec and AGH on freshly installed Openwrt.
What could be the reason for inefficient adblocking ? Is it because i enabled dhcp server in AGH ??

  • is dnsmasq in the picture?
  • does service restarts help?
  • does reboot help?

Yes i did service restart and also rebooted Rpi4... But no use. I think its probably related to dhcp server in AGH. I have dhcp server enabled in my isp router and also in AGH. Can it be the reason for failure to Adblocking ?

1 Like

yes.

only one DHCP server can run on a network. Either set your dns on your isp server to point to your AGH or disable isp dhcp and set the isp router to be the gateway for your AGH dhcp.

If i disable isp dhcp, then i dont have internet only, i mean internet breaks. I choose specific dns (ip address of Rpi4) and swutch off the isp dhcp to enable AGH Dhcp work normally ?
Should i also use ipv6 address format in dns and hists settings in addition to AGH address ?( in my case it is 192.168.2.100#5353) ??

if you can change the DNS that is handed out by your ISP dhcp to the dns of the pi then that should be all you need. Then reboot everything inside your Lan to take the new settings (or release/renew)

That way your clients will use your Pi as DNS lookups not your ISP router. Thus adblocking works.

So for instance if your ISP router is like below? you change the DNS server to 192.168.2.100 (or whatever your pi is) But you should really make sure your Pi has a fixed Static address and doesnt just get a dhcp from your router.

   Default Gateway . . . . . . . . . : 192.168.1.1
   DHCP Server . . . . . . . . . . . : 192.168.1.1
   DNS Servers . . . . . . . . . . . : 192.168.1.1
1 Like

i tried every suggestions you gave, but even then i am not ablle to get rid off of ads on the website. i will try to post here all of my settings from AGH to ISP Router. So that somewhere else lies a problem which you could see...













Incase if you need any more settings pic, pls let me know, i am fed up of searching the reason for not getting an ad blocked in the website. Previously(i mean before 3 daays for example) the Rpi4 Openwrt with Crowdsec and AGH was blocking the ads properly. i dont know what i did for this setup now. no matter how many times i reinstall or reboot, ads will appear... i need an help pls.

(edit - I misread the pics.)

Lets try again.

Your DHCP page. can you expand all the options?

What you are looking for is a DNS setting for your DHCP. When i looked quickly at your first pictures i thought the DNS was wrong there. But thats the DNS for your WAN connection (your ISP side) not your LAN (home) side. Thats the setting that needs putting to your AGH install on the pi.

(edit2)

Acutally i have another question. Why is your main router 192.168.2.1 but your upstream DNS set to 192.168.1.1

What is your actual network layout? something is not right here.

Hi, sorry for late reply.
I have my isp router ip address as 192.168.2.1
My Rpi4 Openwrt has a default ip address of 192.168.1.1
When i installed AGH, it took 192.168.2.100 as its default address.
What should i change now or make changes so that there wont be any network conflicts and the adblocking of AGH works ???
One more thing previously when i installed AGH , it used to work by default. Now only adblocking is nit working...

set your pi to 192.168.2.2 and set the dns accordingly. Its your netmask that is screwing you over.

Your dhcp only knows about 192.168.2.x network. Another way to fix it would be to add a route but its far simplier to put your PI in your 192.168.2.x network on a fixed ip.

basically .2.x is your house. .1.x is next door. it cant hear you asking for DNS. when your AGH was .2.100 it worked cos it was in the same "house"

1 Like

How do i do it simply ?
After doing that should i put pi ip address as primary dns server in my isp router or the AGH ip ?
One more thing dhcp server range can be from 192.168.2.100 or it should be 192.168.2.3 ?
Thanks in advance

your dhcp is offering a range between 100-199. your actual subnet will be 192.168.2.1-254. you can pick an address anywhere in that range (because dhcp will check to see if an ip is being used before handing one out) but its common networking practise to put servers up the "top" end of a range along with routers and then offer the rest of the range to clients via dhcp. Have a google of basic networking and subnets.

you need to make your pi have an address in your 192.168.2.x range. i suggest .2 because its right after your router and makes things easy. then change the DHCP dns 192.168.1.1 to 192.168.2.2 and things should work nicely. your WAN DNS should be either set to your ISP DNS or to a public one like cloudflare or google. (this is so your router can do dns queries and get time updates when it boots. Your PI DNS is separate to that and handles your clients and adblocking that way.)

Hi, i tried to change the IP Address of Pi as per your instructions.. but i cant change the LAN ip address to 192.168.2.2. In Interface option i see eth1 ip address as 192.168.2.2/24(DHCP) but LAN ip as 192.168.1.1(static).
What did you mean exactly to change the ip of Pi ? is it LAN or eth1 ?

You said you are running OpenWrt on your pi? https://openwrt.org/docs/guide-user/network/openwrt_as_routerdevice

uci set network.lan.ipaddr="192.168.2.2"
uci commit network
/etc/init.d/network restart

Network > Interfaces > Lan - is where you change it on luci interface

Hi, i did exactly as you said, but its not changing the LAN ip address. Instead WAN(eth1) ip Address has changed to 192.168.2.2

now what should i do ?

ahh. ok. DELETE your WAN interface. you dont need it (as you are using it as a server not a router.)

Now edit your LAN interface and set it to 192.168.2.2. Change its IPv6 to ::2 at end as well instead of ::1 that will set your pi to be .2 on both IPv4 and v6.

Then your ISP router needs to hand out the pi's new IPv4 and v6 addresses as DHCP DNS servers then it should all work.

your WAN side on the isp should have your isp DNS addres or google or any other public DNS as its upstream.

your LAN/DHCP needs to hand out the PI for DNS. Then your adblocking will work as all your clients on the LAN will talk to the pi rather than upstream to your isp.