Project

General

Profile

Actions

Bug #11834

closed

host status migration is very slow

Added by Ohad Levy over 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DB migrations
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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.


Related issues 1 (0 open1 closed)

Related to Foreman - Feature #10782: Add global status for hostsClosedMarek Hulán06/11/2015Actions
Actions #1

Updated by Ohad Levy over 8 years ago

Actions #2

Updated by Dominic Cleal over 8 years ago

  • Assignee deleted (Marek Hulán)
  • translation missing: en.field_release set to 63

Can you provide some logs to show which queries?

Actions #3

Updated by Ohad Levy over 8 years ago

  1. we do host.each, not sure if we can avoid it, but we could try to loop in batches and load associated data.
  2. 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.
Actions #4

Updated by The Foreman Bot over 8 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2860 added
  • Pull request deleted ()
Actions #5

Updated by Marek Hulán over 8 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.

Actions #6

Updated by Dominic Cleal over 8 years ago

  • Assignee set to Marek Hulán
  • translation missing: en.field_release changed from 63 to 104
Actions #7

Updated by Marek Hulán over 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF