-
-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Huge amount of queries #467
Comments
This is mainly calls to the settings table, which is odd. We already are supposed to cache those entries. I'll take a look and see what's up. |
Just out of curiosity, are you doing those calls as the guest account, or some other account? |
Reduce the number of queries in the log function
Pull the latest lib/functions.php and let us know how it was reduced. |
I was calling as user_id = 1 (admin) I've pulled the latest functions.php, but overwriting my 1.1.0 versions with the pulled one resulted in HTTP500. So I checked your changes and patched them manually in my 1.1.0 version of functions.php. It feels as if cacti loads much faster and the mysql.log also has less queries. For exact the same scenario, the file is almost 50% reduced. |
Okay, closing this. Moving on. Looking forward to that pull request. The lib/auth.php is a beast. Please be careful. |
Running cacti 1.1.0 on my Raspberry Pi 3b:
When activating the MySQL general_log setting in the my.cnf and requesting the following url:
http://192.168.1.3/cacti/graph_view.php?action=get_node&tree_id=0&id=%23
This is an ajax request for requesting the main tree node in de graphs tab of cacti.
I get a huge amount of queries listed in the log. A lot of the queries are the same and are requesting the same variables in de settings table. Also there are queries querying primary keys with value 0 (zero).
I've attached the mysql.txt (see section 85 for all the queries executed for requesting this URL).
mysql.txt
Maybe it's possible to cache requested settings in a class (or collect all settings from the table in a static class and ask the class for the value of the specific setting). This should generate a lot less traffic with the MySQL server.
The text was updated successfully, but these errors were encountered: