Ad Widget

Collapse

Cannot load Latest data, PHP Fatal error: Allowed memory size of [..] bytes exhausted

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • liquidsnake1989
    Junior Member
    • Oct 2014
    • 10

    #1

    Cannot load Latest data, PHP Fatal error: Allowed memory size of [..] bytes exhausted

    I'm running Zabbix 2.2.5 on CentOS 6.5, on which I'm monitoring the following:

    -------------------------------------------

    However, since a couple of days ago, whenever I try to load Monitoring > Latest Data, the page loads for about 1,5 minutes, and then stops, showing me nothing (not even the dropdown list where I can choose different host groups), see screenshot:

    --------------------------------------------


    I checked the /var/log/httpd/error_log, and I see the following error:
    Code:
    [error] [client 10.10.0.34] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 1048576 bytes) in /usr/share/zabbix/latest.php on line 509, referer: http://172.22.20.70/zabbix/dashboard.php?ddreset=1&sid=0f4a1c23a87179ed
    After searching the net this morning, I discovered that you should change the /etc/php.ini, and increase the memory limit. I set mine to 512M, and this also shows up in my PhpInfo script:

    ------------------------------------------------

    However, after restarting the httpd service (heck, I even rebooted the entire server a couple of times), the same error in /var/log/httpd/error_log keeps showing up.

    Then I discovered this topic here on the Zabbix forums: https://www.zabbix.com/forum/showthr...006#post142006

    So I changed the zabbix_server.conf file aswell, to the following values:
    Code:
    CacheSize=32M
    HistoryCacheSize=16M
    TrendCacheSize=8M
    HistoryTextCacheSize=32M
    ValueCacheSize=64M
    Again, rebooted entire server, but still the error log shows the same.

    So my questions are:

    1. Where does he come across the 'limit' of 134217728 bytes (roughly 134.22 MB), even if I set the limit globally (in the php.ini) to 512MB?
    2. How do I fix this?
  • ingus.vilnis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2014
    • 908

    #2
    Hello and welcome to Zabbix forums!

    You may have encountered a somewhat known issue in larger environments also known as slow latest data.


    Here will be some very general pointers for you:
    Regarding zabbix_server.conf - don't just take the values from another post. You have to tune them according to the performace data of your zabbix instance.
    This is a very good article on that: http://blog.zabbix.com/scalable-zabb...400-nvps/2615/

    This forum post also can be helpful: https://www.zabbix.com/forum/showthread.php?t=46594

    Tune your database.

    Tune your PHP but not too much. You can set memory_limit to 1G but only if your server memory resources allow. Setting more than 2G makes no sense anyways.

    And the last one - in Zabbix frontend go to Administration -> General
    Dropdown first entry: None

    That will allow to open Latest data page but you will have to select specific hosts or groups.

    Best Regards,
    Ingus

    Comment

    Working...