Bug #11834
closed
host status migration is very slow
Added by Ohad Levy over 9 years ago.
Updated over 6 years ago.
Description
On a largish db, calculating the host status takes a whole lot of time.
it seems that many queries are repeating them selfs are simply could be eager loaded for the migration.
- Assignee deleted (
Marek Hulán)
- Translation missing: en.field_release set to 63
Can you provide some logs to show which queries?
- we do host.each, not sure if we can avoid it, but we could try to loop in batches and load associated data.
- the status calculation is done per host, which might not be avoidable, but I would like to see if we can wrap it in a host collection instead of a single host to avoid many n+1 queries.
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2860 added
- Pull request deleted (
)
I tried to fix some (n+1) queries and do the processing in batches (batch size didn't seem to have much effect), I don't see any major improvement. On the other hand, my DB is quite small.
- Assignee set to Marek Hulán
- Translation missing: en.field_release changed from 63 to 104
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Also available in: Atom
PDF