Description of problem:
Performance testing shows that there's most likely something done inefficiently in the Registered hosts report. I've tested on a Satellite with 10 000 systems.
When running a report without filters, it takes 8 minutes (there are no performance requirements specified so this should be fine). However, when running with a host filter such that it limits hosts to only 500 of these 10 000, the report generation consistently fails with ISE after 30 minutes.
Tested on a RHEL7 machine with Intel Xeon, 4 sockets, 32 cores, hyperthreading, 2.7 Ghz, 128 GB RAM
Version-Release number of selected component (if applicable):
6.5 snap 5
Deterministic on one machine but may be influenced by the machine's performance.
Steps to Reproduce:
1. Have a Satellite with 10 000 systems, 500 of them with some easily filterable name
2. Monitor -> Report Templates -> Registered Hosts -> Generate
3. Fill in a filter such that it selects 500 systems
ISE after 30 minutes
Report generated. I'd expect it to be faster than without the filter
Created redmine issue https://projects.theforeman.org/issues/25624 from this bug
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25624 has been resolved.
Verification blocked by bug 1673898.
Verified with Sat 6.5 snap 21.
Generating a report is now ~ 8 times faster (1 minute for 10000 systems). Also, filtering all hosts H to only hosts h is now faster than not filtering at all for |h|<<|H| (10 seconds for 700 systems).
The performance is, however, still a limit: with filter in form "<name>", for |h|=|H|=10000, the generating takes half an hour.