Actions
Bug #11834
closedhost status migration is very slow
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.
Updated by Ohad Levy over 9 years ago
- Related to Feature #10782: Add global status for hosts added
Updated by Dominic Cleal over 9 years ago
- Assignee deleted (
Marek Hulán) - Translation missing: en.field_release set to 63
Can you provide some logs to show which queries?
Updated by Ohad Levy over 9 years ago
- 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.
Updated by The Foreman Bot about 9 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2860 added
- Pull request deleted (
)
Updated by Marek Hulán about 9 years ago
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.
Updated by Dominic Cleal about 9 years ago
- Assignee set to Marek Hulán
- Translation missing: en.field_release changed from 63 to 104
Updated by Marek Hulán about 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 553665c2a458b949d85c45aac9fea33271a2a9a0.
Actions