Project

General

Profile

Actions

Regression #11475

closed

Route tables with many entries can lead to PHP errors and timeouts when looking up routes

Added by Dirk Meyer almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
Routing
Target version:
Start date:
02/19/2021
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Default
Affected Version:
2.5.0
Affected Architecture:
All

Description

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:
ini_set("memory_limit", "1500M");

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


Files

utils.inc.diff (917 Bytes) utils.inc.diff Renato Botelho, 02/22/2021 09:35 AM
169.diff (1.7 KB) 169.diff Viktor Gurov, 03/02/2021 06:57 AM
Actions

Also available in: Atom PDF