Long-term load (15min avg) larger than number of processors: 1.3 > 1 This may slow down DNS resolution and can cause bottlenecks

Top of the list is pihole /usr/bin/pihole-FTL

Your router is distributing its own IP as DNS server alongside Pi-hole's:

*** [ DIAGNOSING ]: Discovering active DHCP servers (takes 10 seconds)
   Scanning all your interfaces for DHCP servers
   
   * Received 300 bytes from eth0:192.168.2.1
     Offered IP address: 192.168.2.51
     Server IP address: 192.168.2.1
     DHCP options:
      Message type: DHCPOFFER (2)
      dns-server: 192.168.2.51
      dns-server: 192.168.2.1
      router: 192.168.2.1

This will allow clients to by-pass Pi-hole using your router instead.
Pi-hole has to be the sole DNS server for your clients.

Also, your debug log shows your database to be read-only

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

-rw-r--r-- 1 www-data www-data 3.0K Jul  2 19:23 /var/log/lighttpd/error.log
   -----head of error.log------
   2022-07-01 23:07:34: server.c.1513) server started (lighttpd/1.4.59)
   2022-07-01 23:10:27: server.c.1976) server stopped by UID = 0 PID = 1
   2022-07-01 23:10:28: server.c.1513) server started (lighttpd/1.4.59)
   2022-07-01 23:17:20: server.c.1976) server stopped by UID = 0 PID = 1
   2022-07-01 23:18:33: server.c.1513) server started (lighttpd/1.4.59)
   2022-07-01 23:37:30: mod_fastcgi.c.487) FastCGI-stderr:PHP Warning:  SQLite3::query(): Unable to prepare statement: 5, database is locked in /var/www/html/admin/api_db.php on line 392
   2022-07-01 23:37:40: mod_fastcgi.c.487) FastCGI-stderr:PHP Warning:  SQLite3::query(): Unable to prepare statement: 5, database is locked in /var/www/html/admin/api_db.php on line 392
   2022-07-02 10:25:04: server.c.1976) server stopped by UID = 0 PID = 1
   2022-07-02 10:26:43: server.c.1513) server started (lighttpd/1.4.59)
   2022-07-02 10:52:57: server.c.1976) server stopped by UID = 0 PID = 1
   2022-07-02 10:54:23: server.c.1513) server started (lighttpd/1.4.59)
   2022-07-02 19:01:19: server.c.1976) server stopped by UID = 0 PID = 1
   2022-07-02 19:01:21: server.c.1513) server started (lighttpd/1.4.59)
   2022-07-02 19:22:11: mod_fastcgi.c.487) FastCGI-stderr:PHP Warning:  Executing sudo pihole -a setdns "8.8.8.8,8.8.4.4,84.200.69.80,84.200.70.40" domain-needed bogus-priv no-dnssec failed. in /var/www/html/admin/scripts/pi-hole/php/func.php on line 150
   2022-07-02 19:22:14: mod_fastcgi.c.487) 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 392

Run from your Pi-hole host machine, what's the output of:

pihole-FTL sqlite3 pihole-FTL.db "PRAGMA integrity_check"
pihole-FTL sqlite3 gravity.db "PRAGMA integrity_check"

Hello, I've made sure now that the pi hole is the sole DNS. And running both of them checks, the results say ok

Occasional long term load averages greater than one typically will have zero performance impact on your Pi-hole.

There are certain processor-intensive activities that will occasionally stress your CPU Rebuilding gravity (particularly with a large number of adlists), updates and repairs, etc.

With the slight CPU "overload" you are seeing, I would not be concerned.

Here is a good sicussion of Linux loads.

That is a relatively low capability device. It is plenty powerful to run Pi-hole (I have three running), but when you get to processor intensive tasks, the relatively limited CPU becomes a short term bottleneck.

It would help us to see the entire list.

With a low power CPU like the Zero, it is not unusual to get CPU demand spikes. Here are the loads on a Zero W (connected via WiFi) after a few routine system activities. At the start, the Pi was just sitting doing its thing processing DNS queries. As we stress the CPU, you can see the 5 minute and 15 minute load averages increase accordingly:

pi@Pi-ZeroW-dev:~ $ uptime
 14:02:55 up 34 days, 25 min,  1 user,  load average: 0.32, 0.21, 0.16
pi@Pi-ZeroW-dev:~ $ sudo apt update
Get:1 http://archive.raspberrypi.org/debian bullseye InRelease [23.7 kB]           
Get:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease [15.0 kB]
Get:3 http://archive.raspberrypi.org/debian bullseye/main armhf Packages [289 kB]
Get:4 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages [13.2 MB]
Fetched 13.6 MB in 26s (517 kB/s)                                                                                                                                                                                                              
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
13 packages can be upgraded. Run 'apt list --upgradable' to see them.
pi@Pi-ZeroW-dev:~ $ uptime
 14:03:56 up 34 days, 26 min,  1 user,  load average: 1.29, 0.48, 0.26
pi@Pi-ZeroW-dev:~ $ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv libssl1.1 openssl
13 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 9,672 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.raspberrypi.org/debian bullseye/main armhf libssl1.1 armhf 1.1.1n-0+deb11u3+rpt1 [1,292 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf gnupg-l10n all 2.2.27-2+deb11u2 [1,086 kB]
Get:3 http://archive.raspberrypi.org/debian bullseye/main armhf openssl armhf 1.1.1n-0+deb11u3+rpt1 [817 kB]
Get:4 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf gnupg-utils armhf 2.2.27-2+deb11u2 [797 kB]
Get:5 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf gpgconf armhf 2.2.27-2+deb11u2 [525 kB]
Get:6 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf dirmngr armhf 2.2.27-2+deb11u2 [706 kB]
Get:7 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf gpg armhf 2.2.27-2+deb11u2 [826 kB]
Get:8 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf gpg-agent armhf 2.2.27-2+deb11u2 [616 kB]
Get:9 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf gpg-wks-client armhf 2.2.27-2+deb11u2 [503 kB]                                                                                                                              
Get:10 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf gpg-wks-server armhf 2.2.27-2+deb11u2 [498 kB]                                                                                                                             
Get:11 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf gpgv armhf 2.2.27-2+deb11u2 [582 kB]                                                                                                                                       
Get:12 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf gpgsm armhf 2.2.27-2+deb11u2 [600 kB]                                                                                                                                      
Get:13 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf gnupg all 2.2.27-2+deb11u2 [825 kB]                                                                                                                                        
Fetched 9,672 kB in 12s (794 kB/s)                                                                                                                                                                                                             
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 42218 files and directories currently installed.)
Preparing to unpack .../gnupg-l10n_2.2.27-2+deb11u2_all.deb ...
Unpacking gnupg-l10n (2.2.27-2+deb11u2) over (2.2.27-2+deb11u1) ...
Setting up gnupg-l10n (2.2.27-2+deb11u2) ...
(Reading database ... 42218 files and directories currently installed.)
Preparing to unpack .../gnupg-utils_2.2.27-2+deb11u2_armhf.deb ...
Unpacking gnupg-utils (2.2.27-2+deb11u2) over (2.2.27-2+deb11u1) ...
Setting up gnupg-utils (2.2.27-2+deb11u2) ...
(Reading database ... 42218 files and directories currently installed.)
Preparing to unpack .../gpgconf_2.2.27-2+deb11u2_armhf.deb ...
Unpacking gpgconf (2.2.27-2+deb11u2) over (2.2.27-2+deb11u1) ...
Setting up gpgconf (2.2.27-2+deb11u2) ...
(Reading database ... 42218 files and directories currently installed.)
Preparing to unpack .../dirmngr_2.2.27-2+deb11u2_armhf.deb ...
Unpacking dirmngr (2.2.27-2+deb11u2) over (2.2.27-2+deb11u1) ...
Setting up dirmngr (2.2.27-2+deb11u2) ...
(Reading database ... 42218 files and directories currently installed.)
Preparing to unpack .../gpg_2.2.27-2+deb11u2_armhf.deb ...
Unpacking gpg (2.2.27-2+deb11u2) over (2.2.27-2+deb11u1) ...
Setting up gpg (2.2.27-2+deb11u2) ...
(Reading database ... 42218 files and directories currently installed.)
Preparing to unpack .../gpg-agent_2.2.27-2+deb11u2_armhf.deb ...
Unpacking gpg-agent (2.2.27-2+deb11u2) over (2.2.27-2+deb11u1) ...
Setting up gpg-agent (2.2.27-2+deb11u2) ...
(Reading database ... 42218 files and directories currently installed.)
Preparing to unpack .../gpg-wks-client_2.2.27-2+deb11u2_armhf.deb ...
Unpacking gpg-wks-client (2.2.27-2+deb11u2) over (2.2.27-2+deb11u1) ...
Setting up gpg-wks-client (2.2.27-2+deb11u2) ...
(Reading database ... 42218 files and directories currently installed.)
Preparing to unpack .../gpg-wks-server_2.2.27-2+deb11u2_armhf.deb ...
Unpacking gpg-wks-server (2.2.27-2+deb11u2) over (2.2.27-2+deb11u1) ...
Setting up gpg-wks-server (2.2.27-2+deb11u2) ...
(Reading database ... 42218 files and directories currently installed.)
Preparing to unpack .../gpgv_2.2.27-2+deb11u2_armhf.deb ...
Unpacking gpgv (2.2.27-2+deb11u2) over (2.2.27-2+deb11u1) ...
Setting up gpgv (2.2.27-2+deb11u2) ...
(Reading database ... 42218 files and directories currently installed.)
Preparing to unpack .../gpgsm_2.2.27-2+deb11u2_armhf.deb ...
Unpacking gpgsm (2.2.27-2+deb11u2) over (2.2.27-2+deb11u1) ...
Setting up gpgsm (2.2.27-2+deb11u2) ...
(Reading database ... 42218 files and directories currently installed.)
Preparing to unpack .../gnupg_2.2.27-2+deb11u2_all.deb ...
Unpacking gnupg (2.2.27-2+deb11u2) over (2.2.27-2+deb11u1) ...
Setting up gnupg (2.2.27-2+deb11u2) ...
(Reading database ... 42218 files and directories currently installed.)
Preparing to unpack .../libssl1.1_1.1.1n-0+deb11u3+rpt1_armhf.deb ...
Unpacking libssl1.1:armhf (1.1.1n-0+deb11u3+rpt1) over (1.1.1n-0+deb11u2+rpt1) ...
Setting up libssl1.1:armhf (1.1.1n-0+deb11u3+rpt1) ...
(Reading database ... 42218 files and directories currently installed.)
Preparing to unpack .../openssl_1.1.1n-0+deb11u3+rpt1_armhf.deb ...
Unpacking openssl (1.1.1n-0+deb11u3+rpt1) over (1.1.1n-0+deb11u2+rpt1) ...
Setting up openssl (1.1.1n-0+deb11u3+rpt1) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for install-info (6.7.0.dfsg.2-6) ...
Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u2) ...
pi@Pi-ZeroW-dev:~ $ uptime
 14:05:40 up 34 days, 28 min,  1 user,  load average: 1.34, 0.74, 0.38
