Websites and services loading too slowly, if they load at all

Expected Behaviour:

I should not notice big differences on internet usage.

Actual Behaviour:

Almost every website I open is pretty laggy to load. Many aren't loading at all.
Throughout the day, some apps and services get randomly disconnected, such as Slack, Telegram or WhatsApp.
When disconnected, my network shows an '?' mark. This happens on PC (Ubuntu 20 and Windows 10) and Mobile (2 devices with latest android).
This disconnection lasts for a couple of minutes usually. Sometimes just refreshing the page of a "Unkown host" website will make it load again.

If I remove Pi-Hole, I don't have any kind of issues.

Debug Token:

https://tricorder.pi-hole.net/hyy51roekh

Your debug log looks normal as far as configuration is concerned, but there are a few lines in your logs that don't fit that configuration:

*** [ DIAGNOSING ]: contents of /var/log/lighttpd

-rw-r--r-- 1 www-data www-data 6174 Mar 15 16:20 /var/log/lighttpd/error.log
   -----head of error.log------
   2021-03-14 16:10:44: (server.c.2059) server stopped by UID = 0 PID = 1 
   2021-03-14 16:10:45: (server.c.1464) server started (lighttpd/1.4.53) 
   2021-03-14 16:42:21: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning:  Executing sudo pihole -a setdns "1.1.1.1,1.0.0.1" domain-needed bogus-priv no-dnssec failed. in /var/www/html/admin/scripts/pi-hole/php/func.php on line 79
   2021-03-14 16:43:49: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning:  Executing sudo pihole -a setdns "192.168.1.2\#5335" domain-needed bogus-priv no-dnssec failed. in /var/www/html/admin/scripts/pi-hole/php/func.php on line 79
   2021-03-14 16:43:53: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning:  SQLite3::query(): Unable to prepare statement: 8, attempt to write a readonly database in /var/www/html/admin/api_db.php on line 401
   2021-03-14 16:43:56: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning:  SQLite3::query(): Unable to prepare statement: 8, attempt to write a readonly database in /var/www/html/admin/api_db.php on line 401
   2021-03-14 19:17:16: (server.c.1464) server started (lighttpd/1.4.53) 
   -----tail of error.log------
   2021-03-15 13:21:04: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning:  Executing sudo pihole -a setdns "1.1.1.1,1.0.0.1" domain-needed bogus-priv no-dnssec failed. in /var/www/html/admin/scripts/pi-hole/php/func.php on line 79
   2021-03-15 13:21:11: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning:  SQLite3::query(): Unable to prepare statement: 8, attempt to write a readonly database in /var/www/html/admin/api_db.php on line 401
   2021-03-15 13:21:16: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning:  SQLite3::query(): Unable to prepare statement: 8, attempt to write a readonly database in /var/www/html/admin/api_db.php on line 401
   2021-03-15 15:56:35: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning:  Executing sudo pihole -a enabledhcp 192.168.1.3 192.168.1.254 192.168.1.1 24 lan true true failed. in /var/www/html/admin/scripts/pi-hole/php/func.php on line 79
   2021-03-15 15:56:39: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning:  SQLite3::query(): Unable to prepare statement: 8, attempt to write a readonly database in /var/www/html/admin/api_db.php on line 401
   2021-03-15 15:56:41: (mod_fastcgi.c.421) FastCGI-stderr: PHP Warning:  SQLite3::query(): Unable to prepare statement: 8, attempt to write a readonly database in /var/www/html/admin/api_db.php on line 401

Did you try to enable Pi-hole's DHCP server lately, or to use a local DNS proxy or server like unbound? Were those options active when you observed your slowdowns?

During an observed slowdown, what's the output of the following commands from a client:

nslookup pi.hole
nslookup flurry.com

Also, please check the DNS servers reported to be in use by a client, e.g by checking the DNS server section from the output of the following command on your Win10 machine:

ipconfig /all

Did you try to enable Pi-hole's DHCP server lately, or to use a local DNS proxy or server like unbound?

I did. I'm trying to use Pihole's DHCP at the moment. I tried to use unbound as per pihole's guide, but when I noticed the slowdowns I uninstalled it and used Cloudflare instead.

Also, please check the DNS servers reported to be in use by a client, e.g by checking the DNS server section from the output of the following command on your Win10 machine:

I did it from my Ubuntu machine through cat /etc/resolv.conf, it displays:

nameserver 127.0.0.53
options edns0 trust-ad
search lan

During an observed slowdown, what's the output of the following commands from a client:

leonardo@leonardo:~$ nslookup pi.hole
Server:		127.0.0.53
Address:	127.0.0.53#53

** server can't find pi.hole: SERVFAIL

leonardo@leonardo:~$ nslookup flurry.com
Server:		127.0.0.53
Address:	127.0.0.53#53

** server can't find flurry.com: SERVFAIL

leonardo@leonardo:~$ nslookup pi.hole
;; connection timed out; no servers could be reached


leonardo@leonardo:~$ nslookup flurry.com
Server:		127.0.0.53
Address:	127.0.0.53#53

** server can't find flurry.com: SERVFAIL

Recent Ubuntu is using systemd-resolved as a local dns caching resolver, which makes checking /etc/resolv.conf for an Ubuntu machine's upstream DSN pointless. It always shows a localhost address.
Try systemd-resolve --status or cat /run/systemd/resolve/resolv.conf instead, or use the command supplied above for Win10.

Were your nslookups all run during a slowdown?
I'm asking because you seem to have run them twice, and results differ:
In your second set, it was Ubuntu's local dns resolver that failed to answer nslookup pi.hole.

What is Pi-hole's status during a slowdown?
Check on your Pi-hole machine by running:

pihole status
sudo systemctl status --full --no-pager pihole-FTL.service

Also, roughly how many queries is Pi-hole registering during such a slowdown (if any)?

systemd-resolve --status:

Global
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa
                      18.172.in-addr.arpa
                      19.172.in-addr.arpa
                      20.172.in-addr.arpa
                      21.172.in-addr.arpa
                      22.172.in-addr.arpa
                      23.172.in-addr.arpa
                      24.172.in-addr.arpa
                      25.172.in-addr.arpa
                      26.172.in-addr.arpa
                      27.172.in-addr.arpa
                      28.172.in-addr.arpa
                      29.172.in-addr.arpa
                      30.172.in-addr.arpa
                      31.172.in-addr.arpa
                      corp
                      d.f.ip6.arpa
                      home
                      internal
                      intranet
                      lan
                      local
                      private
                      test

Link 5 (br-1f82080eeffd)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 4 (docker0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 3 (wlp2s0)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 192.168.1.2
          DNS Domain: ~.
                      local

Link 2 (enp1s0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Were your nslookups all run during a slowdown?

Yes. I executed every lookup twice.

When not during this outage period, the logs are

leonardo@leonardo:~$ nslookup pi.hole
Server:		127.0.0.53
Address:	127.0.0.53#53

Non-authoritative answer:
Name:	pi.hole
Address: 192.168.1.2

leonardo@leonardo:~$ nslookup flurry.com
Server:		127.0.0.53
Address:	127.0.0.53#53

Non-authoritative answer:
Name:	flurry.com
Address: 0.0.0.0
Name:	flurry.com
Address: ::

What is Pi-hole's status during a slowdown?

I usually keep an SSH open to the Raspberry running pihole, and I always run pihole status to check why I can't access the internet. The status is usually positive, although sometimes it takes a while (2~ seconds) to print the status to the console

pi@raspberrypi:~ $ pihole status
  [✓] DNS service is listening
     [✓] UDP (IPv4)
     [✓] TCP (IPv4)
     [✓] UDP (IPv6)
     [✓] TCP (IPv6)

  [✓] Pi-hole blocking is enabled

Also, roughly how many queries is Pi-hole registering during such a slowdown (if any)?

I checked a 15 minute period which included a minute of outage and it reported 683 queries. I'll try to refine this further

Should I disable DHCP and try DHCP from my router for a while?

Probably not.
Unless you have any indication that DHCP would be involved?

Thanks.
This shows that your Ubuntu would just use your Pi-hole for DNS, presuming that 192.168.1.2 is your Pi-hole's IP.
Just for completeness, could you share cat /run/systemd/resolve/resolv.conf as well?

Maybe not directly related, but you should avoid using local as your local domain name. That domain is reserved for the mDNS protocol and should not be used with DNS.

Your nslookups show that DNS queries either fail with SERVFAIL (a valid DNS answer indicating a problem with an upstream DNS server) or Ubuntu's local resolver is failing to accept and deliver the query to Pi-hole.

As Ubuntu is using a local resolver before forwarding requests to Pi-hole, it remains unclear whether SERVFAIL was reported back by one of Pi-hole's upstreams or by Pi-hole itself. You could try to correlate that with Pi-hole's Query Log at that time.

For future tests, direct your nslookups directly at Pi-hole, e.g.:

nslookup flurry.com 192.168.1.2

When querying through nslookup flurry.com 192.168.1.2 I don't get any failures during slowdown periods. Neither for pi.hole nor for flurry.

I'll run
while true; do date >> test.txt; nslookup pi.hole 192.168.1.2 >> test.txt; nslookup flurry.com 192.168.1.2 >> test.txt; sleep 3; done

for a while and see if anything pops up

cat /run/systemd/resolve/resolv.conf:

nameserver 192.168.1.2
nameserver 2804:431:cfe0:6c3c:fda7:43d:28e8:1f91

That would imply that Pi-hole is fully operational and responsive while you observe clients slowing down. A bit of a stretch to find out about this, partly due to Ubuntu hiding some important details from us.

If Pi-hole is responsive, it's either Ubuntu's systemd-resolved that isn't (unlikely), or yet another DNS server is involved and doesn't play along.

Thank you for supplying that output.
It reveals another DNS server employed by your Ubuntu machine.

What device in your network owns that IPv6 address?

You could cross check that with your Pi-hole's IPv6 addresses by running the following command on your Pi-hole machine:

ip -6 address show

What device in your network owns that IPv6 address?

It was my router's. I disabled IPV6, now I only get nameserver 192.168.1.2, but failures continue

A thing I noticed is that eventually Pihole-FTL is showing red, and pihole status shows that DNS service is not listening. I must then manually pihole restartdns or wait sometime when it gets back up. Pihole-FTL.log contains no errors. Where else can I look to see why it crashed? Could it be related?

Look in /var/log/syslog and at the output of dmesg

Good, as your clients were able to by-pass Pi-hole via IPv6.
For the time being, leaving IPv6 disabled may make analysis easier.

You still may want to consult your router's documentation for later.
It may support to discontinue advertising its own IPv6 as DNS server.

That's puzzling.
Your above findings are contradictory.
Only one can be true at a given time: Either Pi-hole is operational or it isn't.

In addition to jfb's advice, as you've changed your network by disabling IPv6, could you also post a new debug token, please?

Absolutely.

I re-enabled the DHCP server for both IPV4 and IPV6. IP assignment is ok, so I think it's correctly setup.

Debug Token: https://tricorder.pi-hole.net/uu8p8c2zmi
The slowdown period still happen, but they seem to last less now.

One thing I tried to analyze was that when slowness happen, I see the following calls from ipv6:

Why would it make these queries to .lan? it seems to do that every once in a while for every domain I access at that period

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.