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
IcingaDB - poor performance when using custom variables in the queries #711
Comments
tactical_queries.txt |
ref/NC/775212 |
Hi, please share a few other facts:
Thanks |
Hi, thanks for taking care. To answer:
|
Hi, I run the queries from the previously attached text file. Attaching the |
NOTE: from my perspective the key issue is with having |
Hello, I just curious if provided information helped or if you were able to replicate the issue on your site ... thanks. |
We're still investigating. In theory, your adjustments make sense. We're still experimenting, because as of now we weren't able to replicate your results.
If you're really interested: https://github.com/Icinga/ipl-orm/blob/master/src/Compat/FilterProcessor.php |
Please show the result of |
hi, here the output: |
Hello, may I kindly ask if there is any update for the topic? Or any further details to provide? Thanks. |
Hey, our current findings indicate that the 5.7.12 MySQL Community Server you're using does not support the latest query optimizations. That's why we didn't notice this bottleneck yet. We're still investigating whether it makes sense to change how we generate these queries. |
We have similar issues when using "icingadb/filter/objects" via Access Control on Roles. |
We also use
we also use this filter in our roles as we did this until now in the monitoring-module - and as long as you're not an admin without any restrictions, the performance while loading the data is not much better than in ido |
Hello team,
I’d like to ask for a support regarding performance issues for DB queries running against the IcingaDB database.
I’m running a query for “tactical view” with limitation for hosts having specific custom variable, like https://.../icingaweb2/icingadb/tactical?host.vars.customer=XYZ
It takes over 2-3 minutes to get the result; similarly for other queries having the filer based on customer variables (e.g., hostgroups: https://.../icingaweb2/icingadb/hostgroups?hostgroup.name=team&host.vars.customer=XYZ runs over 3-5 mins).
Using the URL feature/param “format=sql” I was able to observe the corresponding SQL query (attached).
If I read the query for “tactical view” correctly, it loops through all the services, check if the service exists in the filtered list for selected custom variable and then calculate/sum the occurrences.
This seems to be a bit expensive query to me – to check each service if exists in the list (each service ID is passed into sub-query to evaluate) and then process/calculate the values.
I tried to adapt it (attached), while keeping the query’s logic, by selecting services having the IDs in the filtered list (not looping through all).
Running such query, I get same result, but the runtime is 400-500 times faster (!) – around 0.3-0.5 sec.
Attached are the print-screens for “tactical view” as well as for the hostgroups query, for original and adapted version.
Could you, please, review and confirm my findings? Could you, please, guide me/share few details which engine generates the queries, how are they build in PHP code?
Would it be possible to adjust the queries for better performance?
Thanks.
The text was updated successfully, but these errors were encountered: