Statistics are not updated automatically. PHP Fatal error: Allowed memory size of 134217728 bytes exhausted

Refers to:

  • Plesk for Linux

Created:

2016-11-16 12:56:24 UTC

Modified:

2016-12-21 19:35:14 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Statistics are not updated automatically. PHP Fatal error: Allowed memory size of 134217728 bytes exhausted

Symptoms

  1. Automatic web-statistic calculation does not work. Values in Tools & Settings > Statistics > Traffic Usage by Domains are not updated.

  2. Executing the utility manually /usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=example.com results in one of the following errors:

    PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 62390354 bytes) in /usr/local/psa/admin/plib/Service/Agent/Transport/Local/Exec.php on line 240

WARNING during statistics_collector execution: : statistics_collector: Unable to parse pending domains traffic line: ?:: 2014-10-2       smtp    0
System error 11: Resource temporarily unavailable
  • Daily Maintenance tasks are being executed on schedule on an every day basis:

    grep 50plesk-daily /var/log/cron
    May 14 13:22:01 ppp115 run-parts(/etc/cron.daily)[1287]: starting 50plesk-daily
    May 14 13:23:13 ppp115 run-parts(/etc/cron.daily)[2867]: finished 50plesk-daily
  • Cause

    • lots of stuck statistics processes
    • php memory limit is exceeded

    Resolution

    1. If there are many instances of /usr/local/psa/admin/bin/statistics_collector :
      # ps auxww | grep stat*
      root 7935 0.0 0.0 86568 3676 ? S 09:43 0:00 /usr/local/psa/admin/bin/statistics_collector
      root 7964 0.0 0.0 86568 3140 ? S Dec18 0:00 /usr/local/psa/admin/bin/statistics_collector
      root 11027 0.0 0.0 86568 3676 ? S 09:49 0:00 /usr/local/psa/admin/bin/statistics_collector
      root 11515 0.0 0.0 86716 3668 ? S Dec10 0:01 /usr/local/psa/admin/bin/statistics_collector

    kill them all:

        # kill -15 <PID>

    where <PID> is the id of the process

    1. Increase memory_limit value in /usr/local/psa/admin/conf/php.ini to at least 512M or 1024M and restart sw-cp-server afterwards:

      # /etc/init.d/sw-cp-server restart
    2. Recalculate statistics using /usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=example.com utility.

    Have more questions? Submit a request
    Please sign in to leave a comment.