You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Describe the bug
Displaying graphs in /graph_view.php?action=tree_content page is very slow with 26900 Devices and 458980 graphs.
This is due to a for loop in lib/html_tree.php, in the get_host_graph_list() function which produces 2 SQL request for each graph_template.
In our case this for loop iterates 900 times resulting in 1800 queries being executed, cumulating to an average of 12 seconds for the http request to complete.
Here is the extract of the code in lib/html_tree.php related to the issue (start at line 1409):
netniV
changed the title
The graph_view page takes a long time to complete when displaying a host's graphs
Poor performance showing a device's graphs on a tree
Mar 30, 2019
Describe the bug
Displaying graphs in /graph_view.php?action=tree_content page is very slow with 26900 Devices and 458980 graphs.
This is due to a for loop in lib/html_tree.php, in the get_host_graph_list() function which produces 2 SQL request for each graph_template.
In our case this for loop iterates 900 times resulting in 1800 queries being executed, cumulating to an average of 12 seconds for the http request to complete.
Here is the extract of the code in lib/html_tree.php related to the issue (start at line 1409):
These queries are executed in:
To Reproduce
Performance issue is due vast amount of graphs, devices and graph_templates in database resulting on many SQL query being executed.
Expected behavior
Decent loading time of graph_view.php when displaying list of graphs.
Screenshots

Additional context
Technical Support [Résumé]
Informations générales
Date | Tue, 19 Mar 2019 15:56:54 +0100
Cacti Version | 1.2.3
Cacti OS | unix
RRDtool Version Configuré | 1.4.0+
RRDtool Version Trouvé | 1.4.8
Équipements | 26425
Graphiques | 445487
Note
I have a fix ready to be evaluated that I will present in a PR soon.
The text was updated successfully, but these errors were encountered: