Please follow the below template, it will help us to help you!
Expected Behaviour:
Intend to run pi-hole 24/7 (Sorry I'm non tech user so will try my best to explain the issue)
Actual Behaviour:
At random time (within 24 hrs of running) pi-hole it stops working with FTL error and when I run htop, it shows CPU usage 100% or even more with memory usage of about 80% or higher. Currently I restarted rasberry pi and everything seems to be fine but i see memory usage almost 70% which I believe at some point will cause pi-hole to stop working again.
Debug Token:
I did cat /var/log/pihole-FTL.log | nc tricorder.pi-hole.net 9999 and below is the token #3foqjp7ew2.
With your large number of blocked domains in gravity (a few million), you may be pushing your memory limits, depending on what hardware you are running. With this many domains in gravity and using the NULL blocking mode, there have been reports of high CPU and RAM usage. Here is one related thread:
What is the output of the following commands from the Pi terminal:
echo ">stats" | nc localhost 4711
free -m
df -a -h
An additional note, and perhaps related to your problem. From your debug log, there are some abnormal line entries in your ad lists file (/etc/pihole/adlists.list). This list is normally populated with web addresses of each blocklist to which you subscribe.
Your list has some individual domains listed (lines 21 to 48), and an asterisk in line 54.
Edit this file and remove these lines, then rebuild gravity with pihole - g
Memory usage didnt decrease so I tried to uninstall using command pihole uninstall followed by normal installation process. At the end it erred "Error during updating repository..."
I checked pi-hole and it still running with default adlist. Now, I just have around 100k blocklist but I dont see any improvement in memory usage. This morning its around 83% and I guess its just matter of time where it will stop working again.
Your new debug log appears normal. Since this is a new install, you should have the default options selected only. Your memory use still seems higher than normal.
One of the parameters that can affect RAM usage is BLOCKINGMODE, an option set in file /etc/pihole/pihole-FTL.conf (Configuration - Pi-hole documentation). The default is NULL, which results in double entries for each item on the gravity list (one for AAAA and one for A records). Let's change this blocking mode to NXDOMAIN and see what affect that has on RAM usage:
sudo nano /etc/pihole/pihole-FTL.conf
the file might be empty, which is expected in your case. Add this line: BLOCKINGMODE=NXDOMAIN , then save and exit. Next restart FTL with this command:
Good that this improved things. I'm still curious why your RAM usage was so high before - that's not usual for that many domains and queries. Just for comparison, I have several Pi-Holes that serve subsets of clients, with different options for testing, etc. Here are the same screen shots for these. The closest to your setup is the last and it sits about about 20% RAM usage.
Pi 3B+ with V4.0 master, wired, BLOCKINGMODE=IP-NODATA-AAAA
I've Pi 3B+ with V4.0, wired. Should I make the change using same steps but this time set parameter BLOCKINGMODE=NULL and see what happens? or something else?
If you stop FTL (sudo service pihole-FTL stop), does the memory usage go down? Using most of your memory is not necessarily bad; it means the system is not letting any memory go to waste.