pi@Pi-ZeroW-dev:~ $ pihole -g -f
  [✓] Deleting existing list cache
  [i] Neutrino emissions detected...
  [✓] Pulling blocklist source list into range

  [✓] Preparing new gravity database
  [i] Using libz compression

  [i] Target: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
  [✓] Status: Retrieval successful
  [i] Analyzed 122102 domains

  [i] Target: https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt
  [✓] Status: Retrieval successful
  [i] Analyzed 420719 domains

  [✓] Creating new gravity databases
  [✓] Storing downloaded domains in new gravity database
  [✓] Building tree
  [✓] Swapping databases
  [✓] The old database remains available.
  [i] Number of gravity domains: 542821 (534031 unique domains)
  [i] Number of exact blacklisted domains: 4
  [i] Number of regex blacklist filters: 25
  [i] Number of exact whitelisted domains: 17
  [i] Number of regex whitelist filters: 0
  [✓] Flushing DNS cache
  [✓] Cleaning up stray matter

  [✓] FTL is listening on port 53
     [✓] UDP (IPv4)
     [✓] TCP (IPv4)
     [✓] UDP (IPv6)
     [✓] TCP (IPv6)

  [✓] Pi-hole blocking is enabled
pi@Pi-ZeroW-dev:~ $ uptime
 14:07:46 up 34 days, 30 min,  1 user,  load average: 1.33, 0.98, 0.52

Then, 5 minutes later the load averages are dropping, reflecting the reduced CPU load for the past 5 minutes:

pi@Pi-ZeroW-dev:~ $ uptime
 14:12:37 up 34 days, 35 min,  1 user,  load average: 0.02, 0.39, 0.38

also here is recent debug https://tricorder.pi-hole.net/63ep1qlb/

20:25:22 up 43 min, 2 users, load average: 1.90, 1.09, 0.92

In your screen shot, Pi-hole is using 1.3% CPU - virtually none. And the load averages were lower than reported by uptime 2 minutes later.

I wouldn't worry about this, assuming your DNS performance is good.

You do have a Pi-hole option to not perform load checks.

https://docs.pi-hole.net/ftldns/configfile/#check_load

That debug log still shows both Pi-hole as well as your router as DNS server:

*** [ DIAGNOSING ]: Discovering active DHCP servers (takes 10 seconds)
   Scanning all your interfaces for DHCP servers
   
   * Received 300 bytes from eth0:192.168.2.1
     Offered IP address: 192.168.2.51
     DHCP options:
      Message type: DHCPOFFER (2)
      dns-server: 192.168.2.51
      dns-server: 192.168.2.1
      router: 192.168.2.1
      --- end of options ---
    
   DHCP packets received on interface eth0: 1
   DHCP packets received on interface lo: 0

ive changed dns setting on asus router, to the ip address of pihole. im lost to as why this keeps happening

Long story short, you cant advertise the Pi-hole IP as the only DNS server for your clients via DHCP with the stock Asus firmware.
Safest solution is to enable Pi-hole's own DHCP service and disable the DHCP service on the Asus router.
Below thread is full of info and alternatives:

I was trying that just before you replied, I've enabled pihole as DHCP, and disabled the router as DHCP. it seems to be all working ok,

https://tricorder.pi-hole.net/7rVM6tTQ/

1 Like

I marked your last reply as a solution if you dont mind?

2 Likes

That's fine, thank you all for your help. Very much appreciated indeed

1 Like

On the server you run pi-hole, just stop the X server. Load drops subztantially, and mt memory has never, ever been lower.

I'm at 37% with less than 640mb ram in a VM and my load levels (blocked domains are constant repeats) are sub 0.8 avg!

Most of us dont run an xserver because we install without a desktop:

pi@ph5b:~ $ apt policy xserver-xorg
xserver-xorg:
  Installed: (none)
2 Likes

For those users that might have configured a desktop at install but no longer use it, what would be the correct command(s) to disable the desktop?

Found below:

pi@ph5b:~ $ man systemd
[..]
       On boot systemd activates the target unit default.target whose job is
       to activate on-boot services and other on-boot units by pulling them
       in via dependencies. Usually, the unit name is just an alias
       (symlink) for either graphical.target (for fully-featured boots into
       the UI) or multi-user.target (for limited console-only boots for use
       in embedded or server environments, or similar; a subset of
       graphical.target). However, it is at the discretion of the
       administrator to configure it as an alias to any other target unit.
       See systemd.special(7) for details about these target units.
pi@ph5b:~ $ man systemctl
[..]
       get-default
           Return the default target to boot into. This returns the
           target unit name default.target is aliased (symlinked) to.

       set-default TARGET
           Set the default target to boot into. This sets (symlinks) the
           default.target alias to the given target unit.

But its confusing bc it says graphical.target instead of multi-user on my Pi without desktop:

pi@ph5b:~ $ systemctl get-default
graphical.target

Out if interest, I switched back and forth successfully just now with above on my Debian laptop with desktop:

dehakkelaar@laptop:~$ sudo systemctl set-default multi-user.target
Created symlink /etc/systemd/system/default.target → /lib/systemd/system/multi-user.target.

dehakkelaar@laptop:~$ sudo reboot

dehakkelaar@laptop:~$ systemctl get-default
multi-user.target
dehakkelaar@laptop:~$ sudo systemctl set-default graphical.target
Removed /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target → /lib/systemd/system/graphical.target.

dehakkelaar@laptop:~$ sudo reboot

dehakkelaar@laptop:~$ systemctl get-default
graphical.target

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