PiHole constantly runs at over 100% CPU utilization and is virtually unusable

Please follow the below template, it will help us to help you!

Expected Behaviour:

NA

Actual Behaviour:

Pi Hole does web interface does not load and the load is 1.12 1.31 1.21; Temperature is 151.9. I checked top and pihole-FTL is consistently close or above 100% CPU utilization. I have restarted the Pi several times, but still the same.

Debug Token:

9ufg6wjpcq

How long has this been going on? What other effects are you experiencing (web interface not working, etc)?

Yes....web interface not working and even the api.php is not working

Are you running anything else on the Pi?

This has been going for the past couple of days...can't pinpoint the exact time

Only Homebridge is running besides PiHole and that is at less than 2% CPU

Try running pihole -f

even after pihole -f utilization is 99.9% and the web interface is not loading.

Are there any queries in /var/log/pihole.log?

I was looking at pihole_debug.log and see these lines repeated several times (not sure what that means)

2017-08-08 08:44:44: (mod_fastcgi.c.2702) FastCGI-stderr: PHP Warning:  socket_read(): unable to read from socket [104]: Connection reset by peer in /var/www/html/admin/scripts/pi-hole/php/FTL.php on line 98
2017-08-08 08:44:44: (mod_fastcgi.c.2702) FastCGI-stderr: PHP Warning:  socket_read(): unable to read from socket [104]: Connection reset by peer in /var/www/html/admin/scripts/pi-hole/php/FTL.php on line 98
2017-08-08 08:44:44: (mod_fastcgi.c.2702) FastCGI-stderr: PHP Warning:  socket_read(): unable to read from socket [104]: Connection reset by peer in /var/www/html/admin/scripts/pi-hole/php/FTL.php on line 98
2017-08-08 08:44:44: (mod_fastcgi.c.2702) FastCGI-stderr: PHP Warning:  socket_read(): unable to read from socket [104]: Connection reset by peer in /var/www/html/admin/scripts/pi-hole/php/FTL.php on line 98

Nothing unusual in pihole.log....bunch of DNS queries there

FTL never finishes reading the log and so never opens the socket so that it can communicate with the web interface. It's in a cycle of reading the log then somehow thinking that you flushed the log, making it read it all over again. Do you have anything flushing the log, by chance?

BTW....the pihole.log file is over 2GB

Don't know what would be flushing these logs?

Hm, that's not good. What's the output of this command? (use this if you want: How do I debug my Pi-hole installation?)

tail /var/log/pihole.log
pi@raspberrypi:~ $ tail /var/log/pihole.log
Aug  8 12:11:42 dnsmasq[725]: query[PTR] 40.2.168.192.in-addr.arpa from 127.0.0.1
Aug  8 12:11:42 dnsmasq[725]: config 192.168.2.40 is NXDOMAIN
Aug  8 12:13:07 dnsmasq[725]: query[PTR] 8.8.8.8.in-addr.arpa from 127.0.0.1
Aug  8 12:13:07 dnsmasq[725]: cached 8.8.8.8 is google-public-dns-a.google.com
Aug  8 12:13:07 dnsmasq[725]: query[PTR] 4.4.8.8.in-addr.arpa from 127.0.0.1
Aug  8 12:13:07 dnsmasq[725]: cached 8.8.4.4 is google-public-dns-b.google.com
Aug  8 12:15:09 dnsmasq[725]: query[PTR] 8.8.8.8.in-addr.arpa from 127.0.0.1
Aug  8 12:15:09 dnsmasq[725]: cached 8.8.8.8 is google-public-dns-a.google.com
Aug  8 12:15:09 dnsmasq[725]: query[PTR] 4.4.8.8.in-addr.arpa from 127.0.0.1
Aug  8 12:15:09 dnsmasq[725]: cached 8.8.4.4 is google-public-dns-b.google.com

What are the permissions of the directories in which pihole.log is contained? I think FTL is failing to detect if the file has been flushed or not over and over again.

https://hastebin.com/lagicobucu.hs

Hm, that looks ok. For now, run

sudo service pihole-FTL stop

to stop FTL from running.

But, looks like that will not solve the problem

Did FTL not stop? If so, kill the process via kill $(pidof pihole-FTL)