swisstech.net

tech and photography

PiHole full disk causing mayhem

2025-11-10

I’ve been struggling with slow DNS and long load times. After a lot of back and forth it turns out, it was DNS. Replugging everything in the server didn’t help, restarting switches, routers etc. didn’t help.

So somehow, the pihole FTL DB at /etc/pihole/pihole-FTL.db seems to only grow and never shrink. There are settings to limit the number of days entries are kept in the DB but the file still just keeps on getting bigger.

Once there is no disk space left, the pihole-FTL process starts consuming 100% CPU and DNS queries start to time out even though everything else is working just fine.

My solution to prevent this from happening, is a small crontab entry to call sqlite’s VACUUM command, which cleans up all the garbage that has been deleted from the db but is still in the file.

1
20 4 * * * root service pihole-FTL stop; sqlite3 /etc/pihole/pihole-FTL.db "VACUUM;"; service pihole-FTL start

Update - 2 days later

It became clear pretty quickly, that the above wasn’t really the solution. The situation did improve a little, but not by much. I shouldn’t be running out of disk space anymore, but pihole-FTL was still hogging CPU so I tried a few more things:

First, I deleted the FTL db altogether, restarted pihole and still… better but far from good.

Then, I also tried updating pihole again, using the update script (my pihole was set up using the incredible tteck scripts for Proxmox). I noticed, that my pihole was still using the old url, so i switched the update script to the new one and ran update again - the only difference now was, that a few system packages were updated. Acoording to dpkg.log these were:

  • openssl
  • libxslt1
  • bind9-libs
  • bind9-dnsutils
  • bind9-host
  • libssl3t64

This did actually improve the situation to a degree. As I keep an eye on my pihole container using the command below. Now I only see intermittent phases, where the pihole-FTL process uses 100% CPU. But during these moments, all internet browsing basically crawls to a halt as the browser struggles to resolve hostnames (websites today really overdo it with calling a million different services and sites, no wonder my poor pihole has a hard time 😉 ).

1
watch 'top -bHn1 | egrep "CPU|pihole"; echo ""; df -h'

output after 24ish hours of uptime:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
    220 pihole    20   0  106988 101076  10176 S   0.0  19.3  58:59.25 pihole-FTL
    230 pihole    20   0  106988 101076  10176 S   0.0  19.3   3:45.46 database
    231 pihole    20   0  106988 101076  10176 S   0.0  19.3   0:19.35 housekeeper
    232 pihole    20   0  106988 101076  10176 S   0.0  19.3   0:04.76 dns-client
    233 pihole    20   0  106988 101076  10176 S   0.0  19.3   0:43.54 timer
    234 pihole    20   0  106988 101076  10176 S   0.0  19.3   0:00.00 webserver
    235 pihole    25   5  106988 101076  10176 S   0.0  19.3   0:04.04 civetweb-timer
    236 pihole    25   5  106988 101076  10176 S   0.0  19.3   0:02.45 civetweb-master
    459 pihole    25   5  106988 101076  10176 S   0.0  19.3   0:01.84 civetweb-worker
... more civetweb-workers

Filesystem      Size  Used Avail Use% Mounted on
/dev/loop1      2.0G  1.4G  493M  74% /
none            492K  4.0K  488K   1% /dev
udev             32G     0   32G   0% /dev/tty
tmpfs            32G  5.8M   32G   1% /dev/shm
tmpfs            13G   88K   13G   1% /run
tmpfs            32G     0   32G   0% /tmp
tmpfs           5.0M     0  5.0M   0% /run/lock

I just noticed disk usage has gone up from 68% so about 120MB in just 24hrs of mostly idling and maybe some iot stuff querying the dns. I think somehow, that’s a lot…

Update - another month later

Things were fine for a while and then it started acting up again. Still no clue as to why this happens.

There was an update to FTL 6.4.1 (which is apparently the same as 6.4) and in the release notes, there’s fix for some intermittent high cpu usage although in my case it was permanent. Anyway, for the moment, things have settled down again.

https://github.com/pi-hole/FTL/releases/tag/v6.4.1

The interesting bits are these Two changes:

Let’s hope that was it or else I’ll be switching to another DNS - I’ve wasted too much time chasing this issue already.

Update - end of 2025

I switched to blocky - pihole kept freezing and I’ve had enough of it. There’s somehow still some weird timeouts every now and then and there’s a bunch of components that could be causing this. From the firewall (unifi seems to break and restore shelly connectivity every other update, which is a whole other insane nuisance), to the upstream DNS server and everything in between - oh joy!

At least it’s almost tolerable now.