PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

smileymind
Posts: 25
Joined: Thu Oct 08, 2020 1:30 am

PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by smileymind »

Dear All,

Could anyone help my php error with WeatherMap? When alarm happen WeatherMap freeze not display any map, I tried to research many days but couldn't find solution :-(, I am so happy if anyone can help me.

CACTI version:Version 0.8.8h
OS:centos-release-7-9.2009.1.el7.centos.x86_64
DB: mariadb.x86_64 1:5.5.68-1.el7
PHP:PHP 5.4.16 (cli) (built: Apr 1 2020 04:07:17)
--------------------------------------------------------------------------------
[13-Jan-2021 17:33:28 Asia/Phnom_Penh] PHP Fatal error: Maximum execution time of 59 seconds exceeded in /var/www/cacti/plugins/weathermap/lib/HTML_ImageMap.class.php on line 422
---------------------------------------------------------------------------------
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by Howie »

Do you have one minute polling enabled? I think your maps just take too long to draw.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
smileymind
Posts: 25
Joined: Thu Oct 08, 2020 1:30 am

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by smileymind »

Yes, it one minutes polling, do you know how to make it load faster?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by Howie »

Well, first share some details about what you have.

What cacti version? What weathermap version? Do you use boost? Do you use use_poller_output in weathermap? If you look in the logs, you should see how long each map takes to draw - what are those times?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
smileymind
Posts: 25
Joined: Thu Oct 08, 2020 1:30 am

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by smileymind »

Howie wrote: Thu Jan 14, 2021 4:14 am Well, first share some details about what you have.

What cacti version? What weathermap version? Do you use boost? Do you use use_poller_output in weathermap? If you look in the logs, you should see how long each map takes to draw - what are those times?
1. Cacti vesion 0.8.8h
2. WeatherMap 0.98
3. No boost is using
4. I don't know how to verify I am using use_poller_output or not, please share instruction!
5. In error log it shows only "Maximum execution time of 59 seconds exceeded", so I think it should be take more than 1 minute to draws map. I have changed configuration for WeatherMap below but it seems not helpful.
-------------------------------------------------------------------------------------------------
[15-Jan-2021 14:48:29 Asia/Phnom_penh] PHP Fatal error: Maximum execution time of 59 seconds exceeded in /var/www/cacti/plugins/weathermap/lib/HTML_ImageMap.class.php on line 422
[15-Jan-2021 14:49:29 Asia/Phnom_penh] PHP Fatal error: Maximum execution time of 59 seconds exceeded in /var/www/cacti/plugins/weathermap/lib/HTML_ImageMap.class.php on line 422
[15-Jan-2021 14:50:30 Asia/Phnom_penh] PHP Fatal error: Maximum execution time of 59 seconds exceeded in /var/www/cacti/plugins/weathermap/lib/HTML_ImageMap.class.php on line 422
[15-Jan-2021 14:51:31 Asia/Phnom_penh] PHP Fatal error: Maximum execution time of 59 seconds exceeded in /var/www/cacti/plugins/weathermap/lib/HTML_ImageMap.class.php on line 55
----------------------------------------------------------------------------------------------------
Attachments
weathermap_setting.PNG
weathermap_setting.PNG (32.4 KiB) Viewed 16926 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by Howie »

OK, lets see if poller_output will help.

To enable it, add

SET rrd_use_poller_output 1

at the top of all your maps, OR go to the "global map settings" button in the Weathermap management screen and add a new entry with name "rrd_use_poller_output" and value "1". That will do the same thing from one place.

Then wait a few poller cycles.

What this does is collect data directly from the poller, instead of reading rrd files, but it takes a couple of poller cycles to figure out which data it needs, and to populate the database table that it uses. After that, it *should* be faster than reading the rrd files.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
smileymind
Posts: 25
Joined: Thu Oct 08, 2020 1:30 am

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by smileymind »

Howie wrote: Fri Jan 15, 2021 3:52 am OK, lets see if poller_output will help.

To enable it, add

SET rrd_use_poller_output 1

at the top of all your maps, OR go to the "global map settings" button in the Weathermap management screen and add a new entry with name "rrd_use_poller_output" and value "1". That will do the same thing from one place.

Then wait a few poller cycles.

What this does is collect data directly from the poller, instead of reading rrd files, but it takes a couple of poller cycles to figure out which data it needs, and to populate the database table that it uses. After that, it *should* be faster than reading the rrd files.

Thank for your feedback, the issue solved due to my colleague changed poller.php code of "ini_set("max_execution_time", MAX_POLLER_RUNTIME + 1);" from default value +1 to +60, also I add "rrd_use_poller_output" as your suggestion weathermap is loads more faster and no errors anymore.
Attachments
max_execute_time.PNG
max_execute_time.PNG (31.97 KiB) Viewed 16914 times
max_execute_time_bf.PNG
max_execute_time_bf.PNG (34.79 KiB) Viewed 16914 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by Howie »

I don't think you should change the max runtime - I think you can have two pollers running at the same time now, which will cause problems with all your graphs...
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
smileymind
Posts: 25
Joined: Thu Oct 08, 2020 1:30 am

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by smileymind »

Howie wrote: Tue Jan 19, 2021 2:41 am I don't think you should change the max runtime - I think you can have two pollers running at the same time now, which will cause problems with all your graphs...
So what can I do to solve this? if I change to +1 default value it will show error and weathermap will freeze again. :(
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by Howie »

I thought you said weathermap was much faster?

I read that as "it takes less than a minute now"
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
smileymind
Posts: 25
Joined: Thu Oct 08, 2020 1:30 am

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by smileymind »

Howie wrote: Tue Jan 19, 2021 5:40 am I thought you said weathermap was much faster?

I read that as "it takes less than a minute now"
Yes, it quite good when adjust max_executetime +60 but when change back to +1 it will freeze again.
smileymind
Posts: 25
Joined: Thu Oct 08, 2020 1:30 am

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by smileymind »

Here latest error of weathermap, it said increase memory limit but we adjust it to 20G already.
Attachments
technical_support.PNG
technical_support.PNG (29.7 KiB) Viewed 16893 times
error_php.PNG
error_php.PNG (16.83 KiB) Viewed 16893 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by Howie »

It doesn't say that. It says IF THIS IS THE LAST LINE IN THE LOGS (it isn't) adjust memory_limit. Because the php memory_limit immediately kills the process, there is no other way to write this message.

Is there any chance you could PM me a copy of the map file? I'm very curious what map takes 32 seconds to draw... I've never had one map take that long.

But I think 20K datasources in <1 minute is pretty good without getting into Boost. You might just be hitting the limits of what you can do with your current configuration. Boost will improve things, but makes it more complicated. PHP 7 will likely make it all faster but I don't think you can use that with Cacti 0.8.8. None of that is a weathermap issue though - just Cacti performance tuning.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Badikov
Posts: 8
Joined: Mon Jan 18, 2021 10:25 am

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by Badikov »

In /etc/php/versionNumber/apache/php.ini

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 30

; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = 60

And the same parameter in /etc/php/versionNumber/cli/php.ini

Try to change, may be it will help you.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: PHP Fatal error: PHP Fatal error: Maximum execution time of 59 seconds exceeded

Post by Howie »

Having two pollers running at the same time is almost certainly bad.

I only had a brief look at the map, and it seems pretty normal, even if it's quite big. I noticed there is no rrd_use_poller_output in it though - did you do that in the map settings? What was the render time for the map before you did it? (grep "run complete" cacti.log should tell you)
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests