What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Entware Pi-hole directly on the router? Yes!

I did and it wouldnt let me change it back to 53. Said it was in use, could that have been because I have unbound installed before pihole?
Did you follow the installation guide, specifically for Merlin firmware?
 
@jacklul

It seems the latest version wants quite a bit more memory, compared to the earlier one:
Code:
admin@RT-AC86U-9988:/# ps wT | grep pihole
 3209 pihole    109m S <  pihole-FTL
13000 pihole    109m S <  {database} pihole-FTL
13001 pihole    109m S <  {housekeeper} pihole-FTL
13002 pihole    109m S <  {dns-client} pihole-FTL
13003 pihole    109m S <  {timer} pihole-FTL
13004 pihole    109m S <  {webserver} pihole-FTL
13016 pihole    109m S N  {civetweb-timer} pihole-FTL
13017 pihole    109m S N  {civetweb-master} pihole-FTL
898995 pihole    109m S N  {civetweb-worker} pihole-FTL
898996 pihole    109m S N  {civetweb-worker} pihole-FTL
898998 pihole    109m S N  {civetweb-worker} pihole-FTL
898999 pihole    109m S N  {civetweb-worker} pihole-FTL
1112602 admin     5980 S    grep pihole
admin@RT-AC86U-9988:/#
 
@jacklul

It seems the latest version wants quite a bit more memory, compared to the earlier one:
Code:
admin@RT-AC86U-9988:/# ps wT | grep pihole
 3209 pihole    109m S <  pihole-FTL
13000 pihole    109m S <  {database} pihole-FTL
13001 pihole    109m S <  {housekeeper} pihole-FTL
13002 pihole    109m S <  {dns-client} pihole-FTL
13003 pihole    109m S <  {timer} pihole-FTL
13004 pihole    109m S <  {webserver} pihole-FTL
13016 pihole    109m S N  {civetweb-timer} pihole-FTL
13017 pihole    109m S N  {civetweb-master} pihole-FTL
898995 pihole    109m S N  {civetweb-worker} pihole-FTL
898996 pihole    109m S N  {civetweb-worker} pihole-FTL
898998 pihole    109m S N  {civetweb-worker} pihole-FTL
898999 pihole    109m S N  {civetweb-worker} pihole-FTL
1112602 admin     5980 S    grep pihole
admin@RT-AC86U-9988:/#
How long have you been running it? Maybe there is memory leak somewhere again.
In FTL v6.3 dev version there was a memory leak that I reported and it got fixed.
FTL periodically performs a maintenance of pihole.FTL.db database where it has to load it completely into the memory, if the database is big then this can happen.

Check FTL log for any warnings or errors - if there are pihole-FTL.db errors FTL will probably keep the data until it can insert it into the DB successfully - if you have FTL running in this state for a longer period this can add up as memory usage.

Try sending signals 39 and 40 to FTL process:
Code:
#!/bin/sh
pid_file="$(pihole-FTL --config files.pid 2> /dev/null)"
sigrtmin="$(pihole-FTL sigrtmin 2> /dev/null)"
kill -$((sigrtmin + 5)) "$(cat "$pid_file")"
kill -$((sigrtmin + 4)) "$(cat "$pid_file")"
Note that you can't just simply send signal 39 and 40 because depending on the environment SIGRTMIN can have different value and FTL uses it as a base for all other signal values.
Official documentation on the signals: https://docs.pi-hole.net/ftldns/signals/

You can also just send SIGHUP which should flush everything: killall -SIGHUP pihole-FTL

Personally I have not noticed high memory usage, sitting at stable ~35-45MB.
 
How long have you been running it? Maybe there is memory leak somewhere again.
In FTL v6.3 dev version there was a memory leak that I reported and it got fixed.
It does not take much for memory to skyrocket:
Code:
admin@RT-AC86U-9988:/tmp/mnt/ac86u/entware/var/log# /opt/etc/init.d/S65pihole-FTL restart
 Shutting down pihole-FTL...              done.
 Starting pihole-FTL...              done.
admin@RT-AC86U-9988:/tmp/mnt/ac86u/entware/var/log# ps wT | grep pihole
1112433 pihole   36132 S <  pihole-FTL
1112521 pihole   36132 S <  {database} pihole-FTL
1112522 pihole   36132 S <  {housekeeper} pihole-FTL
1112523 pihole   36132 S <  {dns-client} pihole-FTL
1112524 pihole   36132 S <  {timer} pihole-FTL
1112525 pihole   36132 S <  {webserver} pihole-FTL
1112526 pihole   36132 S N  {civetweb-timer} pihole-FTL
1112527 pihole   36132 S N  {civetweb-master} pihole-FTL
1112589 admin     1184 D    grep pihole

admin@RT-AC86U-9988:/tmp/mnt/ac86u/entware/var/log# ps wT | grep pihole
1112433 pihole    104m S <  pihole-FTL
1112521 pihole    104m S <  {database} pihole-FTL
1112522 pihole    104m S <  {housekeeper} pihole-FTL
1112523 pihole    104m S <  {dns-client} pihole-FTL
1112524 pihole    104m S <  {timer} pihole-FTL
1112525 pihole    104m S <  {webserver} pihole-FTL
1112526 pihole    104m S N  {civetweb-timer} pihole-FTL
1112527 pihole    104m S N  {civetweb-master} pihole-FTL

That's about 30 min apart.

Tried your command, it does not seem to do anything:
Code:
admin@RT-AC86U-9988:/tmp/mnt/ac86u/entware/var/log# ps wT | grep pihole
1112433 pihole    104m S <  pihole-FTL
1112521 pihole    104m S <  {database} pihole-FTL
1112522 pihole    104m S <  {housekeeper} pihole-FTL
1112523 pihole    104m S <  {dns-client} pihole-FTL
1112524 pihole    104m S <  {timer} pihole-FTL
1112525 pihole    104m S <  {webserver} pihole-FTL
1112526 pihole    104m S N  {civetweb-timer} pihole-FTL
1112527 pihole    104m S N  {civetweb-master} pihole-FTL
1218617 admin     5980 D    grep pihole
admin@RT-AC86U-9988:/tmp/mnt/ac86u/entware/var/log# cat /jffs/scripts/pihole39
#!/bin/sh
pid_file="$(pihole-FTL --config files.pid 2> /dev/null)"
sigrtmin="$(pihole-FTL sigrtmin 2> /dev/null)"
kill -$((sigrtmin + 5)) "$(cat "$pid_file")"
kill -$((sigrtmin + 4)) "$(cat "$pid_file")"
admin@RT-AC86U-9988:/tmp/mnt/ac86u/entware/var/log# /jffs/scripts/pihole39
admin@RT-AC86U-9988:/tmp/mnt/ac86u/entware/var/log# ps wT | grep pihole
1112433 pihole    104m S <  pihole-FTL
1112521 pihole    104m S <  {database} pihole-FTL
1112522 pihole    104m S <  {housekeeper} pihole-FTL
1112523 pihole    104m S <  {dns-client} pihole-FTL
1112524 pihole    104m S <  {timer} pihole-FTL
1112525 pihole    104m S <  {webserver} pihole-FTL
1112526 pihole    104m S N  {civetweb-timer} pihole-FTL
1112527 pihole    104m S N  {civetweb-master} pihole-FTL
1219434 admin     5980 S    grep pihole

Tried the other command, no change:
Code:
admin@RT-AC86U-9988:/tmp/mnt/ac86u/entware/var/log# ps wT |grep pihole
1112433 pihole    104m S <  pihole-FTL
1112521 pihole    104m S <  {database} pihole-FTL
1112522 pihole    104m S <  {housekeeper} pihole-FTL
1112523 pihole    104m S <  {dns-client} pihole-FTL
1112524 pihole    104m S <  {timer} pihole-FTL
1112525 pihole    104m S <  {webserver} pihole-FTL
1112526 pihole    104m S N  {civetweb-timer} pihole-FTL
1112527 pihole    104m S N  {civetweb-master} pihole-FTL
1230019 admin     1184 D    grep pihole
admin@RT-AC86U-9988:/tmp/mnt/ac86u/entware/var/log# killall -SIGHUP pihole-FTL
admin@RT-AC86U-9988:/tmp/mnt/ac86u/entware/var/log# ps wT |grep pihole
1112433 pihole    104m S <  pihole-FTL
1112521 pihole    104m S <  {database} pihole-FTL
1112522 pihole    104m S <  {housekeeper} pihole-FTL
1112523 pihole    104m S <  {dns-client} pihole-FTL
1112524 pihole    104m S <  {timer} pihole-FTL
1112525 pihole    104m S <  {webserver} pihole-FTL
1112526 pihole    104m S N  {civetweb-timer} pihole-FTL
1112527 pihole    104m S N  {civetweb-master} pihole-FTL
1231843 admin     5980 S    grep pihole

And recent FTL log with the restart sequence:
Code:
2025-11-24 10:37:11.395 CST [3472/T11431] WARNING: Long-term load (15min avg) larger than number of processors: 2.7 > 2
2025-11-24 10:38:11.741 CST [3472M] INFO: Asked to terminate by "killall pihole-FTL" (PID 1112292, user admin UID 0)
2025-11-24 10:38:11.815 CST [3472/T11430] INFO: Terminating database thread
2025-11-24 10:38:11.855 CST [3472/T11433] INFO: Terminating timer thread
2025-11-24 10:38:12.219 CST [3472M] INFO: Finished final database update
2025-11-24 10:38:12.220 CST [3472M] INFO: Waiting for threads to join
2025-11-24 10:38:12.221 CST [3472M] INFO: Thread housekeeper (1) is idle, terminating it.
2025-11-24 10:38:12.221 CST [3472M] INFO: Thread dns-client (2) is idle, terminating it.
2025-11-24 10:38:12.221 CST [3472M] INFO: Thread webserver (7) is idle, terminating it.
2025-11-24 10:38:12.223 CST [3472M] INFO: All threads joined
2025-11-24 10:38:12.255 CST [3472M] INFO: PID file emptied
2025-11-24 10:38:12.270 CST [3472M] INFO: Stored 0 API sessions in the database
2025-11-24 10:38:13.474 CST [3472M] INFO: ########## FTL terminated after 6h 31m 21s  (code 0)! ##########
2025-11-24 10:38:14.072 CST [1112402M] INFO: ########## FTL started on RT-AC86U-9988! ##########
2025-11-24 10:38:14.073 CST [1112402M] INFO: FTL branch: master
2025-11-24 10:38:14.073 CST [1112402M] INFO: FTL version: v6.3.3
2025-11-24 10:38:14.073 CST [1112402M] INFO: FTL commit: a0186fd4
2025-11-24 10:38:14.073 CST [1112402M] INFO: FTL date: 2025-11-04 20:18:48 +0100
2025-11-24 10:38:14.073 CST [1112402M] INFO: FTL user: pihole
2025-11-24 10:38:14.073 CST [1112402M] INFO: Compiled for linux/arm64/v8 (compiled on CI) using cc (Alpine 14.2.0) 14.2.0
2025-11-24 10:38:14.086 CST [1112402M] INFO: Wrote config file:
2025-11-24 10:38:14.086 CST [1112402M] INFO:  - 161 total entries
2025-11-24 10:38:14.087 CST [1112402M] INFO:  - 147 entries are default
2025-11-24 10:38:14.087 CST [1112402M] INFO:  - 14 entries are modified
2025-11-24 10:38:14.087 CST [1112402M] INFO:  - 0 entries are forced through environment
2025-11-24 10:38:14.116 CST [1112402M] INFO: Parsed config file /opt/etc/pihole/pihole.toml successfully
2025-11-24 10:38:14.116 CST [1112402M] INFO: PID file does not exist or not readable
2025-11-24 10:38:14.116 CST [1112402M] INFO: No other running FTL process found.
2025-11-24 10:38:14.119 CST [1112402M] INFO: PID of FTL process: 1112402
2025-11-24 10:38:14.142 CST [1112402M] INFO: listening on 192.168.1.20 port 53
2025-11-24 10:38:14.143 CST [1112402M] INFO: listening on br0(#19): 192.168.1.20 port 53
2025-11-24 10:38:14.146 CST [1112433M] INFO: PID of FTL process: 1112433
2025-11-24 10:38:14.154 CST [1112433M] INFO: Database version is 21
2025-11-24 10:38:14.185 CST [1112433M] INFO: Database successfully initialized
2025-11-24 10:38:16.558 CST [1112433M] INFO: Imported 48386 queries from the on-disk database (it has 3516806 rows)
2025-11-24 10:38:16.565 CST [1112433M] INFO: Parsing queries in database
2025-11-24 10:38:16.691 CST [1112433M] INFO:   10000 queries parsed...
2025-11-24 10:38:16.807 CST [1112433M] INFO:   20000 queries parsed...
2025-11-24 10:38:16.925 CST [1112433M] INFO:   30000 queries parsed...
2025-11-24 10:38:17.085 CST [1112433M] INFO:   40000 queries parsed...
2025-11-24 10:38:17.187 CST [1112433M] INFO: Imported 48386 queries from the long-term database
2025-11-24 10:38:17.187 CST [1112433M] INFO:  -> Total DNS queries: 48386
2025-11-24 10:38:17.187 CST [1112433M] INFO:  -> Cached DNS queries: 14423
2025-11-24 10:38:17.187 CST [1112433M] INFO:  -> Forwarded DNS queries: 9216
2025-11-24 10:38:17.187 CST [1112433M] INFO:  -> Blocked DNS queries: 24447
2025-11-24 10:38:17.187 CST [1112433M] INFO:  -> Unknown DNS queries: 0
2025-11-24 10:38:17.187 CST [1112433M] INFO:  -> Unique domains: 2982
2025-11-24 10:38:17.187 CST [1112433M] INFO:  -> Unique clients: 16
2025-11-24 10:38:17.187 CST [1112433M] INFO:  -> DNS cache records: 1044
2025-11-24 10:38:17.187 CST [1112433M] INFO:  -> Known forward destinations: 1
2025-11-24 10:38:17.734 CST [1112433M] INFO: NTP sync is disabled
2025-11-24 10:38:17.734 CST [1112433M] INFO: FTL is running as user pihole (UID 502)
2025-11-24 10:38:17.734 CST [1112433/T1112522] WARNING: Long-term load (15min avg) larger than number of processors: 2.8 > 2
2025-11-24 10:38:17.742 CST [1112433M] INFO: Reading certificate from /opt/etc/pihole/tls.pem ...
2025-11-24 10:38:17.760 CST [1112433M] INFO: Using SSL/TLS certificate file /opt/etc/pihole/tls.pem
2025-11-24 10:38:17.782 CST [1112433M] INFO: Web server ports:
2025-11-24 10:38:17.782 CST [1112433M] INFO:   - 127.0.0.1:5080 (HTTP, IPv4, OK)
2025-11-24 10:38:17.782 CST [1112433M] INFO:   - 192.168.1.20:80 (HTTP, IPv4, OK)
2025-11-24 10:38:17.782 CST [1112433M] INFO:   - 192.168.1.20:5443 (HTTPS, IPv4, OK)
2025-11-24 10:38:17.811 CST [1112433M] INFO: Restored 0 API sessions from the database
2025-11-24 10:38:17.815 CST [1112433M] INFO: Blocking status is enabled
2025-11-24 10:38:17.891 CST [1112433/T1112521] INFO: Compiled 0 allow and 25 deny regex for 16 clients in 34.5 msec
2025-11-24 10:43:17.295 CST [1112433/T1112522] WARNING: Long-term load (15min avg) larger than number of processors: 2.7 > 2
2025-11-24 10:48:17.475 CST [1112433/T1112522] WARNING: Long-term load (15min avg) larger than number of processors: 2.7 > 2
2025-11-24 10:53:17.475 CST [1112433/T1112522] WARNING: Long-term load (15min avg) larger than number of processors: 2.7 > 2

2025-11-24 11:20:26.372 CST [1112433M] INFO: Flushing cache and re-reading config
2025-11-24 11:20:26.388 CST [1112433M] INFO: Blocking status is enabled
2025-11-24 11:20:26.504 CST [1112433/T1112521] INFO: Compiled 0 allow and 25 deny regex for 16 clients in 49.0 msec
 
What are the sizes of gravity.db and pihole-FTL.db?
 
What are the sizes of gravity.db and pihole-FTL.db?
Code:
admin@RT-AC86U-9988:/tmp/mnt/ac86u/entware/etc/pihole# ls -lta *.db
-rw-r----- 1 pihole pihole 227610624 Nov 24 12:29 pihole-FTL.db
-rw-r----- 1 pihole pihole   6344704 Nov 23 09:43 gravity.db
-rw-r----- 1 pihole pihole  13426688 Nov 13 10:15 gravity_old.db
-rw-r----- 1 pihole pihole   3387392 Nov  6 11:32 macvendor.db
 
That memory usage could be caused by the size of pihole-FTL.db, for comparison mine is around 65M and I keep only last 30 days of queries in it.
 
Settings -> Privacy, set "Maximum number of days to keep queries in the database" to something low like 8 days and wait few hours.
 
Also, if I remember correctly, ps only shows virtual allocations, not real usage. Only the MEM% is real usage, I think.
Correct me if I'm wrong here.

You might want to check memory usage percentage displayed in Settings->System.
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Back
Top