[ZBX-7205] latest data page is blank - PHP Fatal error on allowed memory Created: 2013 Oct 24  Updated: 2019 Dec 10

Status: Open
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.1.8
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Kyle Assignee: Unassigned
Resolution: Unresolved Votes: 7
Labels: apache, memory, php
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

PHP 5.4.6-1ubuntu1.4
Zabbix 2.1.8

memory_limit is currently at 756M.


Issue Links:
Duplicate
is duplicated by ZBX-10557 "Latest Data" may consume all availab... Closed

 Description   

I am experiencing an issue where when I click on "latest data" tab and I am getting a blank page. Looking at the apache log I see:

PHP Fatal error: Allowed memory size of 792723456 bytes exhausted (tried to allocate 21 bytes) in /opt/zabbix-web/include/db.inc.php on line 616, referer:

I have tried increasing the php memory to several Gigs but it just seems to continue to eat it all up and then crash.

Appreciate the assistance.



 Comments   
Comment by richlv [ 2013 Oct 26 ]

how many hosts, how many items do you have ?
if you set 'dropdown first entry' to "none", can you at least open the page ?
(the problem should still be fixed, just gathering more info)

also, is debug mode enabled ?

and maybe you can try current trunk instead, there have been some improvements recently (after 2.1.8)

Comment by Kyle [ 2013 Oct 30 ]

Zabbix server is running Yes localhost:10051
Number of hosts (monitored/not monitored/templates) 178 118 / 0 / 60
Number of items (monitored/disabled/not supported) 139776 117117 / 9422 / 13237
Number of triggers (enabled/disabled) [problem/ok] 18733 18731 / 2 [103 / 18628]
Number of users (online) 4 1
Required server performance, new values per second 581.32 -

Yes when drop down first entry is set to none it loads the page.

I do not have debug mode enabled.

Comment by Kyle [ 2013 Oct 30 ]

Upgraded to latest 2.1.9 release and still same issue:

Apache log shows:

[Wed Oct 30 15:55:18 2013] [error] [client x.x.x.x] PHP Fatal error: Allowed memory size of 792723456 bytes exhausted (tried to allocate 32 bytes) in /opt/zabbix-web/include/db.inc.php on line 616, referer: http://x.x.x.x/zabbix/adm.gui.php

Comment by Kyle [ 2013 Oct 30 ]

Also when I set the "drop down first entry" to none it seems to remove the "all" option completely from all drop down menus? Is this by design?

This workaround would potentially work if I still had the option to choose all on the monitoring->triggers page to be able to view all events.

Comment by richlv [ 2014 Jan 08 ]

this might be caused by ZBX-7373

Comment by Alexander [ 2014 Jan 20 ]

I see the same (all of a sudden, it worked just today in the morning) on 2.2.1 with just 133 hosts and 11299 items. What's that "drop down first entry" option, where do I set it? And the PHP files where it fails are: zabbix/include/classes/class.ctag.php and /zabbix/include/classes/class.crow.php (this one listed just once so far)

Comment by Raymond Kuiper [ 2014 Apr 14 ]

@ Alexander, the option is in the in the general GUI options under Administration.

I'm running into this issue as well. Setting to 'none' as first entry does make latest data accessible for me, but this also affects the way active triggers are shown in the trigger overview screen and that breaks with the current monitoring process within our company.

Zabbix 2.2.3, 53 active hosts, 10705 active items.

I've changed memory limit in PHP from 128 to 256MB, that doesn't seem to help.

Comment by Raymond Kuiper [ 2014 Apr 14 ]

See also ZBXNEXT-2022

Comment by Pavel [ 2014 May 23 ]

Upgrade notes for zabbix 2.2.0:
"Latest data page now sends data for all entries, including collapsed ones. This may considerably increase page size in some instances."
Is it possible to make this behavior configurable?
This works more quick and comfortable in 2.0 in many cases.

Comment by Anton Samets [ 2014 May 23 ]

Plus one for make this feature configurable. On a lot of data it's really annoying...

Comment by Lukas Macura [ 2014 Jun 03 ]

We monitor lot of cisco switches and Zabbix is unusable when clicking into "Latest Data". There are hundred of ports on one switch. Problem is not in PHP but in postgresql. It dies on "out of memory" due to unlimited look into history. This is becouse we use partitions in postgresql.

Please help us to solve this. All other web pages are OK, but looking into latest data is unpossible. Even when looking into one switch, it can kill postgresql.

It is enough to put limitation into WHERE to filter only latest partition which will reduce memory cost greatly..

Comment by richlv [ 2014 Jun 20 ]

does ZBX-7373 help for those seeing this issue ?

Comment by Brett Anspach [ 2014 Jun 23 ]

I am experiencing the same issue. 1000 hosts, 600 nvps.
Any chance of a fix in 2.4?

Comment by Marc [ 2014 Jun 23 ]

ZBXNEXT-370 addresses this issue.

Comment by Blaine Schmidt [ 2014 Dec 02 ]

ZBXNEXT-370 resolves the issue related to None and All both showing up in the dropdown lists. It does not appear to resolve blank pages appearing when loading latest.php with too many items. I posted the following in the Zabbix Troubleshooting and Problems forum (with additional information here):

I ran some timings, with the following assumptions:

1. The template that I apply to each host perform LLD and ends up creating about 600 items per host
2. The server is operating as normal, with normal load, and nothing showing in top (monitor sw)
3. PHP is set to a memory_limit of 128M
4. CacheSize in Zabbix was set anywhere between 64MB and 1G, with no appreciable difference in timings
5. Working on a Macbook Pro running OS/X version 10.9.5
6. Using Google Chrome version 39.0.2171.27 beta 64-bit (but also tried Firefox 36.0a1)
7. Apache version is 2.2.15
8. Zabbix version is 2.4.2

The first column represents the number of hosts with the template applied. The second column represents the number of items that would be downloaded and displayed, if all of the + marks were expanded. The third column represents the amount of time that it took to display the latest.php page, after having previously applied a filter of "Host group" and "Application"...

02 hosts / 1200 / 00-01 second
04 hosts / 2400 / 02-03 seconds
08 hosts / 4800 / 04-05 seconds
16 hosts / 9600 / 08-10 seconds
24 hosts / 14400 / 14-16 seconds

...and the blank page starts appearing...and once the blank page appears, even unlinking and clearing the items from the individual hosts does not make the latest.php page display correctly.

The above appears to show the issue as linear in nature, as doubled amount doubles the time required to display. But is it due to the amount of data being transferred, or something else completely?

Addendum:

After inserting "ini_set('memory_limit', '1G');" the page loads correctly. Obviously, consuming that much memory is not reasonable...

+1 to the idea of making whether to load all items (whether the + is expanded or not) configurable...

Comment by Yves Vogl [ 2016 Mar 22 ]

We encountered the same issue in Zabbix 3 (#ZBX-10557).

If you raise the memory limit to 1G and above you'll possibly hit the max_execution_time limit next.

Comment by JamesH [ 2016 Apr 28 ]

I'm experiencing this issue in 2.4.1

Comment by Andrey Melnikov [ 2016 Apr 28 ]

Install Xdebug with https://github.com/splitbrain/xdebug-trace-tree and show result.

Comment by ZhiBang [ 2017 Jul 04 ]

I encountered the same problem, zabbix version is 3.0.9.
I've changed memory limit in PHP from 128 to 1024MB, that doesn't seem to help.
I re-created an account, this account can be accessed for latest data page.
Suspected of the latest data page data too much.

Generated at Thu Apr 25 03:52:13 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.