Route tables with many entries can lead to PHP errors and timeouts when looking up routes
Pfsense with FFR crashes in the web interface after update from 2.4.5-p1 to Pfsense 2.5.0
Right after update the dashboard fails with an empty page.
19-Feb-2021 15:37:26 Europe/Berlin] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /etc/inc/util.inc on line 2632@
I raised the memory limits a few times in /etc/inc/config.inc:
[19-Feb-2021 19:41:01 Europe/Berlin] PHP Fatal error: Allowed memory size of 1342177280 bytes exhausted (tried to allocate 4096 bytes) in /etc/inc/util.inc on line 2632
Finally the dashboard shows with in /etc/inc/config.inc:
But the web interface is still very slow,
often fails with "504 Gateway Time-out"
top shows that "netstat" and "php-fpm" is running with high load.
The PHP code is reading the full routing table
with "/usr/bin/netstat --libxo json -nWr"
just to get the default gateway.
netstat -nr4 | wc -l 826327 netstat -nr6 | wc -l 103340
A much faster way to get the default route would be to call:
route -4n get default route -6n get default