-
Notifications
You must be signed in to change notification settings - Fork 17
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
showHost option for icingadb #124
Comments
Hi Geert, it would be interesting what is mostly contributes to the 8 minutes load time. The frontend, backend or database? Imho fetching 6k rows should not take 8 minutes. The showHost loads the map the normal way and then opens the referenced host object. This will allow to use the map as usual in the same view (eg. further analysis of an outage). |
Hello, I am trying to collect information in the program to know how long each action takes. Now I see that the Data Controller restarts every 2 minutes. So that the processing of the 200k services is more than 2 minutes, regards, |
Hello, I had to adjust parameters so that PHP has the chance to create the map for my 6k hosts once : Parameterscat /etc/httpd/conf/httpd.conf /etc/opt/rh/rh-php73/php.ini ResultsIt takes 40 sec to read the 200k lines in the database. This loop takes about 7 minutes :
Multiple sessionsbut it could be because the session restarts every 2 minutes that the first session takes much more time because there are multiple processes running and running ... |
Thanks this helps a lot. I will try to reduce the loop runtime. In the meantime you can adjust the timer rate here https://github.com/nbuchwitz/icingaweb2-module-map/blob/master/public/js/module.js#L244. The value is in milliseconds, thus |
Hello nbuchwitz, I remove everything from the foreach except this
After 7 minutes I get the result of teller -> 229381 (number of records) I see in the monitoring that one virtual processor does everything and the other does nothing. I don't think you can improve anything at this point. I'll see if I can't create an extra option (such as objectType=hostonly) where I only request the hosts (6k) In any case, thanks for the support! regards, |
That's ~550 rows per second. Even if I'm a big fan of php-fpm I don't think that they can increase the speed here. The loop cannot be split in to different worker tasks which could run on another CPU core. Another thought: Is the database server running on spinning disks or flash? Maybe your DBA can have a look where the database server spends time on. Sometimes the right combination of an index can work miracles. |
Transfert of the 200k from the db to the memory takes 40 sec. I think we're just at the limit of php. |
Hm ok. So the 7 minutes are not even map processing code, but mostly processing of icinga db results (your simplified loop took also 7 minutes). The best solution would be to do some lazy loading and only request the host / service data for visible elements. But this would be a larger project for which I don't have time at the moment :( |
I'm not sure if my problem has the same root-cause. We're on "icingadb-only", which means the monitoring-module is disabled and the IDO-DB has been dropped. Since then klicking on the "Show on map"-link (https:///icingaweb2/map?showHost=hugo.fq.dn) shows the default-map immediately without any object. About 50 seconds later you see the circles of the objects in map but not a zoomed-view of the object I chose. |
Hello @tectumopticum My configuration is also completely icingadb/icingadb-web (ido completely disabled). On my production (6k objects, 230k services) everything works perfectly. To prevent it from doing a refresh, I set the refresh from 60000 to 0. I don't know if this info helps. |
@nbuchwitz @gbin2265 |
Hello, Shouldn't you modify your link as it is now for icingadb-web? Before : _host_facility=test Now : host.vars.facility=test |
I have no experience in the PHP programming language, and it is difficult to judge why it does not go that fast. But I'm glad I'm not the only one with the feeling that it's so slow Reading from the database (especially after the last modification) is fast for me, II did a simple test in the file application/controllers/DataController.php After the line 283
I do a loop of all objects without any action and this just takes so much time
I have the impression that there is so much information in the hostQuery that it just makes the loop so slow. But then again, I'm not a PHP programmer I leave this more to PHP specialists such as @nbuchwitz @sukhwinder33445 |
@nbuchwitz @sukhwinder33445
Hello,
Describe the bug
In icingaweb there is a link with the parameter 'showHost='.
This option will first request the complete list of all hosts (6k in my case),
create all points on the map and then filter only the host you request.
(in my situation this takes 8 minutes)
If you would do the same by directly filtering the 'host.name=',
it will first apply the filter to the database and then create the points on the map ,
and immediately I have the host on the map.
Possible Solution
Who should I ask to optimize this?
I create a case in icingaweb-db to replace the showhost with host.name
or
can you put an extra filter in the Data Controller that converts the showHost to host.name for icingadb ?
regards,
Geert
The text was updated successfully, but these errors were encountered: