States/Summary php error - is there an edit or System Tunable for php memory?



  • 2.2.4 Rel (amd64)
    Intel(R) Xeon(R) CPU E5345 @ 2.33GHz
    8 CPUs: 2 package(s) x 4 core(s)
    16GB RAM

    this Dell PE1950 averages about 150,000 states

    When I choose Diag/States or Diag / States Summary I get:
    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /usr/local/www/diag_states.php on line 60
    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /usr/local/www/diag_states_summary.php on line 55

    Is there a System tunable or .php file edit I can make to fix these errors?

    BTW when the state table size total is much smaller (~60k states) these menu options work.

    Lastly, if this is a know issue, is there an alternative?

    I simply need to periodically see a report of IPs sorted by the total NUMBER of states each IP is using.

    thx



  • I'm aware of this but I do not see a specific fix:
    https://redmine.pfsense.org/issues/3796


  • Rebel Alliance Developer Netgate

    There isn't a good fix there. We have to stop the page from consuming too much RAM, or else it could cause problems, but where it runs out of RAM varies depending not only on the state table size but the size of the other summary data structures on the page. It's not easy to predict when it would run out of RAM and thus set a limit on processing.

    You could edit the page and add an ini_set call to increase the allowed RAM, but there isn't a more general solution available at the moment.



  • Thanks for the timely and honest response.

    Did some digging in the forum…

    Here's the edit I added to diag_states_summary.php

    ini_set('memory_limit','768M');

    Testing...This did not change the error - I'm assuming I need to restart a service(s) or reboot for the change to take?



  • Also - I did find this info on the forum from others having similar issues installing pfblockerNG / php memory issues but I don't know if I need to do these edits too:

    for amd64 systems … change /etc/inc/config.inc (line 75) from 512M to 640M or 768M.
    Code: [Select]
    // Set memory limit to 512M on amd64.
    if ($ARCH == "amd64") {
      ini_set("memory_limit", "512M");
    } else {
      ini_set("memory_limit", "128M");
    }
    to
    Code: [Select]
    // Set memory limit to 512M on amd64.
    if ($ARCH == "amd64") {
      ini_set("memory_limit", "768M"); # amd64 Default 512M
    } else {
      ini_set("memory_limit", "128M");
    }
    AND modify the /usr/local/etc/php.ini (last line) and /etc/rc.php_ini_setup files (line 303) from
    Code: [Select]
    suhosin.memory_limit = 536870912
    to
    Code: [Select]
    suhosin.memory_limit = 671088640 # 640M Default 536870912
    or
    Code: [Select]
    suhosin.memory_limit = 805306368 # 768M Default 536870912


Log in to reply