graph_image.php fails to render a graph with 736 items.

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
nullrouten
Posts: 4
Joined: Fri Jun 12, 2009 4:13 pm

graph_image.php fails to render a graph with 736 items.

Post by nullrouten »

I have a graph with 736 items being stacked. The graph image doesn't load... shows a broken image after 1 second. The headers on the image say HTTP 200, but length 0.

I can use graph debug mode to obtain the rrdtool command... and running said command manually produces a valid PNG... but graph_image.php fails silently. I've turned on php error logging... didn't show anything. cacti-0.8.8, centos (2.6.32-279.9.1.el6.centos.plus.x86_64), plenty of disk space and memory free, PHP 5.3.3, out of ideas over here... I have the rrdtool command that I copied right out of the webui (attached)... that runs fine, but not via the web ui.

If anyone has any ideas on debugging PHP, or just knows that I have too many items (and how to fix), that'd be great :)
Attachments
rrdtool.txt
(132.99 KiB) Downloaded 266 times
victorantunes
Cacti User
Posts: 111
Joined: Fri Sep 28, 2012 6:52 pm

Re: graph_image.php fails to render a graph with 736 items.

Post by victorantunes »

To debug PHP, configure your php.ini to display errors on the page:

Code: Select all

display_errors = On
and to set the debugging level:

Code: Select all

error_reporting = E_ALL & E_STRICT
and restart Apache. Post the results after that.
nullrouten
Posts: 4
Joined: Fri Jun 12, 2009 4:13 pm

Re: graph_image.php fails to render a graph with 736 items.

Post by nullrouten »

Same... empty response, no error. (EDIT: I tested from the web UI and also the cli (as shown below)) If I simply delete some of the items in the graph (to bring the total number down) it works... but I haven't determined exactly what the limit is, or if its consistent graph to graph. It is affecting 3-4 of my graphs at this point (the 3-4 largest ones, as for item count).

Code: Select all

[user@netmon100 ~]$ grep -e ^error_reporting -e ^display_errors /etc/php.ini
error_reporting = E_ALL & E_STRICT
display_errors = On

Code: Select all

[user@netmon100 ~]$ sudo /etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                              [  OK  ]

Code: Select all

[user@netmon100 cacti]$ php-cgi graph_image.php action=view local_graph_id=8969 rra_id=5
X-Powered-By: PHP/5.3.3
Content-type: image/png

Code: Select all

[user@netmon100 cacti]$ curl -v "http://cacti.mydomain.net/graph_image.php?action=view&local_graph_id=8969&rra_id=5"
* About to connect() to cacti.mydomain.net port 80 (#0)
*   Trying 10.8.0.5... connected
* Connected to cacti.mydomain.net (10.8.0.5) port 80 (#0)
> GET /graph_image.php?action=view&local_graph_id=8969&rra_id=5 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
> Host: cacti.mydomain.net
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 21 May 2013 06:03:59 GMT
< Server: Apache/2.2.15 (CentOS)
< X-Powered-By: PHP/5.3.3
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Last-Modified: Tue, 21 May 2013 06:03:59 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< P3P: CP="CAO PSA OUR"
< Set-Cookie: Cacti=t6lv6mktup9ijcgaeepolv2056; path=/
< Content-Length: 0
< Connection: close
< Content-Type: image/png
<
* Closing connection #0
[user@netmon100 cacti]$
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: graph_image.php fails to render a graph with 736 items.

Post by phalek »

Check you command line length limits:

Code: Select all

[server ]# getconf ARG_MAX
131072
On my Centos this is 131072 ( or 128kb )

your rrdtool command has a size of 133944 characters, so it wouldn't be able to run it on my Centos system. Will it do on yours ?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
nullrouten
Posts: 4
Joined: Fri Jun 12, 2009 4:13 pm

Re: graph_image.php fails to render a graph with 736 items.

Post by nullrouten »

Code: Select all

[user@netmon100 ~]$ getconf ARG_MAX
2621440
The rrdtool command runs fine on a bash shell... just not via cacti. I too suspected some length limit of a variable, array, parameter, etc in PHP... but dont know what to check, and PHP isn't throwing any error when this happens. The memory limit for PHP is already at 256MB I think, and changing that to 512MB made no difference.

Thanks for the suggestion tho!
nullrouten
Posts: 4
Joined: Fri Jun 12, 2009 4:13 pm

Re: graph_image.php fails to render a graph with 736 items.

Post by nullrouten »

ping. :)
flw521521
Posts: 6
Joined: Thu Dec 01, 2011 9:18 am

Re: graph_image.php fails to render a graph with 736 items.

Post by flw521521 »

i had to say,i got the same problem with you,my max item number of graph was 760,and i'm debuging it now and try to find out why
Have you fixed this problem?
flw521521
Posts: 6
Joined: Thu Dec 01, 2011 9:18 am

Re: graph_image.php fails to render a graph with 736 items.

Post by flw521521 »

@gandalf
can you help us?
i think we are the most loyal users of cacti,we had made cacti in important use :lol:
flw521521
Posts: 6
Joined: Thu Dec 01, 2011 9:18 am

Re: graph_image.php fails to render a graph with 736 items.

Post by flw521521 »

nullrouten wrote:ping. :)
hi,can u tell me your progress of this problem?
gajillion
Posts: 7
Joined: Tue Sep 06, 2011 10:54 am

Re: graph_image.php fails to render a graph with 736 items.

Post by gajillion »

Any word on this? I have the exact same issue. I'm building aggregate graphs and the individual graphs work, but when I stack them together, the graphs with too many items fail silently.
gajillion
Posts: 7
Joined: Tue Sep 06, 2011 10:54 am

Re: graph_image.php fails to render a graph with 736 items.

Post by gajillion »

gajillion wrote:Any word on this? I have the exact same issue. I'm building aggregate graphs and the individual graphs work, but when I stack them together, the graphs with too many items fail silently.
Answered my own question. I straced the system call that HTTP was passing to rrdtool.

[/* 6 vars */]) = -1 E2BIG (Argument list too long)

This is an OS limitation and not a whole lot you can do about it.
ivan777
Posts: 1
Joined: Sat Nov 29, 2014 4:07 pm

Re: graph_image.php fails to render a graph with 736 items.

Post by ivan777 »

I had the same problem and I found what was the reason. Try to remove popen function from disabled_functions list in your php.ini file.
After I did that my graphs work like a charm. Here is more detailed instruction: http://druss.pp.ua/2014/11/solution-cac ... lem-fixed/ (I used it to solve this problem).
karrakis
Posts: 10
Joined: Fri Oct 10, 2014 7:48 am
Contact:

Re: graph_image.php fails to render a graph with 736 items.

Post by karrakis »

Hello,

Sorry for forum diging... and Sorry for my English.

Is there some new information about the popen command line limit that is really lesser than the OS limit ? Did a bug was open for PHP ?

I have to make work a 1200 DataSources Aggregated Graph :/
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest