pihole-FTL killed for too high mem use during boot


I see several issues related to high memory use, but locked.

What’s interesting is the memory problem appears to only manifest during boot. After pihole-FTL gets killed and the server is running normally, I can:
pihole restartdns
to get it working without any memory issue.

I have successfully worked around it by disabling autostart, and doing so in rc.local, sleeping some time (40 seconds), and issuing ‘pihole restartdns’ before exiting rc.local. It works, but seems extremely kludgy.


Possibly useful info:
This is a armv5 device with a pihole-FTL built from source following the instructions exactly except for issuing: CFLAGS="-march=armv5te -mtune=xscale" make
This device has only 128MB memory. But it has 78M available after my kludgy soln above.
The GUI (and everything) works fine (I use apache2, not lighthttp) after pihole-FTL gets restarted.

eric@deimos:~$ echo ">stats" | nc localhost 4711
domains_being_blocked 149167
dns_queries_today 3397
ads_blocked_today 22
ads_percentage_today 0.647630
unique_domains 990
queries_forwarded 2738
queries_cached 637
clients_ever_seen 2
unique_clients 2
dns_queries_all_types 3397
reply_NODATA 412
reply_NXDOMAIN 58
reply_CNAME 1975
reply_IP 849
privacy_level 0
status enabled


128 MB RAM is pretty light for Pi-Hole. With the current version of FTL, using NULL blocking mode keeps each gravity list entry in memory twice. You might try changing blocking mode to NXDOMAIN, which reduces the memory use for the gravity list: